about summary refs log tree commit diff
path: root/pkgs/development/cuda-modules/generic-builders
diff options
context:
space:
mode:
authorYann Hamdaoui <yann.hamdaoui@tweag.io>2023-11-17 16:51:48 +0100
committerYann Hamdaoui <yann.hamdaoui@tweag.io>2023-12-12 15:15:48 +0100
commitd6c198a5d95f39fbd54042f1b7b874461c8e8951 (patch)
treeeb7c1118b7a11ac0783b6cd00b2fefc7ed64d6ed /pkgs/development/cuda-modules/generic-builders
parentfc25bd00779bfc3dbe2e8eb9f7d6e963be29cc42 (diff)
Enable cuda_compat by default on Jetson devices
Some nvidia devices, such as the Jetson family, support the Nvidia compatibility package (nvidia_compat) which allows to run executables built against a higher CUDA major version on a system with an older CUDA driver. On such platforms, the consensus among CUDA maintainers is that there is no downside in always enabling it by default.

This commit links to the relevant cuda_compat shared libraries by patching the CUDA core packages' runpaths when cuda_compat is available, in the same way as we do for OpenGL drivers currently.
Diffstat (limited to 'pkgs/development/cuda-modules/generic-builders')
-rw-r--r--pkgs/development/cuda-modules/generic-builders/manifest.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix
index 7ddecb7ed723a..c7ff0f53bb747 100644
--- a/pkgs/development/cuda-modules/generic-builders/manifest.nix
+++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix
@@ -1,6 +1,7 @@
 {
   # General callPackage-supplied arguments
   autoAddOpenGLRunpathHook,
+  autoAddCudaCompatRunpathHook,
   autoPatchelfHook,
   backendStdenv,
   fetchurl,
@@ -126,6 +127,14 @@ backendStdenv.mkDerivation (
       # Check e.g. with `patchelf --print-rpath path/to/my/binary
       autoAddOpenGLRunpathHook
       markForCudatoolkitRootHook
+    ]
+    # autoAddCudaCompatRunpathHook depends on cuda_compat and would cause
+    # infinite recursion if applied to `cuda_compat` itself (beside the fact
+    # that it doesn't make sense in the first place)
+    ++ lib.optionals (pname != "cuda_compat" && flags.isJetsonBuild) [
+      # autoAddCudaCompatRunpathHook must appear AFTER autoAddOpenGLRunpathHook.
+      # See its documentation in ./setup-hooks/extension.nix.
+      autoAddCudaCompatRunpathHook
     ];
 
     buildInputs =