You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#. Setup a local virtual environment in the folder: :bash:`pyenv virtualenv kerneltuner` (or whatever environment name you prefer).
57
57
#. Set the Python versions so they can be found: :bash:`pyenv local 3.8 3.9 3.10 3.11` (replace :bash:`local` with :bash:`global` when not using the virtualenv).
58
-
#. `Install Poetry <https://python-poetry.org/docs/#installing-with-the-official-installer>`__: :bash:`curl -sSL https://install.python-poetry.org | python3 -`. Make sure to add it to :bash:`PATH` as instructed at the end of the installation.
* Use :bash:`curl -sSL https://install.python-poetry.org | python3 -` to install Poetry.
60
+
* Make sure to add Poetry to :bash:`PATH` as instructed at the end of the installation.
61
+
* Add the poetry export plugin with :bash:`poetry self add poetry-plugin-export`.
59
62
#. Make sure that non-Python dependencies are installed if applicable, such as CUDA, OpenCL or HIP. This is described in :ref:`Installation <installation>`.
60
63
#. Re-open the shell for changes to take effect. Activate the environment with :bash:`pyenv activate kerneltuner`.
61
64
#. Install the project, dependencies and extras: :bash:`poetry install --with test,docs -E cuda -E opencl -E hip`, leaving out :bash:`-E cuda`, :bash:`-E opencl` or :bash:`-E hip` if this does not apply on your system. To go all-out, use :bash:`--all-extras`
@@ -87,7 +90,9 @@ Steps without :bash:`sudo` access (e.g. on a cluster):
87
90
#. Make sure that non-Python dependencies are loaded if applicable, such as CUDA, OpenCL or HIP. On most clusters it is possible to load (or unload) modules (e.g. CUDA, OpenCL / ROCM). For more information, see :ref:`Installation <installation>`.
88
91
* Do not forget to make sure the paths are set correctly. If you're using CUDA, the desired CUDA version should be in :bash:`$PATH`, :bash:`$LD_LIBARY_PATH` and :bash:`$CPATH`.
89
92
* [Optional] the loading of modules and setting of paths is likely convenient to put in your :bash:`.bash_profile` or :bash:`.bashrc`.
* Use :bash:`curl -sSL https://install.python-poetry.org | python3 -` to install Poetry.
95
+
* Add the poetry export plugin with :bash:`poetry self add poetry-plugin-export`.
91
96
#. Install the project, dependencies and extras: :bash:`poetry install --with test,docs -E cuda -E opencl -E hip`, leaving out :bash:`-E cuda`, :bash:`-E opencl` or :bash:`-E hip` if this does not apply on your system. To go all-out, use :bash:`--all-extras`.
92
97
* If you run into "keyring" or other seemingly weird issues, this is a known issue with Poetry on some systems. Do: :bash:`pip install keyring`, :bash:`python3 -m keyring --disable`.
93
98
* Depending on the environment, it may be necessary or convenient to install extra packages such as :bash:`cupy-cuda11x` / :bash:`cupy-cuda12x`, and :bash:`cuda-python`. These are currently not defined as dependencies for kernel-tuner, but can be part of tests.
session.warn(f"Detected CUDA version: {cuda_version}")
175
+
# if we need to install the CUDA extras, first install pycuda seperately, reason:
166
176
# since version 2022.2 it has `oldest-supported-numpy` as a build dependency which doesn't work with Poetry
167
-
try:
168
-
session.install("pycuda") # Attention: if changed, check `pycuda` in pyproject.toml as well
169
-
exceptExceptionaserror:
170
-
session.log(error)
171
-
session.warn(install_warning)
177
+
if" not found: "insession.run("pip", "show", "pycuda", external=True, silent=True, success_codes=[0,1]):
178
+
# if PyCUDA is not installed, install it
179
+
session.warn("PyCUDA not installed")
180
+
try:
181
+
session.install("pycuda", "--no-cache-dir", "--force-reinstall") # Attention: if changed, check `pycuda` in pyproject.toml as well
182
+
exceptExceptionaserror:
183
+
session.log(error)
184
+
session.warn(install_warning)
185
+
else:
186
+
session.warn("PyCUDA installed")
187
+
# if PyCUDA is already installed, check whether the CUDA version PyCUDA was installed with matches the current CUDA version
188
+
session.install("numpy") # required by pycuda.driver
189
+
pycuda_version=session.run("python", "-c", "import pycuda.driver as drv; drv.init(); print('.'.join(list(str(d) for d in drv.get_version())))", silent=True)
session.warn(f"PyCUDA was compiled with a version of CUDA ({pycuda_version}) that does not match the current version ({cuda_version}). Re-installing.")
193
+
try:
194
+
session.install("pycuda", "--no-cache-dir", "--force-reinstall") # Attention: if changed, check `pycuda` in pyproject.toml as well
195
+
exceptExceptionaserror:
196
+
session.log(error)
197
+
session.warn(install_warning)
172
198
ifinstall_openclandsession.python=="3.8":
173
-
# if we need to install the OpenCL extras, first install pyopencl seperately.
174
-
# it has `oldest-supported-numpy` as a build dependency which doesn't work with Poetry, but only for Python<3.9
199
+
# if we need to install the OpenCL extras, first install pyopencl seperately, reason:
200
+
# it has `oldest-supported-numpy` as a build dependency which doesn't work with Poetry, but only for Python<3.9
175
201
try:
176
202
session.install("pyopencl") # Attention: if changed, check `pyopencl` in pyproject.toml as well
0 commit comments