Summary
libnvvm-sys and nvjitlink-sys ignore CUDA_TOOLKIT_PATH when discovering CUDA runtime libraries, even though the project build path and CI use CUDA_TOOLKIT_PATH.
Problem
A user can build CUDA bindings against CUDA_TOOLKIT_PATH, but runtime discovery for libNVVM and nvJitLink still searches only:
CUDA_HOME
CUDA_PATH
/usr/local/cuda
/opt/cuda
This makes cargo oxide doctor and LTOIR/libdevice-related workflows fail even when the CUDA Toolkit root is correctly supplied via the project-supported environment variable.
Expected
Runtime discovery should include CUDA_TOOLKIT_PATH, preferably before CUDA_HOME and CUDA_PATH, matching the build script and CI behavior.
Proposed fix
Update both sys crates to search CUDA roots in this order:
CUDA_TOOLKIT_PATH
CUDA_HOME
CUDA_PATH
/usr/local/cuda
/opt/cuda
Summary
libnvvm-sysandnvjitlink-sysignoreCUDA_TOOLKIT_PATHwhen discovering CUDA runtime libraries, even though the project build path and CI useCUDA_TOOLKIT_PATH.Problem
A user can build CUDA bindings against
CUDA_TOOLKIT_PATH, but runtime discovery for libNVVM and nvJitLink still searches only:CUDA_HOMECUDA_PATH/usr/local/cuda/opt/cudaThis makes
cargo oxide doctorand LTOIR/libdevice-related workflows fail even when the CUDA Toolkit root is correctly supplied via the project-supported environment variable.Expected
Runtime discovery should include
CUDA_TOOLKIT_PATH, preferably beforeCUDA_HOMEandCUDA_PATH, matching the build script and CI behavior.Proposed fix
Update both sys crates to search CUDA roots in this order:
CUDA_TOOLKIT_PATHCUDA_HOMECUDA_PATH/usr/local/cuda/opt/cuda