pycuda icon indicating copy to clipboard operation
pycuda copied to clipboard

DynamicModule SDK library path

Open matthiaswilms opened this issue 4 years ago • 6 comments

Hello, I would just like to confirm this consideration

TODO: - Is $CUDA_ROOT/lib64 the correct path to assume for 64-Bit CUDA libraries on Linux?

in _locate_cuda_libdir of the DynamicModule class in compiler.py

I'm running 64-bit Linux (Ubuntu 20.04) and installed cuda and pycuda in a conda environment. In particular _locate_cuda_libdir ends up in this case for me:

if libdir is None:
    nvcc_path = _find_nvcc_on_path()
    if nvcc_path is not None:
        libdir = join(os.path.dirname(nvcc_path), "..", "lib64")

However the correct directory name is just "lib" instead of "lib64" in my installation. Providing the correct path in the constructor of course makes it work.

matthiaswilms avatar Nov 14 '21 11:11 matthiaswilms

What version of the CUDA toolkit do you have? It's lib64 on mine. (11.2.2 installed from Debian.)

inducer avatar Nov 14 '21 19:11 inducer

I can't seem to dig up 11.2.2 on conda anywhere to test that, but 11.1.1, 11.3.1 (which I am running) and 11.5.0 all result in the folder being lib for me.

matthiaswilms avatar Nov 15 '21 08:11 matthiaswilms

I just manually installed CUDA, and as per the installation instructions , the folder is named lib64. So it seems the above is a conda specific situation. Edit: I don't know too much about any of this, but my impression is conda packages are expected to always install into lib, lib64 is not used.

matthiaswilms avatar Nov 15 '21 09:11 matthiaswilms

I suspect that test could be improved by checking if lib64 exists, and if it does not, to try lib.

inducer avatar Nov 15 '21 22:11 inducer

PRs welcome.

inducer avatar Nov 15 '21 22:11 inducer

FWIW, if you're using conda, you might as well use the pycuda package from conda-forge.

inducer avatar Nov 15 '21 22:11 inducer