Skip to content

NVVM bindings not working on Windows + CUDA conda packages #453

Closed

Description

@leofang

As discussed offline, the search logic here

# First check if the DLL has been loaded by 3rd parties
try:
handle = win32api.GetModuleHandle(dll_name)
except:
pass
else:
break
# Next, check if DLLs are installed via pip
for sp in get_site_packages():
mod_path = os.path.join(sp, "nvidia", "nvJitLink", "bin")
if not os.path.isdir(mod_path):
continue
os.add_dll_directory(mod_path)
try:
handle = win32api.LoadLibraryEx(
# Note: LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR needs an abs path...
os.path.join(mod_path, dll_name),
0, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)
except:
pass
else:
break
# Finally, try default search
try:
handle = win32api.LoadLibrary(dll_name)
except:
pass
else:
break

does not look for conda installations , which has the following path:

%CONDA_PREFIX%\Library\nvvm\lib\x64\nvvm.lib

One way to fix it is to patch to the internal template and regenerate the above file.

Activity

  1. added
    bugSomething isn't working
    cuda.bindingsEverything related to the cuda.bindings module
    P0High priority - Must do!
    on Feb 18, 2025
  2. leofang commented on Feb 18, 2025

    @leofang
    MemberAuthor

    (FWIW this is the reason why we want to have a general solution #451 🙂)

  3. leofang commented on Feb 18, 2025

    @leofang
    MemberAuthor

    To make the situation worse, CUDA 11 and CUDA 12 conda packages have different layouts:
    https://github.com/conda-forge/cudatoolkit-feedstock/blob/0f01f6edfe22e77ac068daa46505711a1481272e/recipe/meta.yaml#L681-L683
    (see docs in https://github.com/conda-forge/cuda-feedstock/tree/main/recipe for more info on the "new" layout)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings module

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions