Commit Graph

22 Commits

Author SHA1 Message Date
Wolfgang Walther
4153e8f02f
cuda-modules: refactor appending cmakeFlags in setup hook
cudaPackages already builts with structuredAttrs, but the cmakeFlags+=
pattern incorrectly appends the additional flags to the first array
argument with a space - which is now part of that argument itself since
#318614, which added support for structuredAttrs to cmake.
2024-09-08 22:06:42 +02:00
Connor Baker
c66994ce1c
Merge pull request #301416 from ConnorBaker/feat/cudaPackages-lessons-learned-from-cross-compilation-attempt
cuda-modules: apply lessons learned from cross-compilation attempts
2024-04-18 20:10:59 -04:00
Connor Baker
5ee7bfc443 cudaPackages.setupCudaHook: fix error when reading empty marker 2024-04-18 16:31:18 +00:00
Connor Baker
02966afc54 cudaPackages.setupCudaHook: always set return explicitly
On NixOS, the the return status is that of the last command executed within the function or script.

When we're doing tests immediately before the return, the value you end up returning might not be what you want.
2024-04-18 16:31:18 +00:00
Connor Baker
a31b0d7f95 cudaPackages.setupCudaHook: sourcing messages should match hook name 2024-04-18 16:31:18 +00:00
Connor Baker
9230c2cc8d cudaPackages.markForCudatoolkitRootHook: fix bug with strictDeps
The setupCudaHook always checks for the existence of `$prefix/nix-support/include-in-cudatoolkit-root`, so we need to be sure
it always exists. It isn't populated when `strictDeps` is set, but it must exist.
2024-04-18 16:31:16 +00:00
Jonathan Ringer
52eb8850b8
cudaPackages.autoAdd{Driver,OpengGL}Runpath: deprecate 2024-04-10 08:31:19 -07:00
Connor Baker
ad2a4e862c cudaPackages.markForCudatoolkitRootHook: always set return explicitly 2024-04-10 14:14:00 +00:00
Someone Serge
39f35098d5 cudaPackages.autoAddDriverRunpath: drop the redundant copy of the hook 2024-04-03 08:36:41 +00:00
Connor Baker
93b08a7061 {pkgs/development/cuda-modules,pkgs/test/cuda,pkgs/top-level/cuda-packages.nix}: reformat all CUDA files with nixfmt-rfc-style 2023-03-01
```bash
nix run github:NixOS/nixpkgs/ab6071eb54cc9b66dda436111d4f569e4e56cbf4#nixfmt-rfc-style -L --allow-import-from-derivation -- pkgs/development/cuda-modules pkgs/test/cuda pkgs/top-level/cuda-packages.nix
```
2024-04-01 01:14:28 +00:00
Someone Serge
4006c2490f
cudaPackages.autoAddOpenGLRunpath: keep an alias for compatibility 2024-03-15 15:06:32 +00:00
Yann Hamdaoui
63746cac08
cudaPackages: generalize and refactor setup hook
This PR refactor CUDA setup hooks, and in particular
autoAddOpenGLRunpath and autoAddCudaCompatRunpathHook, that were using a
lot of code in common (in fact, I introduced the latter by copy pasting
most of the bash script of the former). This is not satisfying for
maintenance, as a recent patch showed, because we need to duplicate
changes to both hooks.

This commit abstract the common part in a single shell script that
applies a generic patch action to every elf file in the output. For
autoAddOpenGLRunpath the action is just addOpenGLRunpath (now
addDriverRunpath), and is few line function for
autoAddCudaCompatRunpathHook.

Doing so, we also takes the occasion to use the newer addDriverRunpath
instead of the previous addOpenGLRunpath, and rename the CUDA hook to
reflect that as well.

Co-Authored-By: Connor Baker <connor.baker@tweag.io>
2024-03-15 15:54:21 +01:00
hacker1024
43afe6a62b
cudaPackages.autoAddCudaCompatRunpathHook: Correctly inherit platforms from cuda_compat 2024-01-17 15:34:40 +11:00
Someone Serge
18b114d8bf
cudaPackages_11_4.saxpy: clean(er) eval error 2024-01-12 20:24:50 +00:00
Connor Baker
9c4e129963
Merge pull request #277213 from danielfullmer/cuda-runpath-libs
cudaPackages: apply runpath setup hooks to non-executable ELF files
2024-01-09 18:13:15 -05:00
Silvan Mosberger
9be716fb75 cudaPackages.autoAddCudaCompatRunpathHook: Fix eval w/o cuda_compat 2024-01-07 23:25:41 +01:00
Daniel Fullmer
f5378ccb5d cudaPackages: apply runpath setup hooks to non-executable ELF files 2023-12-27 16:24:27 -08:00
Someone Serge
35b1e5803a
cudaPackages.cuda_nvcc: patch nvcc.profile
let nvcc know about cudart and the stub drivers; this way
we do not need to search for cudart in the setupCudaHook
2023-12-22 03:49:23 +00:00
Someone Serge
076fc3ad31 cudaPackages.autoAddCudaCompatRunpathHook: dummy libcudaPath when broken 2023-12-12 17:39:08 +01:00
Someone Serge
6256391a35 cudaPackages.autoAddCudaCompatRunpathHook: broken on non-jetsons
...to prevent the evaluation of cuda_compat
2023-12-12 17:39:08 +01:00
Yann Hamdaoui
d6c198a5d9
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.
2023-12-12 15:15:48 +01:00
Connor Baker
8e800cedaf cudaPackages: move derivations to cuda-modules & support aarch64
cudaPackages.cuda_compat: ignore missing libs provided at runtime

cudaPackages.gpus: Jetson should never build by default

cudaPackages.flags: don't build Jetson capabilities by default

cudaPackages: re-introduce filter for pre-existing CUDA redist packages in overrides

cudaPackages: only recurseIntoAttrs for the latest of each major version

cudaPackages.nvccCompatabilities: use GCC 10 through CUDA 11.5 to avoid a GLIBC incompatability

cudaPackages.cutensor: acquire libcublas through cudatoolkit prior to 11.4

cudaPackages.cuda_compat: mark as broken on aarch64-linux if not targeting Jetson

cudaPackages.cutensor_1_4: fix build

cudaPackages: adjust use of autoPatchelfIgnoreMissingDeps

cudaPackages.cuda_nvprof: remove unecessary override to add addOpenGLRunpath

cudaPackages: use getExe' to avoid patchelf warning about missing meta.mainProgram

cudaPackages: fix evaluation with Nix 2.3

cudaPackages: fix platform detection for Jetson/non-Jetson aarch64-linux

python3Packages.tensorrt: mark as broken if required packages are missing

Note: evaluating the name of the derivation will fail if tensorrt is not present,
which is why we wrap the value in `lib.optionalString`.

cudaPackages.flags.getNixSystem: add guard based on jetsonTargets

cudaPackages.cudnn: use explicit path to patchelf

cudaPackages.tensorrt: use explicit path to patchelf
2023-12-07 16:45:54 +00:00