File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ fn load_ptx_with_log(ptx: &str) -> Result<Module, Box<dyn Error>> {
7878
7979 // The driver accepted the PTX; drop our raw handle and re-load via cust so the
8080 // caller gets a typed Module with cust's lifetime/drop machinery.
81- unsafe { driver_sys:: cuModuleUnload ( module_ptr) } ;
81+ let _ = unsafe { driver_sys:: cuModuleUnload ( module_ptr) } ;
8282 Module :: from_ptx ( ptx, & [ ] ) . map_err ( |e| e. into ( ) )
8383}
8484
Original file line number Diff line number Diff line change 8484 CUDA_LIBRARY_PATH =
8585 "${ cudaRoot } /targets/x86_64-linux/lib:${ cudaRoot } /lib64:${ cudaRoot } /lib64/stubs" ;
8686 } ;
87+ # Symlink every NVIDIA-shipped driver library (libcuda, libnvidia-*) into a
88+ # single shim dir that we then stick on LD_LIBRARY_PATH. libcuda alone is not
89+ # enough: the driver will dlopen companions like libnvidia-ptxjitcompiler.so.1
90+ # when JITing PTX, and failing to find them surfaces as
91+ # CUDA_ERROR_JIT_COMPILER_NOT_FOUND from cuModuleLoadDataEx.
8792 driverShimHook = ''
8893 driver_shim_dir="$PWD/.nix-driver-libs"
8994 mkdir -p "$driver_shim_dir"
90- if [ -e "${ driverLibPath } " ]; then
91- ln -sf "${ driverLibPath } " "$driver_shim_dir/libcuda.so.1"
92- fi
95+ for src in "${ driverLibDir } "/libcuda.so* "${ driverLibDir } "/libnvidia-*.so*; do
96+ [ -e "$src" ] || continue
97+ ln -sf "$src" "$driver_shim_dir/$(basename "$src")"
98+ done
9399 '' ;
94100
95101 # ---- LLVM 7-only shell ----
You can’t perform that action at this time.
0 commit comments