Commit Graph

25 Commits

Author SHA1 Message Date
Connor Baker
e17ed6d750
Revert "cudaPackages: make getOutput work again" 2024-04-08 18:04:49 -04:00
Someone Serge
a2954dea37 cudaPackages: make getOutput work again 2024-04-03 08:41:20 +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
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
sternenseemann
83d131fd30 cudaPackage: don't rely on non-portable builtins
builtins.groupBy was added in Nix 2.5 (https://nixos.org/manual/nix/stable/release-notes/rl-2.5),
but Nixpkgs has to support Nix >= 2.3.

Problem introduced in 9a33f8ce5b.
2024-01-31 21:32:25 +01:00
Someone Serge
5cf0f04f95
cudaPackagesGoogle.cudnn_8_6: ensure present on all platforms
...including jetson

Previously:
❯ nix eval -f . --argstr system aarch64-linux --arg config '{ cudaCapabilities = [ "6.2" ]; cudaEnableForwardCompat = false; cudaSupport = true; allowUnfree = true; }' -L cudaPackagesGoogle.cudnn_8_6.outPath
attribute ... in selection path .... not found

Now:
❯ nix eval -f . --argstr system aarch64-linux --arg config '{ cudaCapabilities = [ "6.2" ]; cudaEnableForwardCompat = false; cudaSupport = true; allowUnfree = true; }' -L cudaPackagesGoogle.cudnn_8_6.outPath
       error: Package ‘cudnn-8.6.0.163’ in ... is not available on the requested hostPlatform:
2024-01-20 01:27:24 +00:00
Someone Serge
9a33f8ce5b
cudaPackagesGoogle.cudnn_8_6: fix eval
Now:
❯ nix eval -f . --arg config '{ allowUnfree = true; }' cudaPackagesGoogle.cudnn_8_6.outPath
"/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-cudnn-8.6.0.163"

Previously:
meta.broken = true
2024-01-20 01:08:32 +00:00
Connor Baker
c9dca80340 cudaPackages: fix multiplex builder isSupported check
Co-Authored-By: Yann Hamdaoui <yann.hamdaoui@tweag.io>
2024-01-18 15:43:06 +00:00
Connor Baker
c86b13ed6d cudaPackages: __structuredAttrs works with autoPatchelf since #272752 2024-01-16 20:46:13 +00:00
Someone
e529aea84f
Merge pull request #274319 from ConnorBaker/feat/cudaPackages-all-packages-eval
tree-wide: cudaPackages attributes should not cause default eval to fail
2024-01-11 04:32:59 +00:00
Someone
cbb51cb198
Merge pull request #280073 from SomeoneSerge/fix/cuda-pkg-config
cudaPackages: move .pc to hook-defined location
2024-01-10 20:38:05 +00:00
Connor Baker
b2f97e14ae cudaPackages: default badPlatformsConditions to empty 2024-01-10 01:15:02 +00:00
Connor Baker
5c260fa532 cudaPackages: set badPlatforms when cudaSupport is false 2024-01-10 01:15:01 +00:00
Connor Baker
5e472d9468 cudaPackages: unsupported platform should not set broken to true 2024-01-10 01:15:01 +00:00
Connor Baker
9bebd9e72d tree-wide: cudaPackages should not break default eval
cudaPackages: guard expressions against null values
2024-01-10 01:15:01 +00:00
Someone Serge
f837bf92f8
cudaPackages: move .pc to hook-defined location 2024-01-09 23:10:22 +00:00
Someone Serge
cf214375c9
cudaPackages: manifest-builder: fake url/sha256 instead of exceptions 2023-12-26 03:33:17 +00:00
Someone Serge
576c4f4af5
cudaPackages: eliminate exceptions
as they break common nixpkgs tools like lib.meta,
cf. https://github.com/NixOS/nixpkgs/issues/276795
2023-12-26 03:33:17 +00:00
Someone Serge
5d6136a53e
cudaPackages: allow FHS references by default
...harden gradually instead
2023-12-25 00:38:48 +00:00
Someone Serge
dad9c99082
cudaPackages: replace the fhs paths in pkg-config files
Cf. https://github.com/NixOS/nixpkgs/issues/224119
2023-12-24 23:56:00 +00:00
Connor Baker
85bcd8c391 cudaPackages: add missing newline to manifest builder 2023-12-13 13:35:03 +00:00
Connor Baker
f13c79788c cudaPackages: prefix libPath with lib in manifest builder 2023-12-12 20:46:53 +00: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
6179d88b7d cuda-modules: tidy generic-builder/manifest installPhase and postPatchelf 2023-12-07 20:08:41 +00: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