feat(overlays/torch): add /run/opengl-driver/lib to RPATH

This allows resolving libcuda.so.1
This commit is contained in:
DavHau 2023-09-13 00:01:25 +02:00
parent 8d5178a665
commit 77eeb06927

View File

@ -3,6 +3,15 @@
lib,
...
}: {
env.autoPatchelfIgnoreMissingDeps = ["libcuda.so.1"];
# stripping doesn't reduce the file size much, and it takes a long time
mkDerivation.dontStrip = true;
# this file is patched manually, so ignore it in autoPatchelf
env.autoPatchelfIgnoreMissingDeps = ["libcuda.so.1"];
# patch the rpath so libcuda.so.1 can be found at /run/opengl-driver/lib
env.cudaPatchPhase = ''
patchelf $out/${config.deps.python.sitePackages}/torch/lib/libcaffe2_nvrtc.so \
--add-rpath /run/opengl-driver/lib
'';
mkDerivation.postPhases = ["cudaPatchPhase"];
}