Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
e64f451
xgboost: properly condition ncclSupport
ConnorBaker Oct 3, 2025
d70f629
onnxruntime: properly condition ncclSupport
ConnorBaker Aug 28, 2025
494a8d9
python3Packages.torch: fix condition and usage of static NCCL
ConnorBaker Aug 29, 2025
f5deefd
config: add and document {allow,block}listedLicenses
ConnorBaker Aug 31, 2025
db1b553
blender: OptiX is under lib.licenses.nvidiaCudaRedist
ConnorBaker Aug 31, 2025
c331103
openmpi: fix CUDA paths in configureFlags
ConnorBaker Sep 7, 2025
763abd9
suitesparse: correct CUDA_PATH
ConnorBaker Sep 8, 2025
6f0ca9e
actiona: consume opencv CXX components when available
ConnorBaker Sep 9, 2025
2e0c9f6
slurm: fixup usage of NVML
ConnorBaker Sep 23, 2025
4f81b9b
_cuda.lib.licenses: init
ConnorBaker Sep 23, 2025
ba2fa45
_cuda.lib.allowUnfreeCudaPredicate: derive from _cuda.lib.licenses
ConnorBaker Sep 24, 2025
d2367f0
_cuda.lib.allowUnfreeCudaPredicate: handle license not having shortName
ConnorBaker Oct 5, 2025
e0f1a53
cudaPackages: remove module system evaluation
ConnorBaker Sep 23, 2025
5d39671
cudaPackages: remove generic-builder
ConnorBaker Sep 23, 2025
3ad342b
cudaPackages.buildRedist: init
ConnorBaker Sep 23, 2025
29ce053
cudaPackages: build redists from manifests
ConnorBaker Sep 23, 2025
ebd2e2a
cudaPackages_13: init at 13.0.2
ConnorBaker Sep 23, 2025
cd53001
cudaPackages.cudnn: 9.8.0 -> 9.13.0
ConnorBaker Sep 10, 2025
31dc7ef
cudaPackages.libcusparse_lt: 0.7.1 -> 0.8.1
ConnorBaker Sep 10, 2025
d1f4bcd
cudaPackages.libcutensor: 2.2.0 -> 2.3.1
ConnorBaker Sep 10, 2025
a094eed
cudaPackages.cublasmp: init at 0.6.0
ConnorBaker Sep 23, 2025
f3ceb79
cudaPackages.nvpl: init at 25.5
ConnorBaker Sep 23, 2025
0d87dea
cudaPackages.npp_plus: init at 0.10.0
ConnorBaker Sep 23, 2025
7d7182b
cudaPackages.cudss: init at 0.6.0
ConnorBaker Sep 23, 2025
51df369
cudaPackages.cuquantum: init at 25.09.0
ConnorBaker Sep 23, 2025
d6b2dbb
cudaPackages.cusolvermp: init at 0.7.0
ConnorBaker Sep 23, 2025
f18468f
cudaPackages.nvcomp: init at 5.0.0.6
ConnorBaker Sep 23, 2025
36a8a15
cudaPackages.libnvjpeg_2k: init at 0.9.0
ConnorBaker Sep 23, 2025
3b17f67
cudaPackages.libnvtiff: init at 0.5.1
ConnorBaker Sep 23, 2025
53f599e
cudaPackages.cutlass: init at 3.9.2
ConnorBaker Sep 23, 2025
016004a
cudaPackages.cudnn_samples: init
ConnorBaker Sep 23, 2025
48eda7f
cudaPackages.cudnn-frontend: clean up expression
ConnorBaker Oct 9, 2025
072d508
cudaPackages.tests.cmake: init
ConnorBaker Sep 23, 2025
d027f0a
cudaPackages.tests.cudnn-frontend: init
ConnorBaker Sep 23, 2025
7122833
cudaPackages.tests.onnx-tensorrt: init
ConnorBaker Sep 23, 2025
fb03f6a
cudaPackages.tests.redists-unpacked: init
ConnorBaker Sep 23, 2025
e8587db
cudaPackages.tests.redists-installed: init
ConnorBaker Sep 23, 2025
66bde7d
python3Packages.torch: correct package name cusparselt -> libcusparse_lt
ConnorBaker Sep 23, 2025
7c69a31
python3Packages.cupy: add libcusparse_lt now that it is available
ConnorBaker Sep 23, 2025
3c604b1
python3Packages.cupy: fixup shouldUsePkg to check for broken-ness
ConnorBaker Oct 3, 2025
c717006
cudaPackages.cudatoolkit: use all outputs but static from constituents
ConnorBaker Sep 7, 2025
b854a35
_cuda.lib.{_mkMetaBadPlatforms,_mkMetaBroken}: use builtins.traceVerbose
ConnorBaker Sep 7, 2025
c6015a1
python3Packages.cupy: fixup
ConnorBaker Sep 7, 2025
4d39211
python3Packages.warp-lang: correct mathdx license
ConnorBaker Sep 1, 2025
3c216c9
tests.cuda: fixup
ConnorBaker Sep 24, 2025
5b43c7a
cuda-packages.nix: re-use backendStdenv.hasJetsonCudaCapability
ConnorBaker Sep 29, 2025
d637c40
_cuda.lib.getRedistSystem: refactor for CUDA 13 support
ConnorBaker Sep 29, 2025
75d424e
cudaPackages.backendStdenv: clean up assertions for CUDA 13
ConnorBaker Sep 29, 2025
20f3fc3
cudaPackages.cuda_cudart: cuda_compat can be null or unavailable
ConnorBaker Sep 29, 2025
09ea570
cudaPackages.autoAddCudaCompatRunpath: make hook a no-op when cuda_co…
ConnorBaker Sep 29, 2025
9602bfe
cudaPackages.buildRedist: condition inclusion of autoAddCudaCompatRup…
ConnorBaker Oct 9, 2025
909949c
cudaPackages.nccl: allow building on Thor and later
ConnorBaker Sep 29, 2025
d21cad3
cudaPackages.tests.redists-{unpacked,installed}: include license meta…
ConnorBaker Sep 30, 2025
adcfdf7
cudaPackages.libcudla: only available on Xavier and Orin
ConnorBaker Oct 3, 2025
02b3f48
cudaPackages.tensorrt: properly condition inclusion of libcudla
ConnorBaker Oct 3, 2025
26ad532
colmap: only Linux is supported with CUDA
ConnorBaker Oct 9, 2025
4252ef5
doc: update CUDA section
ConnorBaker Oct 9, 2025
9c5a55e
cudaPackages: remove some packages expressions which aren't ready
ConnorBaker Oct 9, 2025
af82ffc
cudaPackages.cuda_nvcc: correct nvcc.profile patching for 13.0+
ConnorBaker Oct 9, 2025
ef442c3
cudaPackages.cuda_nvcc: provide a single output
ConnorBaker Oct 14, 2025
43c7b5e
cudaPackages.cuda_cudart: provide a single output
ConnorBaker Oct 14, 2025
2ee10f4
cudaPackages.autoAddCudaCompatRunpath: clean up enableHook
ConnorBaker Oct 14, 2025
1b88b73
cudaPackages.cuda_cudart: don't symlink lib/stubs into lib
ConnorBaker Oct 16, 2025
e3adc1f
cudaPackages.cuda_nvml_dev: don't symlink lib/stubs into lib
ConnorBaker Oct 16, 2025
3a57a46
cudaPackages.gdrcopy: init at 2.5.1
ConnorBaker Oct 16, 2025
858797b
ucc: fix linking against CUDA stubs
ConnorBaker Oct 16, 2025
1fceb96
ucx: fix linking against CUDA stubs
ConnorBaker Oct 16, 2025
c8a2294
python3Packages.gpuctypes: fix linking against CUDA stubs
ConnorBaker Oct 16, 2025
9c1181a
cudaPackages.libnvshmem: init at 3.4.5
ConnorBaker Oct 17, 2025
6abb73f
gpu-burn: tidy up after CUDA changes
ConnorBaker Oct 17, 2025
df2b636
cudaPackages.libcufile: fixup autoPatchelfHook for cuda_cudart stubs …
ConnorBaker Oct 17, 2025
0fc63e4
python3Packages.cupy: fix cuda_cudart stub linking
ConnorBaker Oct 17, 2025
c1c2dd2
python3Packages.cupy: build without libcusparse_lt for now
ConnorBaker Oct 17, 2025
12ad245
koboldcpp: remove hardcoded link against CUDA driver
ConnorBaker Oct 17, 2025
04cfbd0
cudaPackages.libcublasmp: use newly packaged libnvshmem
ConnorBaker Oct 17, 2025
4cbdd81
cudaPackages.libcudla: buildRedist expects top-level platformAssertions
ConnorBaker Oct 17, 2025
a43503a
cudaPackages.cuda_nvprof: fix cuda_cudart stub linking
ConnorBaker Oct 17, 2025
3728d48
cudaPackages.cuquantum: fix libnvidia-ml.so stub linking
ConnorBaker Oct 17, 2025
1698512
cudaPackages.nsight_systems: fix stub linking
ConnorBaker Oct 17, 2025
a42e4a5
python3Packages.tensorrt: fixup
ConnorBaker Oct 21, 2025
04512dc
cudaPackages.buildRedist: unpacking sources shouldn't depend on backe…
ConnorBaker Oct 23, 2025
68aefe6
cudaPackages.tests.redists-installed: some packages may have dependen…
ConnorBaker Oct 23, 2025
4d389fb
cudaPackages.autoAddCudaCompatRunpath: format with shfmt and lint wit…
ConnorBaker Oct 23, 2025
88ea561
cudaPackages.markForCudatoolkitRootHook: format with shfmt and lint w…
ConnorBaker Oct 23, 2025
8d50fc5
cudaPackages.setupCudaHook: format with shfmt and lint with ShellCheck
ConnorBaker Oct 23, 2025
2811ae3
cudaPackages.cuda_cccl: restrict to a single output to fix libnvshmem…
ConnorBaker Oct 23, 2025
bd217ed
_cuda.lib.selectManifests: init
ConnorBaker Oct 23, 2025
c11ffb0
pkgs/top-level/cuda-packages.nix: tidy using _cuda.lib.selectManifests
ConnorBaker Oct 23, 2025
16b3926
_cuda.db.bootstrap.cudaCapabilityToInfo: add 3.5, 3.7, and 7.2, and f…
ConnorBaker Oct 23, 2025
c388529
_cuda.db.bootstrap.nvccCompatibilities: add back 11.0-12.5
ConnorBaker Oct 23, 2025
6585059
cudaPackages: remove cudaFlags alias
ConnorBaker Oct 23, 2025
14ce577
cudaPackages: remove cudaVersion alias
ConnorBaker Oct 23, 2025
b0f246b
cudaPackages: remove cudatoolkit-legacy-runfile alias
ConnorBaker Oct 23, 2025
5dcd809
cudaPackages: remove cusparselt alias
ConnorBaker Oct 23, 2025
29d82a1
cudaPackages.tests.redists-installed: make broken assertion more desc…
ConnorBaker Oct 23, 2025
b90b6cd
cudaPackages.nsight_compute: patch shebangs in scripts
ConnorBaker Oct 23, 2025
218fe97
cudaPackages: prefer autoPatchelfIgnoreMissingDeps to extraAutoPatche…
ConnorBaker Oct 23, 2025
8af89d0
cudaPackages: allow expressions to be used with older versions of CUDA
ConnorBaker Oct 23, 2025
f71cd02
cuda-modules: update TensorRT update helper
ConnorBaker Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 39 additions & 107 deletions doc/languages-frameworks/cuda.section.md

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions doc/redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@
],
"cuda-updating-redistributables": [
"index.html#cuda-updating-redistributables",
"index.html#updating-cuda-redistributables"
],
"cuda-updating-cutensor": [
"index.html#updating-cuda-redistributables",
"index.html#updating-the-cuda-toolkit",
"index.html#cuda-updating-cutensor",
"index.html#updating-cutensor"
],
Expand All @@ -72,10 +71,6 @@
"index.html#cuda-updating-the-cuda-package-set",
"index.html#updating-the-cuda-package-set"
],
"cuda-updating-the-cuda-toolkit": [
"index.html#cuda-updating-the-cuda-toolkit",
"index.html#updating-the-cuda-toolkit"
],
"cuda-user-guide": [
"index.html#cuda-user-guide"
],
Expand Down
5 changes: 4 additions & 1 deletion pkgs/by-name/ac/actiona/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
bluez
libnotify
opencv
# NOTE: Specifically not using lib.getOutput here because it would select the out output of opencv, which changes
# semantics since make-derivation uses lib.getDev on the dependency arrays, which won't touch derivations with
# specified outputs.
(opencv.cxxdev or opencv)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a note about why do this.

NOTE: Specifically not using lib.getOutput here because it would select the out output of opencv, which changes semantics since make-derivation uses lib.getDev on the dependency arrays, which won't touch derivations with specified outputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that also raises the issue of whether the lib.getOutput family of functions should be used within dependency arrays because they will select the .out output specifically as a fallback, when likely they should just return the derivation as is if the output doesn't exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Daaaamn, I think this was simply a bad design decision/omission on my part and ideally we'd maybe change the semantics of getOutput...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, on a closer look, this should be getFirstOutput [ "cxxdev" "dev" ]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember mkDerivation tries to get the dev output of all dependency arrays, no need to do it manually

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case mkDerivation does not know which output is the dev output, an dit's not an mkDerivation or getOutput bug, it's a python ecosystem bug, where it's abusing dev/propagatedBuildInputs for the python wrapper

qt6.qtbase
qt6.qtmultimedia
qt6.qttools
Expand Down
4 changes: 1 addition & 3 deletions pkgs/by-name/bl/blender/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,7 @@ stdenv'.mkDerivation (finalAttrs: {
# They comment two licenses: GPLv2 and Blender License, but they
# say: "We've decided to cancel the BL offering for an indefinite period."
# OptiX, enabled with cudaSupport, is non-free.
license =
with lib.licenses;
[ gpl2Plus ] ++ lib.optional cudaSupport (unfree // { shortName = "NVidia OptiX EULA"; });
license = with lib.licenses; [ gpl2Plus ] ++ lib.optional cudaSupport nvidiaCudaRedist;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check that Optix is licensed as a redistributable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Come to think of it, there's an optical flow sdk expression somewhere in tree -- need to check the license on that one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you find a confirmation? Is there an { url } to // add?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


platforms = [
"aarch64-linux"
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/co/colmap/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let
]
++ lib.optionals cudaSupport [
cudatoolkit
cudaPackages.cuda_cudart.static
(lib.getOutput "static" cudaPackages.cuda_cudart)
]
++ lib.optional stdenv'.cc.isClang llvmPackages.openmp;

Expand Down Expand Up @@ -129,7 +129,7 @@ stdenv'.mkDerivation {
mainProgram = "colmap";
homepage = "https://colmap.github.io/index.html";
license = licenses.bsd3;
platforms = platforms.unix;
platforms = if cudaSupport then platforms.linux else platforms.unix;
maintainers = with maintainers; [
lebastr
usertam
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/dc/dcgm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ let
in
[
(lib.cmakeFeature "CUDA${version}_INCLUDE_DIR" "${headers}")
(lib.cmakeFeature "CUDA${version}_LIBS" "${cudaPackages.cuda_cudart.stubs}/lib/stubs/libcuda.so")
(lib.cmakeFeature "CUDA${version}_LIBS" "${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs/libcuda.so")
(lib.cmakeFeature "CUDA${version}_STATIC_LIBS" "${lib.getLib cudaPackages.cuda_cudart}/lib/libcudart.so")
(lib.cmakeFeature "CUDA${version}_STATIC_CUBLAS_LIBS" (
lib.concatStringsSep ";" [
Expand Down
10 changes: 7 additions & 3 deletions pkgs/by-name/gp/gpu-burn/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
lib,
}:
let
inherit (lib.attrsets) getBin;
inherit (lib.lists) last map optionals;
inherit (lib.trivial) boolToString;
inherit (config) cudaSupport;
Expand Down Expand Up @@ -36,7 +35,11 @@ backendStdenv.mkDerivation {
substituteInPlace gpu_burn-drv.cpp \
--replace-fail \
'#define COMPARE_KERNEL "compare.ptx"' \
"#define COMPARE_KERNEL \"$out/share/compare.ptx\""
'#define COMPARE_KERNEL "${placeholder "out"}/share/compare.ptx"'
substituteInPlace Makefile \
--replace-fail \
'${''''${CUDAPATH}/bin/nvcc''}' \
'${lib.getExe cuda_nvcc}'
'';

nativeBuildInputs = [
Expand All @@ -52,7 +55,8 @@ backendStdenv.mkDerivation {
];

makeFlags = [
"CUDAPATH=${getBin cuda_nvcc}"
# NOTE: CUDAPATH assumes cuda_cudart is a single output containing all of lib, dev, and stubs.
"CUDAPATH=${cuda_cudart}"
"COMPUTE=${last (map dropDots cudaCapabilities)}"
"IS_JETSON=${boolToString isJetsonBuild}"
];
Expand Down
8 changes: 8 additions & 0 deletions pkgs/by-name/ko/koboldcpp/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ effectiveStdenv.mkDerivation (finalAttrs: {
python3Packages.wrapPython
];

postPatch = ''
nixLog "patching $PWD/Makefile to remove explicit linking against CUDA driver"
substituteInPlace "$PWD/Makefile" \
--replace-fail \
'CUBLASLD_FLAGS = -lcuda ' \
'CUBLASLD_FLAGS = '
'';

pythonInputs = builtins.attrValues { inherit (python3Packages) tkinter customtkinter packaging; };

buildInputs = [
Expand Down
11 changes: 3 additions & 8 deletions pkgs/by-name/on/onnxruntime/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
darwinMinVersionHook,
pythonSupport ? true,
cudaSupport ? config.cudaSupport,
ncclSupport ? config.cudaSupport,
ncclSupport ? cudaSupport && cudaPackages.nccl.meta.available,
withFullProtobuf ? false,
cudaPackages ? { },
}@inputs:
Expand Down Expand Up @@ -154,12 +154,7 @@ effectiveStdenv.mkDerivation rec {
cudnn # cudnn.h
cuda_cudart
]
++ lib.optionals (cudaSupport && ncclSupport) (
with cudaPackages;
[
nccl
]
)
++ lib.optionals ncclSupport [ nccl ]
)
++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [
(darwinMinVersionHook "13.3")
Expand Down Expand Up @@ -270,7 +265,7 @@ effectiveStdenv.mkDerivation rec {
'';

passthru = {
inherit cudaSupport cudaPackages; # for the python module
inherit cudaSupport cudaPackages ncclSupport; # for the python module
inherit protobuf;
tests = lib.optionalAttrs pythonSupport {
python = python3Packages.onnxruntime;
Expand Down
5 changes: 3 additions & 2 deletions pkgs/by-name/op/openmpi/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ stdenv.mkDerivation (finalAttrs: {
# TODO: add UCX support, which is recommended to use with cuda for the most robust OpenMPI build
# https://github.com/openucx/ucx
# https://www.open-mpi.org/faq/?category=buildcuda
(lib.withFeatureAs cudaSupport "cuda" (lib.getDev cudaPackages.cuda_cudart))
(lib.withFeatureAs cudaSupport "cuda-libdir" "${cudaPackages.cuda_cudart.stubs}/lib")
# NOTE: Open MPI requires the header files specifically, which are in the `include` output.
(lib.withFeatureAs cudaSupport "cuda" (lib.getOutput "include" cudaPackages.cuda_cudart))
(lib.withFeatureAs cudaSupport "cuda-libdir" "${lib.getLib cudaPackages.cuda_cudart}/lib")
(lib.enableFeature cudaSupport "dlopen")
(lib.withFeatureAs fabricSupport "psm2" (lib.getDev libpsm2))
(lib.withFeatureAs fabricSupport "ofi" (lib.getDev libfabric))
Expand Down
6 changes: 3 additions & 3 deletions pkgs/by-name/sl/slurm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# enable internal X11 support via libssh2
enableX11 ? true,
enableNVML ? config.cudaSupport,
nvml,
cudaPackages,
}:

stdenv.mkDerivation (finalAttrs: {
Expand Down Expand Up @@ -110,8 +110,8 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals enableNVML [
(runCommand "collect-nvml" { } ''
mkdir $out
ln -s ${lib.getDev nvml}/include $out/include
ln -s ${lib.getLib nvml}/lib/stubs $out/lib
ln -s ${lib.getOutput "include" cudaPackages.cuda_nvml_dev}/include $out/include
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's also getInclude

ln -s ${lib.getOutput "stubs" cudaPackages.cuda_nvml_dev}/lib/stubs $out/lib
'')
];

Expand Down
6 changes: 4 additions & 2 deletions pkgs/by-name/uc/ucc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs@{
enableSse42 ? stdenv.hostPlatform.sse4_2Support,
}:
let
inherit (lib.attrsets) getLib;
inherit (lib.attrsets) getOutput;
inherit (lib.lists) optionals;
inherit (lib.strings) concatStringsSep;

Expand Down Expand Up @@ -88,8 +88,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
# referring to an array!
env.LDFLAGS = toString (
optionals enableCuda [
# Fake libcuda.so (the real one is deployed impurely)
"-L${getOutput "stubs" cuda_cudart}/lib/stubs"
# Fake libnvidia-ml.so (the real one is deployed impurely)
"-L${getLib cuda_nvml_dev}/lib/stubs"
"-L${getOutput "stubs" cuda_nvml_dev}/lib/stubs"
]
);

Expand Down
22 changes: 18 additions & 4 deletions pkgs/by-name/uc/ucx/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ let
};
in
stdenv.mkDerivation (finalAttrs: {
__structuredAttrs = true;
# TODO(@connorbaker):
# When strictDeps is enabled, `cuda_nvcc` is required as the argument to `--with-cuda` in `configureFlags` or else
# configurePhase fails with `checking for cuda_runtime.h... no`.
# This is odd, especially given `cuda_runtime.h` is provided by `cuda_cudart.dev`, which is already in `buildInputs`.
strictDeps = true;

pname = "ucx";
version = "1.19.0";

Expand Down Expand Up @@ -75,10 +82,17 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optionals enableRocm rocmList;

LDFLAGS = lib.optionals enableCuda [
# Fake libnvidia-ml.so (the real one is deployed impurely)
"-L${lib.getLib cudaPackages.cuda_nvml_dev}/lib/stubs"
];
# NOTE: With `__structuredAttrs` enabled, `LDFLAGS` must be set under `env` so it is assured to be a string;
# otherwise, we might have forgotten to convert it to a string and Nix would make LDFLAGS a shell variable
# referring to an array!
env.LDFLAGS = toString (
lib.optionals enableCuda [
# Fake libcuda.so (the real one is deployed impurely)
"-L${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs"
# Fake libnvidia-ml.so (the real one is deployed impurely)
"-L${lib.getOutput "stubs" cudaPackages.cuda_nvml_dev}/lib/stubs"
]
);

configureFlags = [
"--with-rdmacm=${lib.getDev rdma-core}"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/xg/xgboost/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
rPackages,
}@inputs:

assert ncclSupport -> (cudaSupport && !cudaPackages.nccl.meta.unsupported);
assert ncclSupport -> (cudaSupport && cudaPackages.nccl.meta.available);
# Disable regular tests when building the R package
# because 1) the R package runs its own tests and
# 2) the R package creates a different binary shared
Expand Down
65 changes: 37 additions & 28 deletions pkgs/development/cuda-modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,48 @@ package set by [cuda-packages.nix](../../top-level/cuda-packages.nix).

## Top-level directories

- `cuda`: CUDA redistributables! Provides extension to `cudaPackages` scope.
- `cudatoolkit`: monolithic CUDA Toolkit run-file installer. Provides extension
to `cudaPackages` scope.
- `cudnn`: NVIDIA cuDNN library.
- `cutensor`: NVIDIA cuTENSOR library.
- `fixups`: Each file or directory (excluding `default.nix`) should contain a
`callPackage`-able expression to be provided to the `overrideAttrs` attribute
of a package produced by the generic manifest builder.
These fixups are applied by `pname`, so packages with multiple versions
(e.g., `cudnn`, `cudnn_8_9`, etc.) all share a single fixup function
(i.e., `fixups/cudnn.nix`).
- `generic-builders`:
- Contains a builder `manifest.nix` which operates on the `Manifest` type
defined in `modules/generic/manifests`. Most packages are built using this
builder.
- Contains a builder `multiplex.nix` which leverages the Manifest builder. In
short, the Multiplex builder adds multiple versions of a single package to
single instance of the CUDA Packages package set. It is used primarily for
packages like `cudnn` and `cutensor`.
- `modules`: Nixpkgs modules to check the shape and content of CUDA
redistributable and feature manifests. These modules additionally use shims
provided by some CUDA packages to allow them to re-use the
`genericManifestBuilder`, even if they don't have manifest files of their
own. `cudnn` and `tensorrt` are examples of packages which provide such
shims. These modules are further described in the
[Modules](./modules/README.md) documentation.
- `_cuda`: Fixed-point used to configure, construct, and extend the CUDA package
set. This includes NVIDIA manifests.
- `buildRedist`: Contains the logic to build packages using NVIDIA's manifests.
- `packages`: Contains packages which exist in every instance of the CUDA
package set. These packages are built in a `by-name` fashion.
- `setup-hooks`: Nixpkgs setup hooks for CUDA.
- `tensorrt`: NVIDIA TensorRT library.
- `tests`: Contains tests which can be run against the CUDA package set.

Many redistributable packages are in the `packages` directory. Their presence
ensures that, even if a CUDA package set which no longer includes a given package
is being constructed, the attribute for that package will still exist (but refer
to a broken package). This prevents missing attribute errors as the package set
evolves.

## Distinguished packages

Some packages are purposefully not in the `packages` directory. These are packages
which do not make sense for Nixpkgs, require further investigation, or are otherwise
not straightforward to include. These packages are:

- `cuda`:
- `collectx_bringup`: missing `libssl.so.1.1` and `libcrypto.so.1.1`; not sure how
to provide them or what the package does.
- `cuda_sandbox_dev`: unclear on purpose.
- `driver_assistant`: we don't use the drivers from the CUDA releases; irrelevant.
- `mft_autocomplete`: unsure of purpose; contains FHS paths.
- `mft_oem`: unsure of purpose; contains FHS paths.
- `mft`: unsure of purpose; contains FHS paths.
- `nvidia_driver`: we don't use the drivers from the CUDA releases; irrelevant.
- `nvlsm`: contains FHS paths/NVSwitch and NVLINK software
- `libnvidia_nscq`: NVSwitch software
- `libnvsdm`: NVSwitch software
- `cublasmp`:
- `libcublasmp`: `nvshmem` isnt' packaged.
- `cudnn`:
- `cudnn_samples`: requires FreeImage, which is abandoned and not packaged.

> [!NOTE]
>
> When packaging redistributables, prefer `autoPatchelfIgnoreMissingDeps` to providing
> paths to stubs with `extraAutoPatchelfLibs`; the stubs are meant to be used for
> projects where linking against libraries available only at runtime is unavoidable.

### CUDA Compatibility

[CUDA Compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/),
Expand Down
Loading
Loading