1# autoAddCudaCompatRunpath hook must be added AFTER `setupCudaHook`. Both
2# hooks prepend a path with `libcuda.so` to the `DT_RUNPATH` section of
3# patched elf files, but `cuda_compat` path must take precedence (otherwise,
4# it doesn't have any effect) and thus appear first. Meaning this hook must be
5# executed last.
6{
7 autoFixElfFiles,
8 cuda_compat ? null,
9 makeSetupHook,
10}:
11makeSetupHook {
12 name = "auto-add-cuda-compat-runpath-hook";
13 propagatedBuildInputs = [ autoFixElfFiles ];
14
15 substitutions = {
16 libcudaPath = "${cuda_compat}/compat";
17 };
18
19 meta =
20 let
21 # Handle `null`s in pre-`cuda_compat` releases,
22 # and `badPlatform`s for `!isJetsonBuild`.
23 platforms = cuda_compat.meta.platforms or [ ];
24 badPlatforms = cuda_compat.meta.badPlatforms or platforms;
25 in
26 {
27 inherit badPlatforms platforms;
28 };
29} ./auto-add-cuda-compat-runpath.sh