cudaPackages: build redists from manifests
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
@@ -10,39 +10,40 @@ 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.
|
||||
- `cublasmp`:
|
||||
- `libcublasmp`: `nvshmem` isnt' packaged.
|
||||
- `cudnn`:
|
||||
- `cudnn_samples`: requires FreeImage, which is abandoned and not packaged.
|
||||
|
||||
### CUDA Compatibility
|
||||
|
||||
[CUDA Compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/),
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
};
|
||||
|
||||
# No changes from 12.8 to 12.9
|
||||
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#host-compiler-support-policy
|
||||
# https://docs.nvidia.com/cuda/archive/12.9.1/cuda-installation-guide-linux/index.html#host-compiler-support-policy
|
||||
"12.9" = {
|
||||
clang = {
|
||||
maxMajorVersion = "19";
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# The _cuda attribute set is a fixed-point which contains the static functionality required to construct CUDA package
|
||||
# sets. For example, `_cuda.bootstrapData` includes information about NVIDIA's redistributables (such as the names
|
||||
# NVIDIA uses for different systems), `_cuda.lib` contains utility functions like `formatCapabilities` (which generate
|
||||
# common arguments passed to NVCC and `cmakeFlags`), and `_cuda.fixups` contains `callPackage`-able functions which
|
||||
# are provided to the corresponding package's `overrideAttrs` attribute to provide package-specific fixups
|
||||
# out of scope of the generic redistributable builder.
|
||||
# NVIDIA uses for different systems), and `_cuda.lib` contains utility functions like `formatCapabilities` (which generate
|
||||
# common arguments passed to NVCC and `cmakeFlags`).
|
||||
#
|
||||
# Since this attribute set is used to construct the CUDA package sets, it must exist outside the fixed point of the
|
||||
# package sets. Make these attributes available directly in the package set construction could cause confusion if
|
||||
@@ -23,7 +21,7 @@ lib.fixedPoints.makeExtensible (final: {
|
||||
inherit lib;
|
||||
};
|
||||
extensions = [ ]; # Extensions applied to every CUDA package set.
|
||||
fixups = import ./fixups { inherit lib; };
|
||||
manifests = import ./manifests { inherit lib; };
|
||||
lib = import ./lib {
|
||||
_cuda = final;
|
||||
inherit lib;
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{ flags, lib }:
|
||||
prevAttrs: {
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvrm_gpu.so"
|
||||
"libnvrm_mem.so"
|
||||
"libnvdla_runtime.so"
|
||||
];
|
||||
# `cuda_compat` only works on aarch64-linux, and only when building for Jetson devices.
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions or { } // {
|
||||
"Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" = !flags.isJetsonBuild;
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
# TODO(@connorbaker): cuda_cudart.dev depends on crt/host_config.h, which is from
|
||||
# (getDev cuda_nvcc). It would be nice to be able to encode that.
|
||||
{ addDriverRunpath, lib }:
|
||||
prevAttrs: {
|
||||
# Remove once cuda-find-redist-features has a special case for libcuda
|
||||
outputs =
|
||||
prevAttrs.outputs or [ ]
|
||||
++ lib.lists.optionals (!(builtins.elem "stubs" prevAttrs.outputs)) [ "stubs" ];
|
||||
|
||||
allowFHSReferences = false;
|
||||
|
||||
# The libcuda stub's pkg-config doesn't follow the general pattern:
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
while IFS= read -r -d $'\0' path; do
|
||||
sed -i \
|
||||
-e "s|^libdir\s*=.*/lib\$|libdir=''${!outputLib}/lib/stubs|" \
|
||||
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
||||
"$path"
|
||||
done < <(find -iname 'cuda-*.pc' -print0)
|
||||
''
|
||||
# Namelink may not be enough, add a soname.
|
||||
# Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/25536
|
||||
+ ''
|
||||
if [[ -f lib/stubs/libcuda.so && ! -f lib/stubs/libcuda.so.1 ]]; then
|
||||
ln -s libcuda.so lib/stubs/libcuda.so.1
|
||||
fi
|
||||
'';
|
||||
|
||||
postFixup = prevAttrs.postFixup or "" + ''
|
||||
mv "''${!outputDev}/share" "''${!outputDev}/lib"
|
||||
moveToOutput lib/stubs "$stubs"
|
||||
ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
|
||||
ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
|
||||
'';
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
libglut,
|
||||
libcufft,
|
||||
libcurand,
|
||||
libGLU,
|
||||
libglvnd,
|
||||
libgbm,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
libglut
|
||||
libcufft
|
||||
libcurand
|
||||
libGLU
|
||||
libglvnd
|
||||
libgbm
|
||||
];
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
gmp,
|
||||
expat,
|
||||
libxcrypt-legacy,
|
||||
ncurses6,
|
||||
python310,
|
||||
python311,
|
||||
python312,
|
||||
stdenv,
|
||||
lib,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ [
|
||||
gmp
|
||||
libxcrypt-legacy
|
||||
ncurses6
|
||||
python310
|
||||
python311
|
||||
python312
|
||||
]
|
||||
# aarch64,sbsa needs expat
|
||||
++ lib.lists.optionals (stdenv.hostPlatform.isAarch64) [ expat ];
|
||||
|
||||
installPhase =
|
||||
prevAttrs.installPhase or ""
|
||||
# Python 3.8 is not in nixpkgs anymore, delete Python 3.8 cuda-gdb support
|
||||
# to avoid autopatchelf failing to find libpython3.8.so.
|
||||
+ ''
|
||||
find $bin -name '*python3.8*' -delete
|
||||
find $bin -name '*python3.9*' -delete
|
||||
'';
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
backendStdenv,
|
||||
setupCudaHook,
|
||||
}:
|
||||
prevAttrs: {
|
||||
# Merge "bin" and "dev" into "out" to avoid circular references
|
||||
outputs = builtins.filter (
|
||||
x:
|
||||
!(builtins.elem x [
|
||||
"dev"
|
||||
"bin"
|
||||
])
|
||||
) prevAttrs.outputs or [ ];
|
||||
|
||||
# Patch the nvcc.profile.
|
||||
# Syntax:
|
||||
# - `=` for assignment,
|
||||
# - `?=` for conditional assignment,
|
||||
# - `+=` to "prepend",
|
||||
# - `=+` to "append".
|
||||
|
||||
# Cf. https://web.archive.org/web/20230308044351/https://arcb.csc.ncsu.edu/~mueller/cluster/nvidia/2.0/nvcc_2.0.pdf
|
||||
|
||||
# We set all variables with the lowest priority (=+), but we do force
|
||||
# nvcc to use the fixed backend toolchain. Cf. comments in
|
||||
# backend-stdenv.nix
|
||||
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
substituteInPlace bin/nvcc.profile \
|
||||
--replace-fail \
|
||||
'$(TOP)/$(_TARGET_DIR_)/include' \
|
||||
"''${!outputDev}/include"
|
||||
''
|
||||
+ ''
|
||||
cat << EOF >> bin/nvcc.profile
|
||||
|
||||
# Fix a compatible backend compiler
|
||||
PATH += "${backendStdenv.cc}/bin":
|
||||
|
||||
# Expose the split-out nvvm
|
||||
LIBRARIES =+ "-L''${!outputBin}/nvvm/lib"
|
||||
INCLUDES =+ "-I''${!outputBin}/nvvm/include"
|
||||
EOF
|
||||
'';
|
||||
|
||||
# Entries here will be in nativeBuildInputs when cuda_nvcc is in nativeBuildInputs.
|
||||
propagatedBuildInputs = prevAttrs.propagatedBuildInputs or [ ] ++ [ setupCudaHook ];
|
||||
|
||||
postInstall = prevAttrs.postInstall or "" + ''
|
||||
moveToOutput "nvvm" "''${!outputBin}"
|
||||
'';
|
||||
|
||||
# The nvcc and cicc binaries contain hard-coded references to /usr
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
mainProgram = "nvcc";
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ cuda_cupti }: prevAttrs: { buildInputs = prevAttrs.buildInputs or [ ] ++ [ cuda_cupti ]; }
|
||||
@@ -1 +0,0 @@
|
||||
_: _: { outputs = [ "out" ]; }
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
cudaOlder,
|
||||
cudaMajorMinorVersion,
|
||||
fetchurl,
|
||||
lib,
|
||||
libcublas,
|
||||
patchelf,
|
||||
zlib,
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
attrsets
|
||||
maintainers
|
||||
meta
|
||||
strings
|
||||
;
|
||||
in
|
||||
finalAttrs: prevAttrs: {
|
||||
src = fetchurl { inherit (finalAttrs.passthru.redistribRelease) hash url; };
|
||||
|
||||
# Useful for inspecting why something went wrong.
|
||||
badPlatformsConditions =
|
||||
let
|
||||
cudaTooOld = cudaOlder finalAttrs.passthru.featureRelease.minCudaVersion;
|
||||
cudaTooNew =
|
||||
(finalAttrs.passthru.featureRelease.maxCudaVersion != null)
|
||||
&& strings.versionOlder finalAttrs.passthru.featureRelease.maxCudaVersion cudaMajorMinorVersion;
|
||||
in
|
||||
prevAttrs.badPlatformsConditions or { }
|
||||
// {
|
||||
"CUDA version is too old" = cudaTooOld;
|
||||
"CUDA version is too new" = cudaTooNew;
|
||||
};
|
||||
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
zlib
|
||||
(attrsets.getLib libcublas)
|
||||
];
|
||||
|
||||
# Tell autoPatchelf about runtime dependencies. *_infer* libraries only
|
||||
# exist in CuDNN 8.
|
||||
# NOTE: Versions from CUDNN releases have four components.
|
||||
postFixup =
|
||||
prevAttrs.postFixup or ""
|
||||
+
|
||||
strings.optionalString
|
||||
(
|
||||
strings.versionAtLeast finalAttrs.version "8.0.5.0"
|
||||
&& strings.versionOlder finalAttrs.version "9.0.0.0"
|
||||
)
|
||||
''
|
||||
${meta.getExe patchelf} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
||||
${meta.getExe patchelf} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
|
||||
'';
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
homepage = "https://developer.nvidia.com/cudnn";
|
||||
maintainers =
|
||||
prevAttrs.meta.maintainers or [ ]
|
||||
++ (with maintainers; [
|
||||
mdaiter
|
||||
samuela
|
||||
connorbaker
|
||||
]);
|
||||
# TODO(@connorbaker): Temporary workaround to avoid changing the derivation hash since introducing more
|
||||
# brokenConditions would change the derivation as they're top-level and __structuredAttrs is set.
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
license = {
|
||||
shortName = "cuDNN EULA";
|
||||
fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
|
||||
url = "https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html#supplement";
|
||||
free = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{ lib }:
|
||||
lib.concatMapAttrs (
|
||||
fileName: _type:
|
||||
let
|
||||
# Fixup is in `./${attrName}.nix` or in `./${fileName}/default.nix`:
|
||||
attrName = lib.removeSuffix ".nix" fileName;
|
||||
fixup = import (./. + "/${fileName}");
|
||||
isFixup = fileName != "default.nix";
|
||||
in
|
||||
lib.optionalAttrs isFixup { ${attrName} = fixup; }
|
||||
) (builtins.readDir ./.)
|
||||
@@ -1,5 +0,0 @@
|
||||
_: prevAttrs: {
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions or { } // {
|
||||
"Package is not supported; use drivers from linuxPackages" = true;
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ zlib }: prevAttrs: { buildInputs = prevAttrs.buildInputs or [ ] ++ [ zlib ]; }
|
||||
@@ -1 +0,0 @@
|
||||
{ zlib }: prevAttrs: { buildInputs = prevAttrs.buildInputs or [ ] ++ [ zlib ]; }
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
libcublas,
|
||||
numactl,
|
||||
rdma-core,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
libcublas
|
||||
numactl
|
||||
rdma-core
|
||||
];
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
libcublas,
|
||||
libcusparse ? null,
|
||||
libnvjitlink ? null,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
libcublas
|
||||
libnvjitlink
|
||||
libcusparse
|
||||
];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions or { } // {
|
||||
"libnvjitlink missing (CUDA >= 12.0)" = libnvjitlink == null;
|
||||
"libcusparse missing (CUDA >= 12.1)" = libcusparse == null;
|
||||
};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
libnvjitlink ? null,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [ libnvjitlink ];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions or { } // {
|
||||
"libnvjitlink missing (CUDA >= 12.0)" = libnvjitlink == null;
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
cuda_cudart,
|
||||
lib,
|
||||
libcublas,
|
||||
}:
|
||||
finalAttrs: prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ [ (lib.getLib libcublas) ]
|
||||
# For some reason, the 1.4.x release of cusparselt requires the cudart library.
|
||||
++ lib.optionals (lib.hasPrefix "1.4" finalAttrs.version) [ (lib.getLib cuda_cudart) ];
|
||||
meta = prevAttrs.meta or { } // {
|
||||
description = "cuSPARSELt: A High-Performance CUDA Library for Sparse Matrix-Matrix Multiplication";
|
||||
homepage = "https://developer.nvidia.com/cusparselt-downloads";
|
||||
maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.sepiabrown ];
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
license = lib.licenses.unfreeRedistributable // {
|
||||
shortName = "cuSPARSELt EULA";
|
||||
fullName = "cuSPARSELt SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
|
||||
url = "https://docs.nvidia.com/cuda/cusparselt/license.html";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
cuda_cudart,
|
||||
lib,
|
||||
libcublas,
|
||||
}:
|
||||
finalAttrs: prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ [ (lib.getLib libcublas) ]
|
||||
# For some reason, the 1.4.x release of cuTENSOR requires the cudart library.
|
||||
++ lib.optionals (lib.hasPrefix "1.4" finalAttrs.version) [ (lib.getLib cuda_cudart) ];
|
||||
meta = prevAttrs.meta or { } // {
|
||||
description = "cuTENSOR: A High-Performance CUDA Library For Tensor Primitives";
|
||||
homepage = "https://developer.nvidia.com/cutensor";
|
||||
maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.obsidian-systems-maintenance ];
|
||||
teams = prevAttrs.meta.teams;
|
||||
license = lib.licenses.unfreeRedistributable // {
|
||||
shortName = "cuTENSOR EULA";
|
||||
fullName = "cuTENSOR SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
|
||||
url = "https://docs.nvidia.com/cuda/cutensor/license.html";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
cudaMajorMinorVersion,
|
||||
cudaOlder,
|
||||
e2fsprogs,
|
||||
elfutils,
|
||||
flags,
|
||||
gst_all_1,
|
||||
lib,
|
||||
libjpeg8,
|
||||
qt6,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
ucx,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
qtwayland = lib.getLib qt6.qtwayland;
|
||||
inherit (qt6) wrapQtAppsHook qtwebview;
|
||||
archDir =
|
||||
{
|
||||
aarch64-linux = "linux-" + (if flags.isJetsonBuild then "v4l_l4t" else "desktop") + "-t210-a64";
|
||||
x86_64-linux = "linux-desktop-glibc_2_11_3-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
in
|
||||
{
|
||||
outputs = [ "out" ]; # NOTE(@connorbaker): Force a single output so relative lookups work.
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ wrapQtAppsHook ];
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ [
|
||||
qtwayland
|
||||
qtwebview
|
||||
qt6.qtwebengine
|
||||
rdma-core
|
||||
]
|
||||
++ lib.optionals (cudaOlder "12.7") [
|
||||
e2fsprogs
|
||||
ucx
|
||||
]
|
||||
++ lib.optionals (cudaMajorMinorVersion == "12.9") [
|
||||
elfutils
|
||||
];
|
||||
dontWrapQtApps = true;
|
||||
preInstall = prevAttrs.preInstall or "" + ''
|
||||
if [[ -d nsight-compute ]]; then
|
||||
nixLog "Lifting components of Nsight Compute to the top level"
|
||||
mv -v nsight-compute/*/* .
|
||||
nixLog "Removing empty directories"
|
||||
rmdir -pv nsight-compute/*
|
||||
fi
|
||||
|
||||
rm -rf host/${archDir}/Mesa/
|
||||
'';
|
||||
postInstall =
|
||||
prevAttrs.postInstall or ""
|
||||
+ ''
|
||||
moveToOutput 'ncu' "''${!outputBin}/bin"
|
||||
moveToOutput 'ncu-ui' "''${!outputBin}/bin"
|
||||
moveToOutput 'host/${archDir}' "''${!outputBin}/bin"
|
||||
moveToOutput 'target/${archDir}' "''${!outputBin}/bin"
|
||||
wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin"
|
||||
''
|
||||
# NOTE(@connorbaker): No idea what this platform is or how to patchelf for it.
|
||||
+ lib.optionalString (flags.isJetsonBuild && cudaOlder "12.9") ''
|
||||
nixLog "Removing QNX 700 target directory for Jetson builds"
|
||||
rm -rfv "''${!outputBin}/target/qnx-700-t210-a64"
|
||||
''
|
||||
+ lib.optionalString (flags.isJetsonBuild && cudaAtLeast "12.8") ''
|
||||
nixLog "Removing QNX 800 target directory for Jetson builds"
|
||||
rm -rfv "''${!outputBin}/target/qnx-800-tegra-a64"
|
||||
'';
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
preFixup = prevAttrs.preFixup or "" + ''
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so"
|
||||
'';
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
# NOTE(@connorbaker): It might be a problem that when nsight_compute contains hosts and targets of different
|
||||
# architectures, that we patchelf just the binaries matching the builder's platform; autoPatchelfHook prints
|
||||
# messages like
|
||||
# skipping [$out]/host/linux-desktop-glibc_2_11_3-x64/libQt6Core.so.6 because its architecture (x64) differs from
|
||||
# target (AArch64)
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
{
|
||||
boost178,
|
||||
cuda_cudart,
|
||||
cudaAtLeast,
|
||||
e2fsprogs,
|
||||
gst_all_1,
|
||||
lib,
|
||||
nss,
|
||||
numactl,
|
||||
pulseaudio,
|
||||
qt6,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
ucx,
|
||||
wayland,
|
||||
xorg,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
qtwayland = lib.getLib qt6.qtwayland;
|
||||
qtWaylandPlugins = "${qtwayland}/${qt6.qtbase.qtPluginPrefix}";
|
||||
# NOTE(@connorbaker): nsight_systems doesn't support Jetson, so no need for case splitting on aarch64-linux.
|
||||
hostDir =
|
||||
{
|
||||
aarch64-linux = "host-linux-armv8";
|
||||
x86_64-linux = "host-linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
targetDir =
|
||||
{
|
||||
aarch64-linux = "target-linux-sbsa-armv8";
|
||||
x86_64-linux = "target-linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
in
|
||||
{
|
||||
outputs = [ "out" ]; # NOTE(@connorbaker): Force a single output so relative lookups work.
|
||||
|
||||
# An ad hoc replacement for
|
||||
# https://github.com/ConnorBaker/cuda-redist-find-features/issues/11
|
||||
env = prevAttrs.env or { } // {
|
||||
rmPatterns =
|
||||
prevAttrs.env.rmPatterns or ""
|
||||
+ toString [
|
||||
"${hostDir}/lib{arrow,jpeg}*"
|
||||
"${hostDir}/lib{ssl,ssh,crypto}*"
|
||||
"${hostDir}/libboost*"
|
||||
"${hostDir}/libexec"
|
||||
"${hostDir}/libstdc*"
|
||||
"${hostDir}/python/bin/python"
|
||||
"${hostDir}/Mesa"
|
||||
];
|
||||
};
|
||||
|
||||
# NOTE(@connorbaker): nsight-exporter and nsight-sys are deprecated scripts wrapping nsys, it's fine to remove them.
|
||||
prePatch = prevAttrs.prePatch or "" + ''
|
||||
if [[ -d bin ]]; then
|
||||
nixLog "Removing bin wrapper scripts"
|
||||
for knownWrapper in bin/{nsys{,-ui},nsight-{exporter,sys}}; do
|
||||
[[ -e $knownWrapper ]] && rm -v "$knownWrapper"
|
||||
done
|
||||
unset -v knownWrapper
|
||||
|
||||
nixLog "Removing empty bin directory"
|
||||
rmdir -v bin
|
||||
fi
|
||||
|
||||
if [[ -d nsight-systems ]]; then
|
||||
nixLog "Lifting components of Nsight System to the top level"
|
||||
mv -v nsight-systems/*/* .
|
||||
nixLog "Removing empty nsight-systems directory"
|
||||
rmdir -pv nsight-systems/*
|
||||
fi
|
||||
'';
|
||||
|
||||
postPatch = prevAttrs.postPatch or "" + ''
|
||||
for path in $rmPatterns; do
|
||||
rm -r "$path"
|
||||
done
|
||||
patchShebangs nsight-systems
|
||||
'';
|
||||
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ qt6.wrapQtAppsHook ];
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ [
|
||||
qt6.qtdeclarative
|
||||
qt6.qtsvg
|
||||
qt6.qtimageformats
|
||||
qt6.qtpositioning
|
||||
qt6.qtscxml
|
||||
qt6.qttools
|
||||
qt6.qtwebengine
|
||||
qt6.qtwayland
|
||||
boost178
|
||||
cuda_cudart.stubs
|
||||
e2fsprogs
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gstreamer
|
||||
nss
|
||||
numactl
|
||||
pulseaudio
|
||||
qt6.qtbase
|
||||
qtWaylandPlugins
|
||||
rdma-core
|
||||
ucx
|
||||
wayland
|
||||
xorg.libXcursor
|
||||
xorg.libXdamage
|
||||
xorg.libXrandr
|
||||
xorg.libXtst
|
||||
]
|
||||
# NOTE(@connorbaker): Seems to be required only for aarch64-linux.
|
||||
++ lib.optionals stdenv.hostPlatform.isAarch64 [
|
||||
gst_all_1.gst-plugins-bad
|
||||
];
|
||||
|
||||
postInstall = prevAttrs.postInstall or "" + ''
|
||||
moveToOutput '${hostDir}' "''${!outputBin}"
|
||||
moveToOutput '${targetDir}' "''${!outputBin}"
|
||||
moveToOutput 'bin' "''${!outputBin}"
|
||||
wrapQtApp "''${!outputBin}/${hostDir}/nsys-ui.bin"
|
||||
'';
|
||||
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
preFixup = prevAttrs.preFixup or "" + ''
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/${hostDir}/Plugins/imageformats/libqtiff.so"
|
||||
'';
|
||||
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
_: prevAttrs: {
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions or { } // {
|
||||
"Package is not supported; use drivers from linuxPackages" = true;
|
||||
};
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
{
|
||||
_cuda,
|
||||
cudaOlder,
|
||||
cudaPackages,
|
||||
cudaMajorMinorVersion,
|
||||
lib,
|
||||
patchelf,
|
||||
requireFile,
|
||||
stdenv,
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
attrsets
|
||||
maintainers
|
||||
meta
|
||||
strings
|
||||
versions
|
||||
;
|
||||
inherit (stdenv) hostPlatform;
|
||||
# targetArch :: String
|
||||
targetArch = attrsets.attrByPath [ hostPlatform.system ] "unsupported" {
|
||||
x86_64-linux = "x86_64-linux-gnu";
|
||||
aarch64-linux = "aarch64-linux-gnu";
|
||||
};
|
||||
in
|
||||
finalAttrs: prevAttrs: {
|
||||
# Useful for inspecting why something went wrong.
|
||||
brokenConditions =
|
||||
let
|
||||
cudaTooOld = cudaOlder finalAttrs.passthru.featureRelease.minCudaVersion;
|
||||
cudaTooNew =
|
||||
(finalAttrs.passthru.featureRelease.maxCudaVersion != null)
|
||||
&& strings.versionOlder finalAttrs.passthru.featureRelease.maxCudaVersion cudaMajorMinorVersion;
|
||||
cudnnVersionIsSpecified = finalAttrs.passthru.featureRelease.cudnnVersion != null;
|
||||
cudnnVersionSpecified = versions.majorMinor finalAttrs.passthru.featureRelease.cudnnVersion;
|
||||
cudnnVersionProvided = versions.majorMinor finalAttrs.passthru.cudnn.version;
|
||||
cudnnTooOld =
|
||||
cudnnVersionIsSpecified && (strings.versionOlder cudnnVersionProvided cudnnVersionSpecified);
|
||||
cudnnTooNew =
|
||||
cudnnVersionIsSpecified && (strings.versionOlder cudnnVersionSpecified cudnnVersionProvided);
|
||||
in
|
||||
prevAttrs.brokenConditions or { }
|
||||
// {
|
||||
"CUDA version is too old" = cudaTooOld;
|
||||
"CUDA version is too new" = cudaTooNew;
|
||||
"CUDNN version is too old" = cudnnTooOld;
|
||||
"CUDNN version is too new" = cudnnTooNew;
|
||||
};
|
||||
|
||||
src = requireFile {
|
||||
name = finalAttrs.passthru.redistribRelease.filename;
|
||||
inherit (finalAttrs.passthru.redistribRelease) hash;
|
||||
message = ''
|
||||
To use the TensorRT derivation, you must join the NVIDIA Developer Program and
|
||||
download the ${finalAttrs.version} TAR package for CUDA ${cudaMajorMinorVersion} from
|
||||
${finalAttrs.meta.homepage}.
|
||||
|
||||
Once you have downloaded the file, add it to the store with the following
|
||||
command, and try building this derivation again.
|
||||
|
||||
$ nix-store --add-fixed sha256 ${finalAttrs.passthru.redistribRelease.filename}
|
||||
'';
|
||||
};
|
||||
|
||||
# We need to look inside the extracted output to get the files we need.
|
||||
sourceRoot = "TensorRT-${finalAttrs.version}";
|
||||
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [ (finalAttrs.passthru.cudnn.lib or null) ];
|
||||
|
||||
preInstall =
|
||||
prevAttrs.preInstall or ""
|
||||
+ strings.optionalString (targetArch != "unsupported") ''
|
||||
# Replace symlinks to bin and lib with the actual directories from targets.
|
||||
for dir in bin lib; do
|
||||
rm "$dir"
|
||||
mv "targets/${targetArch}/$dir" "$dir"
|
||||
done
|
||||
|
||||
# Remove broken symlinks
|
||||
for dir in include samples; do
|
||||
rm "targets/${targetArch}/$dir" || :
|
||||
done
|
||||
'';
|
||||
|
||||
# Tell autoPatchelf about runtime dependencies.
|
||||
postFixup =
|
||||
let
|
||||
versionTriple = "${versions.majorMinor finalAttrs.version}.${versions.patch finalAttrs.version}";
|
||||
in
|
||||
prevAttrs.postFixup or ""
|
||||
+ ''
|
||||
${meta.getExe' patchelf "patchelf"} --add-needed libnvinfer.so \
|
||||
"$lib/lib/libnvinfer.so.${versionTriple}" \
|
||||
"$lib/lib/libnvinfer_plugin.so.${versionTriple}" \
|
||||
"$lib/lib/libnvinfer_builder_resource.so.${versionTriple}"
|
||||
'';
|
||||
|
||||
passthru = prevAttrs.passthru or { } // {
|
||||
# The CUDNN used with TensorRT.
|
||||
# If null, the default cudnn derivation will be used.
|
||||
# If a version is specified, the cudnn derivation with that version will be used,
|
||||
# unless it is not available, in which case the default cudnn derivation will be used.
|
||||
cudnn =
|
||||
let
|
||||
desiredName = _cuda.lib.mkVersionedName "cudnn" (
|
||||
lib.versions.majorMinor finalAttrs.passthru.featureRelease.cudnnVersion
|
||||
);
|
||||
in
|
||||
if finalAttrs.passthru.featureRelease.cudnnVersion == null || (cudaPackages ? desiredName) then
|
||||
cudaPackages.cudnn
|
||||
else
|
||||
cudaPackages.${desiredName};
|
||||
};
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
badPlatforms =
|
||||
prevAttrs.meta.badPlatforms or [ ]
|
||||
++ lib.optionals (targetArch == "unsupported") [ hostPlatform.system ];
|
||||
homepage = "https://developer.nvidia.com/tensorrt";
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
|
||||
# Building TensorRT on Hydra is impossible because of the non-redistributable
|
||||
# license and because the source needs to be manually downloaded from the
|
||||
# NVIDIA Developer Program (see requireFile above).
|
||||
hydraPlatforms = lib.platforms.none;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# cuda
|
||||
|
||||
Link: <https://developer.download.nvidia.com/compute/cuda/redist/>
|
||||
|
||||
Requirements: <https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-toolkit-major-component-versions>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
# cudnn
|
||||
|
||||
Link: <https://developer.download.nvidia.com/compute/cudnn/redist/>
|
||||
|
||||
Requirements: <https://docs.nvidia.com/deeplearning/cudnn/backend/v9.8.0/reference/support-matrix.html#gpu-cuda-toolkit-and-cuda-driver-requirements>
|
||||
|
||||
8.9.7 is the latest release from the 8.x series and supports everything but Jetson.
|
||||
8.9.5 is the latest release from the 8.x series that supports Jetson.
|
||||
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"release_date": "2024-03-15",
|
||||
"release_label": "8.9.5",
|
||||
"release_product": "cudnn",
|
||||
"cudnn": {
|
||||
"name": "NVIDIA CUDA Deep Neural Network library",
|
||||
"license": "cudnn",
|
||||
"license_path": "cudnn/LICENSE.txt",
|
||||
"version": "8.9.5.30",
|
||||
"cuda_variant": [
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"linux-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.5.30_cuda11-archive.tar.xz",
|
||||
"sha256": "bbe10e3c08cd7e4aea1012213781e4fe270e1c908263444f567cafefb2cc6525",
|
||||
"md5": "300aaaa05ca6d12b3ac058fd0bd70c6b",
|
||||
"size": "857471712"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "2a2eb89a2ab51071151c6082f1e816c702167a711a9372f9f73a7b5c4b06e01a",
|
||||
"md5": "afb13f2d7377f4a16b54a6acc373bbd9",
|
||||
"size": "861488496"
|
||||
}
|
||||
},
|
||||
"linux-ppc64le": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-ppc64le/cudnn-linux-ppc64le-8.9.5.30_cuda11-archive.tar.xz",
|
||||
"sha256": "d678f8b2903b95de7eeaef38890c5674705864ea049b2b63e90565f2c0ea682f",
|
||||
"md5": "daed75ed0c9f4dcc5b9521d2a833be3d",
|
||||
"size": "860245008"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-ppc64le/cudnn-linux-ppc64le-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "38388ec3c99c6646aaf5c707985cd35e25c67f653d780c4081c2df5557ab665f",
|
||||
"md5": "8893605a415202937ad9f2587e7a16ce",
|
||||
"size": "862346664"
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.5.30_cuda11-archive.tar.xz",
|
||||
"sha256": "50e3d38cb70a53bb059da0aefc60e1460729c6988e2697200c43b80d218e556c",
|
||||
"md5": "3479f3fdbda83cd6df104851dc1f940a",
|
||||
"size": "857816268"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "107d3dbec6345e1a3879a151cf3cbf6a2d96162c7b8eeb2ff85b84a67e79e2d1",
|
||||
"md5": "90715ef0e48f6f153587ee59df7c1a87",
|
||||
"size": "859978180"
|
||||
}
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.5.30_cuda11-archive.zip",
|
||||
"sha256": "e42aaa92203cc101a1619656ae50852a0d818a06ca99684c5f51ba95bd7a7cf9",
|
||||
"md5": "d2f4fbc710da61253570306ed2e63ac4",
|
||||
"size": "701179425"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.5.30_cuda12-archive.zip",
|
||||
"sha256": "be76d407ce0e609f94688aa45bfd5648fd21a4d9f84a588fad10aa4802ca1301",
|
||||
"md5": "54146d8da6df9da3ef125171da959dcf",
|
||||
"size": "705347747"
|
||||
}
|
||||
},
|
||||
"linux-aarch64": {
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-aarch64/cudnn-linux-aarch64-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "0491f7b02f55c22077eb678bf314c1f917524bd507cf5b658239bf98a47233a1",
|
||||
"md5": "fffd4a177c3e2ebaaceb83131d69e4e3",
|
||||
"size": "891432124"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cudnn_samples": {
|
||||
"name": "NVIDIA cuDNN samples",
|
||||
"license": "cudnn",
|
||||
"license_path": "cudnn_samples/LICENSE.txt",
|
||||
"version": "8.9.5.30",
|
||||
"cuda_variant": [
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"linux-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn_samples/linux-x86_64/cudnn_samples-linux-x86_64-8.9.5.30_cuda11-archive.tar.xz",
|
||||
"sha256": "9c0d951788461f6e9e000209cf4b100839effd1fd300371dfa6929552c8b1d4e",
|
||||
"md5": "dcbdaaa0171aa6b8331fcd6218558953",
|
||||
"size": "1665468"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-x86_64/cudnn_samples-linux-x86_64-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "441d262d82888c6ca5a02c8ad0f07c3a876be7b473bc2ec2638d86ea2e80a884",
|
||||
"md5": "a2ca6bf77b610024aff5c1a7ee53ea01",
|
||||
"size": "1664272"
|
||||
}
|
||||
},
|
||||
"linux-ppc64le": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn_samples/linux-ppc64le/cudnn_samples-linux-ppc64le-8.9.5.30_cuda11-archive.tar.xz",
|
||||
"sha256": "ded84be373031ff843c0b7118e9fdb48b06ec763eae3c76cb9c57e121b47c228",
|
||||
"md5": "d4d76362cf7ba0a0711088c38a3e17a7",
|
||||
"size": "1666372"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-ppc64le/cudnn_samples-linux-ppc64le-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "275d6a6671c210d4c4a92240de24cba0c5ca17e9007f91656b18bbff81621f81",
|
||||
"md5": "b13c3befd24473ad536ef6ea3f4dc939",
|
||||
"size": "1666788"
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn_samples/linux-sbsa/cudnn_samples-linux-sbsa-8.9.5.30_cuda11-archive.tar.xz",
|
||||
"sha256": "fa2150dff6f574fb2927bfd2d10b5c2e2e90603f59d3d3371eaa41f2e9528c74",
|
||||
"md5": "80783b38089b6573943959e873693f0a",
|
||||
"size": "1665660"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-sbsa/cudnn_samples-linux-sbsa-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "af98dec9cf613cb7f67e27f5a5da24fc183996fc25a875aa0a7dc2914c986fe3",
|
||||
"md5": "5f5b67f5d2862190ae9440ca7041b7a5",
|
||||
"size": "1668336"
|
||||
}
|
||||
},
|
||||
"linux-aarch64": {
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-aarch64/cudnn_samples-linux-aarch64-8.9.5.30_cuda12-archive.tar.xz",
|
||||
"sha256": "044c0d4436e1ecff6785a8bacf45cf2b5d504eb1c04bb9617aed86bfea77e45f",
|
||||
"md5": "ad2c201cf63561b5f0ddf505706eed97",
|
||||
"size": "1663868"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"release_date": "2024-03-15",
|
||||
"release_label": "8.9.7",
|
||||
"release_product": "cudnn",
|
||||
"cudnn": {
|
||||
"name": "NVIDIA CUDA Deep Neural Network library",
|
||||
"license": "cudnn",
|
||||
"license_path": "cudnn/LICENSE.txt",
|
||||
"version": "8.9.7.29",
|
||||
"cuda_variant": [
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"linux-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.7.29_cuda11-archive.tar.xz",
|
||||
"sha256": "a3e2509028cecda0117ce5a0f42106346e82e86d390f4bb9475afc976c77402e",
|
||||
"md5": "9ee28df53dc5f83d97f5406f880d3953",
|
||||
"size": "860967256"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz",
|
||||
"sha256": "475333625c7e42a7af3ca0b2f7506a106e30c93b1aa0081cd9c13efb6e21e3bb",
|
||||
"md5": "046e32d5ab0fdc56878e9b33f3a6883d",
|
||||
"size": "864984964"
|
||||
}
|
||||
},
|
||||
"linux-ppc64le": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-ppc64le/cudnn-linux-ppc64le-8.9.7.29_cuda11-archive.tar.xz",
|
||||
"sha256": "f23fd7d59f9d4f743fa926f317dab0d37f6ea21edb2726ceb607bea45b0f9f36",
|
||||
"md5": "44d8f80a90b6ba44379727a49a75b1fc",
|
||||
"size": "863759764"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-ppc64le/cudnn-linux-ppc64le-8.9.7.29_cuda12-archive.tar.xz",
|
||||
"sha256": "8574d291b299f9cc0134304473c9933bd098cc717e8d0876f4aba9f9eebe1b76",
|
||||
"md5": "7acbeb71d48373ea343c13028172c783",
|
||||
"size": "865846096"
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.7.29_cuda11-archive.tar.xz",
|
||||
"sha256": "91c37cfb458f541419e98510f13aaf5975c0232c613e18b776385490074eea17",
|
||||
"md5": "b4ae46fb80f2f8ef283d038585bbb122",
|
||||
"size": "861355724"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.7.29_cuda12-archive.tar.xz",
|
||||
"sha256": "e98b7c80010785e5d5ca01ee4ce9b5b0c8c73587ea6f8648be34d3f8d1d47bd1",
|
||||
"md5": "52a436f378d20b8e1e1a8a173a8bdeda",
|
||||
"size": "863497272"
|
||||
}
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.7.29_cuda11-archive.zip",
|
||||
"sha256": "5e45478efe71a96329e6c0d2a3a2f79c747c15b2a51fead4b84c89b02cbf1671",
|
||||
"md5": "7dddb764c0a608ac23e72761be4c92c0",
|
||||
"size": "704240064"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip",
|
||||
"sha256": "94fc17af8e83a26cc5d231ed23981b28c29c3fc2e87b1844ea3f46486f481df5",
|
||||
"md5": "30f8a180be36451511306f7837270214",
|
||||
"size": "708408517"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cudnn_samples": {
|
||||
"name": "NVIDIA cuDNN samples",
|
||||
"license": "cudnn",
|
||||
"license_path": "cudnn_samples/LICENSE.txt",
|
||||
"version": "8.9.7.29",
|
||||
"cuda_variant": [
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"linux-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn_samples/linux-x86_64/cudnn_samples-linux-x86_64-8.9.7.29_cuda11-archive.tar.xz",
|
||||
"sha256": "8b17f56e9d654d9af3d7711645811fb6f240f53bc2d62c00c063a6d452d80091",
|
||||
"md5": "b5410e97c73ea206b3d8939ce6ff8832",
|
||||
"size": "1664448"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-x86_64/cudnn_samples-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz",
|
||||
"sha256": "d3a9a4f3f74b04c393bb9152fe3a53ac1514da679ca57858d69f64243debb905",
|
||||
"md5": "348306c65eb4c865fba72332fa7a5f33",
|
||||
"size": "1665932"
|
||||
}
|
||||
},
|
||||
"linux-ppc64le": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn_samples/linux-ppc64le/cudnn_samples-linux-ppc64le-8.9.7.29_cuda11-archive.tar.xz",
|
||||
"sha256": "29a18538f13a63ee54cd795c78f64a1ca45df2de0b140cf095281a16d1d4d4e3",
|
||||
"md5": "9f398a26a5c7913faf58e8ee3bd9c6ff",
|
||||
"size": "1665244"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-ppc64le/cudnn_samples-linux-ppc64le-8.9.7.29_cuda12-archive.tar.xz",
|
||||
"sha256": "80664b7a6abed08633e0dc238f47f26aaaa0add5571bf6f4f4e475686a702c8d",
|
||||
"md5": "6aa5e8e801b5f730a103aaf52c66485e",
|
||||
"size": "1668400"
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn_samples/linux-sbsa/cudnn_samples-linux-sbsa-8.9.7.29_cuda11-archive.tar.xz",
|
||||
"sha256": "dd7b618f4af89fff9cdad9cd87dbc4380c7f6120460c174bd10fef6342099915",
|
||||
"md5": "841a6dde4037a39f7ddd0fb92f245c9d",
|
||||
"size": "1666176"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn_samples/linux-sbsa/cudnn_samples-linux-sbsa-8.9.7.29_cuda12-archive.tar.xz",
|
||||
"sha256": "4d84211d62e636ad3728674e55e9ce91e29c78d071fcb78453f8a71902758836",
|
||||
"md5": "0e80992ee19918efd714199f41cbe24b",
|
||||
"size": "1664288"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"release_date": "2025-03-04",
|
||||
"release_label": "9.8.0",
|
||||
"release_product": "cudnn",
|
||||
"cudnn": {
|
||||
"name": "NVIDIA CUDA Deep Neural Network library",
|
||||
"license": "cudnn",
|
||||
"license_path": "cudnn/LICENSE.txt",
|
||||
"version": "9.8.0.87",
|
||||
"linux-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-9.8.0.87_cuda11-archive.tar.xz",
|
||||
"sha256": "cf4dfaef8311d987d640a322f668cd5240ac3e5302abe9617dd991b5b2532758",
|
||||
"md5": "f8cc1eb607dd83dbaa12f9ba80934cbb",
|
||||
"size": "561520128"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-9.8.0.87_cuda12-archive.tar.xz",
|
||||
"sha256": "321b9b33bb1287404d93d5672d352f16feabc4b220ac6ae0b86e4b27f257dcf4",
|
||||
"md5": "3674444654eb59b6f4c919103a8531af",
|
||||
"size": "923946888"
|
||||
}
|
||||
},
|
||||
"cuda_variant": [
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"linux-sbsa": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-9.8.0.87_cuda11-archive.tar.xz",
|
||||
"sha256": "8ff117715fb3323032d1b489880117556ad8b5e57a9060143f0cb72384db7710",
|
||||
"md5": "b38a6fba3c53ded236b5596d405c7ef6",
|
||||
"size": "560558204"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-9.8.0.87_cuda12-archive.tar.xz",
|
||||
"sha256": "22f62f474f0cbb35bef540adb1d841da63c9cd3df76b3c4e43010f436b2cd85c",
|
||||
"md5": "3ec9ec13b42e5f43f49cfa63f83b46fa",
|
||||
"size": "922963076"
|
||||
}
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"cuda11": {
|
||||
"relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-9.8.0.87_cuda11-archive.zip",
|
||||
"sha256": "b2995837e6b9a5b3816a0cd90480769cd4280f965c2ef0848debf029f391ca8f",
|
||||
"md5": "39b78253550678399367b160d7503e04",
|
||||
"size": "422255533"
|
||||
},
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-9.8.0.87_cuda12-archive.zip",
|
||||
"sha256": "d8a23705e3884b137b7e05449fb2b61bfa524e7cfc3fda80743d633f423c6ce4",
|
||||
"md5": "c9926e3b1638d775ae384837ccd97c72",
|
||||
"size": "675349654"
|
||||
}
|
||||
},
|
||||
"linux-aarch64": {
|
||||
"cuda12": {
|
||||
"relative_path": "cudnn/linux-aarch64/cudnn-linux-aarch64-9.8.0.87_cuda12-archive.tar.xz",
|
||||
"sha256": "f03ece3ff07d1719f06218973a8797cec1be387cc317baab5bb118dc988199e7",
|
||||
"md5": "989ba35d01495ea4c66097b021eb7cda",
|
||||
"size": "964790260"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cudnn_samples": {
|
||||
"name": "NVIDIA cuDNN samples",
|
||||
"license": "cudnn",
|
||||
"license_path": "cudnn_samples/LICENSE.txt",
|
||||
"version": "9.8.0.87",
|
||||
"source": {
|
||||
"relative_path": "cudnn_samples/source/cudnn_samples-source-9.8.0.87-archive.tar.xz",
|
||||
"sha256": "2a63562a3a9b2cdcd9d8bce1dcc106a3cc9f47a6448b7a77b0e3b8f8776d0a41",
|
||||
"md5": "e0a198f07791ece1d635d56c9626132a",
|
||||
"size": "1666724"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# cusparselt
|
||||
|
||||
Link: <https://developer.download.nvidia.com/compute/cusparselt/redist/>
|
||||
|
||||
Requirements: <https://docs.nvidia.com/cuda/cusparselt/getting_started.html#prerequisites>
|
||||
|
||||
NOTE: 0.7.1 only supports CUDA 12.8 and later.
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"release_date": "2024-10-15",
|
||||
"release_label": "0.6.3",
|
||||
"release_product": "cusparselt",
|
||||
"libcusparse_lt": {
|
||||
"name": "NVIDIA cuSPARSELt",
|
||||
"license": "cuSPARSELt",
|
||||
"license_path": "libcusparse_lt/LICENSE.txt",
|
||||
"version": "0.6.3.2",
|
||||
"linux-x86_64": {
|
||||
"relative_path": "libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.6.3.2-archive.tar.xz",
|
||||
"sha256": "a2f856e78943f5c538bdef1c9edc64a5ed30bf8bb7d5fcb615c684ffe776cc31",
|
||||
"md5": "d074824e3dc6c382160873a8ef49c098",
|
||||
"size": "110698912"
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"relative_path": "libcusparse_lt/linux-sbsa/libcusparse_lt-linux-sbsa-0.6.3.2-archive.tar.xz",
|
||||
"sha256": "3e420ddbff4eb9ac603f57c7aa8b3d5271112816e244eb55ef9f30c4eb6a04b7",
|
||||
"md5": "dd6b0dd464bb8596950ab761890e1ae1",
|
||||
"size": "109919332"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"relative_path": "libcusparse_lt/windows-x86_64/libcusparse_lt-windows-x86_64-0.6.3.2-archive.zip",
|
||||
"sha256": "6d276e33a399008c22ffefd707eefe2f57ff2ff8f1dc1929d9e3e75d3c83562d",
|
||||
"md5": "95de6b57ceceb199f9b86bfbe5d2d394",
|
||||
"size": "328143559"
|
||||
},
|
||||
"linux-aarch64": {
|
||||
"relative_path": "libcusparse_lt/linux-aarch64/libcusparse_lt-linux-aarch64-0.6.3.2-archive.tar.xz",
|
||||
"sha256": "91501d0c05d1ff0dd67399ecd7c1bf76a620e842dce54ae4c8a1f07cec0673e5",
|
||||
"md5": "7f00c8663678a97948bbd2e98b65a9fa",
|
||||
"size": "19000276"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# cutensor
|
||||
|
||||
Link: <https://developer.download.nvidia.com/compute/cutensor/redist/>
|
||||
|
||||
Requirements: <https://docs.nvidia.com/cuda/cutensor/latest/index.html#support>
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"release_date": "2025-03-13",
|
||||
"release_label": "2.2.0",
|
||||
"release_product": "cutensor",
|
||||
"libcutensor": {
|
||||
"name": "NVIDIA cuTENSOR",
|
||||
"license": "cuTensor",
|
||||
"license_path": "libcutensor/LICENSE.txt",
|
||||
"version": "2.2.0.0",
|
||||
"linux-x86_64": {
|
||||
"relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-2.2.0.0-archive.tar.xz",
|
||||
"sha256": "db76dcbe997615ef8bc1e04c385e9a1e2016430afee7d6a242663baf17108dbf",
|
||||
"md5": "48d7be41aa46cc1eb75b6603495a245e",
|
||||
"size": "703852896"
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-2.2.0.0-archive.tar.xz",
|
||||
"sha256": "484791c8967a4137c544304e7d475b1cd753d9aad5d835ae6794f68087b1175a",
|
||||
"md5": "dc0032e78d875068424010abf1aef6f0",
|
||||
"size": "694257044"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-2.2.0.0-archive.zip",
|
||||
"sha256": "b1f5c7b399f8124ccf70e4df751e43757b7727e1028ec04a27a4a63efff06885",
|
||||
"md5": "db4563d3ee67f3bf6af4db31d326917d",
|
||||
"size": "1288139786"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
pkgs/development/cuda-modules/_cuda/manifests/default.nix
Normal file
19
pkgs/development/cuda-modules/_cuda/manifests/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ lib }:
|
||||
lib.mapAttrs (
|
||||
redistName: _type:
|
||||
let
|
||||
redistManifestDir = ./. + "/${redistName}";
|
||||
in
|
||||
lib.concatMapAttrs (
|
||||
fileName: _type:
|
||||
let
|
||||
# Manifests all end in .json and are named "redistrib_<version>.json".
|
||||
version = lib.removePrefix "redistrib_" (lib.removeSuffix ".json" fileName);
|
||||
in
|
||||
# NOTE: We do not require that all files have this pattern, as manifest directories may contain documentation
|
||||
# and utility functions we should ignore.
|
||||
lib.optionalAttrs (version != fileName) {
|
||||
"${version}" = lib.importJSON (redistManifestDir + "/${fileName}");
|
||||
}
|
||||
) (builtins.readDir redistManifestDir)
|
||||
) (builtins.removeAttrs (builtins.readDir ./.) [ "default.nix" ])
|
||||
@@ -0,0 +1,30 @@
|
||||
# tensorrt
|
||||
|
||||
Requirements: <https://docs.nvidia.com/deeplearning/tensorrt/latest/getting-started/support-matrix.html#support-matrix>
|
||||
|
||||
These redistributable manifests are made by hand to allow TensorRT to be packaged with the same functionality the other NVIDIA redistributable libraries are packaged with.
|
||||
|
||||
Only available from 10.0.0 and onwards, which is when NVIDIA stopped putting them behind a login wall.
|
||||
|
||||
You can find them at: <https://github.com/NVIDIA/TensorRT?tab=readme-ov-file#optional---if-not-using-tensorrt-container-specify-the-tensorrt-ga-release-build-path>.
|
||||
|
||||
Construct entries using the provider `helper.sh` script.
|
||||
|
||||
As an example:
|
||||
|
||||
```console
|
||||
$ ./tensorrt/helper.sh 12.5 10.2.0.19 windows-x86_64
|
||||
main: storePath: /nix/store/l2hq83ihj3bcm4z836cz2dw3ilkhwrpy-TensorRT-10.2.0.19.Windows.win10.cuda-12.5.zip
|
||||
{
|
||||
"windows-x86_64": {
|
||||
"cuda12": {
|
||||
"md5": "70282ec501c9e395a3ffdd0d2baf9d95",
|
||||
"relative_path": "tensorrt/10.2.0/zip/TensorRT-10.2.0.19.Windows.win10.cuda-12.5.zip",
|
||||
"sha256": "4a9c6e279fd36559551a6d88e37d835db5ebdc950246160257b0b538960e57fa",
|
||||
"size": "1281366141"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
I set the `release_date` to the date of the corresponding release on their GitHub: <https://github.com/NVIDIA/TensorRT/releases>.
|
||||
130
pkgs/development/cuda-modules/_cuda/manifests/tensorrt/helper.sh
Executable file
130
pkgs/development/cuda-modules/_cuda/manifests/tensorrt/helper.sh
Executable file
@@ -0,0 +1,130 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Requires nix and jq
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
mkRedistUrlRelativePath() {
|
||||
local -r cudaMajorMinorVersion=${1:?}
|
||||
local -r tensorrtMajorMinorPatchBuildVersion=${2:?}
|
||||
local -r redistSystem=${3:?}
|
||||
|
||||
local -r tensorrtMajorMinorPatchVersion="$(echo "$tensorrtMajorMinorPatchBuildVersion" | cut -d. -f1-3)"
|
||||
local -r tensorrtMinorVersion="$(echo "$tensorrtMajorMinorPatchVersion" | cut -d. -f2)"
|
||||
|
||||
local archiveDir=""
|
||||
local archiveExtension=""
|
||||
local osName=""
|
||||
local platformName=""
|
||||
case "$redistSystem" in
|
||||
linux-aarch64) archiveDir="tars" && archiveExtension="tar.gz" && osName="l4t" && platformName="aarch64-gnu" ;;
|
||||
linux-sbsa)
|
||||
archiveDir="tars" && archiveExtension="tar.gz" && platformName="aarch64-gnu"
|
||||
# 10.0-10.3 use Ubuntu 22.40
|
||||
# 10.4-10.6 use Ubuntu 24.04
|
||||
# 10.7+ use Linux
|
||||
case "$tensorrtMinorVersion" in
|
||||
0 | 1 | 2 | 3) osName="Ubuntu-22.04" ;;
|
||||
4 | 5 | 6) osName="Ubuntu-24.04" ;;
|
||||
*) osName="Linux" ;;
|
||||
esac
|
||||
;;
|
||||
linux-x86_64) archiveDir="tars" && archiveExtension="tar.gz" && osName="Linux" && platformName="x86_64-gnu" ;;
|
||||
windows-x86_64)
|
||||
archiveExtension="zip" && platformName="win10"
|
||||
# Windows info is different for 10.0.*
|
||||
case "$tensorrtMinorVersion" in
|
||||
0) archiveDir="zips" && osName="Windows10" ;;
|
||||
*) archiveDir="zip" && osName="Windows" ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "mkRedistUrlRelativePath: Unsupported redistSystem: $redistSystem" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local -r relativePath="tensorrt/$tensorrtMajorMinorPatchVersion/$archiveDir/TensorRT-${tensorrtMajorMinorPatchBuildVersion}.${osName}.${platformName}.cuda-${cudaMajorMinorVersion}.${archiveExtension}"
|
||||
echo "$relativePath"
|
||||
}
|
||||
|
||||
getNixStorePath() {
|
||||
local -r relativePath=${1:?}
|
||||
local -r jsonBlob="$(nix store prefetch-file --json "https://developer.nvidia.com/downloads/compute/machine-learning/$relativePath")"
|
||||
if [[ -z $jsonBlob ]]; then
|
||||
echo "getNixStorePath: Failed to fetch jsonBlob for relativePath: $relativePath" >&2
|
||||
exit 1
|
||||
fi
|
||||
local -r storePath="$(echo "$jsonBlob" | jq -cr '.storePath')"
|
||||
echo "$storePath"
|
||||
}
|
||||
|
||||
printOutput() {
|
||||
local -r cudaMajorMinorVersion=${1:?}
|
||||
local -r redistSystem=${2:?}
|
||||
local -r md5Hash=${3:?}
|
||||
local -r relativePath=${4:?}
|
||||
local -r sha256Hash=${5:?}
|
||||
local -r size=${6:?}
|
||||
|
||||
local -r cudaVariant="cuda$(echo "$cudaMajorMinorVersion" | cut -d. -f1)"
|
||||
|
||||
# Echo everything to stdout using JQ to format the output as JSON
|
||||
jq \
|
||||
--raw-output \
|
||||
--sort-keys \
|
||||
--null-input \
|
||||
--arg redistSystem "$redistSystem" \
|
||||
--arg cudaVariant "$cudaVariant" \
|
||||
--arg md5Hash "$md5Hash" \
|
||||
--arg relativePath "$relativePath" \
|
||||
--arg sha256Hash "$sha256Hash" \
|
||||
--arg size "$size" \
|
||||
'{
|
||||
$redistSystem: {
|
||||
$cudaVariant: {
|
||||
md5: $md5Hash,
|
||||
relative_path: $relativePath,
|
||||
sha256: $sha256Hash,
|
||||
size: $size
|
||||
}
|
||||
}
|
||||
}'
|
||||
}
|
||||
|
||||
main() {
|
||||
local -r cudaMajorMinorVersion=${1:?}
|
||||
if [[ ! $cudaMajorMinorVersion =~ ^[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "main: Invalid cudaMajorMinorVersion: $cudaMajorMinorVersion" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local -r tensorrtMajorMinorPatchBuildVersion=${2:?}
|
||||
if [[ ! $tensorrtMajorMinorPatchBuildVersion =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "main: Invalid tensorrtMajorMinorPatchBuildVersion: $tensorrtMajorMinorPatchBuildVersion" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local -r redistSystem=${3:?}
|
||||
case "$redistSystem" in
|
||||
linux-aarch64) ;;
|
||||
linux-sbsa) ;;
|
||||
linux-x86_64) ;;
|
||||
windows-x86_64) ;;
|
||||
*)
|
||||
echo "main: Unsupported redistSystem: $redistSystem" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local -r relativePath="$(mkRedistUrlRelativePath "$cudaMajorMinorVersion" "$tensorrtMajorMinorPatchBuildVersion" "$redistSystem")"
|
||||
local -r storePath="$(getNixStorePath "$relativePath")"
|
||||
echo "main: storePath: $storePath" >&2
|
||||
local -r md5Hash="$(nix hash file --type md5 --base16 "$storePath")"
|
||||
local -r sha256Hash="$(nix hash file --type sha256 --base16 "$storePath")"
|
||||
local -r size="$(du -b "$storePath" | cut -f1)"
|
||||
|
||||
printOutput "$cudaMajorMinorVersion" "$redistSystem" "$md5Hash" "$relativePath" "$sha256Hash" "$size"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"release_date": "2024-12-02",
|
||||
"release_label": "10.7.0",
|
||||
"release_product": "tensorrt",
|
||||
"tensorrt": {
|
||||
"name": "NVIDIA TensorRT",
|
||||
"license": "TensorRT",
|
||||
"version": "10.7.0.23",
|
||||
"cuda_variant": [
|
||||
"12"
|
||||
],
|
||||
"linux-aarch64": {
|
||||
"cuda12": {
|
||||
"md5": "ec486c783455bf31a2561f2b7874585e",
|
||||
"relative_path": "tensorrt/10.7.0/tars/TensorRT-10.7.0.23.l4t.aarch64-gnu.cuda-12.6.tar.gz",
|
||||
"sha256": "b3028a82818a9daf6296f43d0cdecfa51eaea4552ffb6fe6fad5e6e1aea44da6",
|
||||
"size": "655777784"
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"cuda12": {
|
||||
"md5": "5b49557b4dc47641242a2bfb29e1cff1",
|
||||
"relative_path": "tensorrt/10.7.0/tars/TensorRT-10.7.0.23.Linux.aarch64-gnu.cuda-12.6.tar.gz",
|
||||
"sha256": "6b304cf014f2977e845bd44fdb343f0e7af2d9cded997bc9cfea3949d9e84dcb",
|
||||
"size": "2469927296"
|
||||
}
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"cuda12": {
|
||||
"md5": "925c98fbe9abe82058814159727732a2",
|
||||
"relative_path": "tensorrt/10.7.0/tars/TensorRT-10.7.0.23.Linux.x86_64-gnu.cuda-12.6.tar.gz",
|
||||
"sha256": "d7f16520457caaf97ad8a7e94d802f89d77aedf9f361a255f2c216e2a3a40a11",
|
||||
"size": "4446480887"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"release_date": "2025-03-11",
|
||||
"release_label": "10.9.0",
|
||||
"release_product": "tensorrt",
|
||||
"tensorrt": {
|
||||
"name": "NVIDIA TensorRT",
|
||||
"license": "TensorRT",
|
||||
"version": "10.9.0.34",
|
||||
"cuda_variant": [
|
||||
"12"
|
||||
],
|
||||
"linux-sbsa": {
|
||||
"cuda12": {
|
||||
"md5": "e56a9f9d7327c65d9b95996d3008ed44",
|
||||
"relative_path": "tensorrt/10.9.0/tars/TensorRT-10.9.0.34.Linux.aarch64-gnu.cuda-12.8.tar.gz",
|
||||
"sha256": "b81ec2a067f67f082c13caec2dcef54385b42a9de6a4ecae6f318aa2d41964f2",
|
||||
"size": "4123115318"
|
||||
}
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"cuda12": {
|
||||
"md5": "ee49e3e6e00b21274907956216b6769f",
|
||||
"relative_path": "tensorrt/10.9.0/tars/TensorRT-10.9.0.34.Linux.x86_64-gnu.cuda-12.8.tar.gz",
|
||||
"sha256": "33be0e61e3bf177bbbcabb4892bf013f0c8ac71d2be73f2803848a382cb14272",
|
||||
"size": "6917032417"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,4 +25,8 @@ builtins.mapAttrs mkRenamed {
|
||||
package = final.cudatoolkit;
|
||||
};
|
||||
|
||||
cusparselt = {
|
||||
path = "cudaPackages.libcusparse_lt";
|
||||
package = final.libcusparse_lt;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{ lib, stdenv }:
|
||||
let
|
||||
inherit (stdenv) hostPlatform;
|
||||
|
||||
# Samples are built around the CUDA Toolkit, which is not available for
|
||||
# aarch64. Check for both CUDA version and platform.
|
||||
platformIsSupported = hostPlatform.isx86_64 && hostPlatform.isLinux;
|
||||
|
||||
# Build our extension
|
||||
extension =
|
||||
final: _:
|
||||
lib.attrsets.optionalAttrs platformIsSupported {
|
||||
cuda-library-samples = final.callPackage ./generic.nix { };
|
||||
};
|
||||
in
|
||||
extension
|
||||
@@ -1,70 +0,0 @@
|
||||
{ cudaMajorMinorVersion, lib }:
|
||||
let
|
||||
inherit (lib) attrsets modules trivial;
|
||||
redistName = "cuda";
|
||||
|
||||
# Manifest files for CUDA redistributables (aka redist). These can be found at
|
||||
# https://developer.download.nvidia.com/compute/cuda/redist/
|
||||
# Maps a cuda version to the specific version of the manifest.
|
||||
cudaVersionMap = {
|
||||
"12.6" = "12.6.3";
|
||||
"12.8" = "12.8.1";
|
||||
"12.9" = "12.9.1";
|
||||
};
|
||||
|
||||
# Check if the current CUDA version is supported.
|
||||
cudaVersionMappingExists = builtins.hasAttr cudaMajorMinorVersion cudaVersionMap;
|
||||
|
||||
# fullCudaVersion : String
|
||||
fullCudaVersion = cudaVersionMap.${cudaMajorMinorVersion};
|
||||
|
||||
evaluatedModules = modules.evalModules {
|
||||
modules = [
|
||||
../modules
|
||||
# We need to nest the manifests in a config.cuda.manifests attribute so the
|
||||
# module system can evaluate them.
|
||||
{
|
||||
cuda.manifests = {
|
||||
redistrib = trivial.importJSON (./manifests + "/redistrib_${fullCudaVersion}.json");
|
||||
feature = trivial.importJSON (./manifests + "/feature_${fullCudaVersion}.json");
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Generally we prefer to do things involving getting attribute names with feature_manifest instead
|
||||
# of redistrib_manifest because the feature manifest will have *only* the redist system
|
||||
# names as the keys, whereas the redistrib manifest will also have things like version, name, license,
|
||||
# and license_path.
|
||||
featureManifest = evaluatedModules.config.cuda.manifests.feature;
|
||||
redistribManifest = evaluatedModules.config.cuda.manifests.redistrib;
|
||||
|
||||
# Builder function which builds a single redist package for a given platform.
|
||||
# buildRedistPackage : callPackage -> PackageName -> Derivation
|
||||
buildRedistPackage =
|
||||
callPackage: pname:
|
||||
callPackage ../generic-builders/manifest.nix {
|
||||
inherit pname redistName;
|
||||
# We pass the whole release to the builder because it has logic to handle
|
||||
# the case we're trying to build on an unsupported platform.
|
||||
redistribRelease = redistribManifest.${pname};
|
||||
featureRelease = featureManifest.${pname};
|
||||
};
|
||||
|
||||
# Build all the redist packages given final and prev.
|
||||
redistPackages =
|
||||
final: _prev:
|
||||
# Wrap the whole thing in an optionalAttrs so we can return an empty set if the CUDA version
|
||||
# is not supported.
|
||||
# NOTE: We cannot include the call to optionalAttrs *in* the pipe as we would strictly evaluate the
|
||||
# attrNames before we check if the CUDA version is supported.
|
||||
attrsets.optionalAttrs cudaVersionMappingExists (
|
||||
trivial.pipe featureManifest [
|
||||
# Get all the package names
|
||||
builtins.attrNames
|
||||
# Build the redist packages
|
||||
(trivial.flip attrsets.genAttrs (buildRedistPackage final.callPackage))
|
||||
]
|
||||
);
|
||||
in
|
||||
redistPackages
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,112 +0,0 @@
|
||||
# NOTE: Check the following URLs for support matrices:
|
||||
# v8 -> https://docs.nvidia.com/deeplearning/cudnn/archives/index.html
|
||||
# v9 -> https://docs.nvidia.com/deeplearning/cudnn/frontend/latest/reference/support-matrix.html
|
||||
# Version policy is to keep the latest minor release for each major release.
|
||||
# https://developer.download.nvidia.com/compute/cudnn/redist/
|
||||
{
|
||||
cudnn.releases = {
|
||||
# jetson
|
||||
linux-aarch64 = [
|
||||
{
|
||||
version = "8.9.5.30";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-aarch64/cudnn-linux-aarch64-8.9.5.30_cuda12-archive.tar.xz";
|
||||
hash = "sha256-BJH3sC9VwiB362eL8xTB+RdSS9UHz1tlgjm/mKRyM6E=";
|
||||
}
|
||||
{
|
||||
version = "9.7.1.26";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-aarch64/cudnn-linux-aarch64-9.7.1.26_cuda12-archive.tar.xz";
|
||||
hash = "sha256-jDPWAXKOiJYpblPwg5FUSh7F0Dgg59LLnd+pX9y7r1w=";
|
||||
}
|
||||
{
|
||||
version = "9.8.0.87";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-aarch64/cudnn-linux-aarch64-9.8.0.87_cuda12-archive.tar.xz";
|
||||
hash = "sha256-8D7OP/B9FxnwYhiXOoeXzsG+OHzDF7qrW7EY3JiBmec=";
|
||||
}
|
||||
];
|
||||
# powerpc
|
||||
linux-ppc64le = [ ];
|
||||
# server-grade arm
|
||||
linux-sbsa = [
|
||||
{
|
||||
version = "8.9.7.29";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.7.29_cuda12-archive.tar.xz";
|
||||
hash = "sha256-6Yt8gAEHheXVygHuTOm1sMjHNYfqb4ZIvjTT+NHUe9E=";
|
||||
}
|
||||
{
|
||||
version = "9.3.0.75";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.6";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-9.3.0.75_cuda12-archive.tar.xz";
|
||||
hash = "sha256-Eibdm5iciYY4VSlj0ACjz7uKCgy5uvjLCear137X1jk=";
|
||||
}
|
||||
{
|
||||
version = "9.7.1.26";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-9.7.1.26_cuda12-archive.tar.xz";
|
||||
hash = "sha256-koJFUKlesnWwbJCZhBDhLOBRQOBQjwkFZExlTJ7Xp2Q=";
|
||||
}
|
||||
{
|
||||
version = "9.8.0.87";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-9.8.0.87_cuda12-archive.tar.xz";
|
||||
hash = "sha256-IvYvR08MuzW+9UCtsdhB2mPJzT33azxOQwEPQ2ss2Fw=";
|
||||
}
|
||||
{
|
||||
version = "9.11.0.98";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.9";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-9.11.0.98_cuda12-archive.tar.xz";
|
||||
hash = "sha256-X81kUdiKnTt/rLwASB+l4rsV8sptxvhuCysgG8QuzVY=";
|
||||
}
|
||||
|
||||
];
|
||||
# x86_64
|
||||
linux-x86_64 = [
|
||||
{
|
||||
version = "8.9.7.29";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz";
|
||||
hash = "sha256-R1MzYlx+QqevPKCy91BqEG4wyTsaoAgc2cE++24h47s=";
|
||||
}
|
||||
{
|
||||
version = "9.3.0.75";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.6";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.3.0.75_cuda12-archive.tar.xz";
|
||||
hash = "sha256-PW7xCqBtyTOaR34rBX4IX/hQC73ueeQsfhNlXJ7/LCY=";
|
||||
}
|
||||
{
|
||||
version = "9.7.1.26";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.7.1.26_cuda12-archive.tar.xz";
|
||||
hash = "sha256-EJpeXGvN9Dlub2Pz+GLtLc8W7pPuA03HBKGxG98AwLE=";
|
||||
}
|
||||
{
|
||||
version = "9.8.0.87";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.8";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.8.0.87_cuda12-archive.tar.xz";
|
||||
hash = "sha256-MhubM7sSh0BNk9VnLTUvFv6rxLIgrGrguG5LJ/JX3PQ=";
|
||||
}
|
||||
{
|
||||
version = "9.11.0.98";
|
||||
minCudaVersion = "12.0";
|
||||
maxCudaVersion = "12.9";
|
||||
url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.11.0.98_cuda12-archive.tar.xz";
|
||||
hash = "sha256-tgyPrQH6FSHS5x7TiIe5BHjX8Hs9pJ/WirEYqf7k2kg=";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
# Shims to mimic the shape of ../modules/generic/manifests/{feature,redistrib}/release.nix
|
||||
{
|
||||
package,
|
||||
# redistSystem :: String
|
||||
# String is "unsupported" if the given architecture is unsupported.
|
||||
redistSystem,
|
||||
}:
|
||||
{
|
||||
featureRelease = {
|
||||
inherit (package) minCudaVersion maxCudaVersion;
|
||||
${redistSystem}.outputs = {
|
||||
lib = true;
|
||||
static = true;
|
||||
dev = true;
|
||||
};
|
||||
};
|
||||
redistribRelease = {
|
||||
name = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
|
||||
inherit (package) hash url version;
|
||||
};
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
# Support matrix can be found at
|
||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-880/support-matrix/index.html
|
||||
{
|
||||
cudaLib,
|
||||
lib,
|
||||
redistSystem,
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
attrsets
|
||||
lists
|
||||
modules
|
||||
trivial
|
||||
;
|
||||
|
||||
redistName = "cusparselt";
|
||||
pname = "libcusparse_lt";
|
||||
|
||||
cusparseltVersions = [
|
||||
"0.7.1"
|
||||
];
|
||||
|
||||
# Manifests :: { redistrib, feature }
|
||||
|
||||
# Each release of cusparselt gets mapped to an evaluated module for that release.
|
||||
# From there, we can get the min/max CUDA versions supported by that release.
|
||||
# listOfManifests :: List Manifests
|
||||
listOfManifests =
|
||||
let
|
||||
configEvaluator =
|
||||
fullCusparseltVersion:
|
||||
modules.evalModules {
|
||||
modules = [
|
||||
../modules
|
||||
# We need to nest the manifests in a config.cusparselt.manifests attribute so the
|
||||
# module system can evaluate them.
|
||||
{
|
||||
cusparselt.manifests = {
|
||||
redistrib = trivial.importJSON (./manifests + "/redistrib_${fullCusparseltVersion}.json");
|
||||
feature = trivial.importJSON (./manifests + "/feature_${fullCusparseltVersion}.json");
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
# Un-nest the manifests attribute set.
|
||||
releaseGrabber = evaluatedModules: evaluatedModules.config.cusparselt.manifests;
|
||||
in
|
||||
lists.map (trivial.flip trivial.pipe [
|
||||
configEvaluator
|
||||
releaseGrabber
|
||||
]) cusparseltVersions;
|
||||
|
||||
# platformIsSupported :: Manifests -> Boolean
|
||||
platformIsSupported =
|
||||
{ feature, redistrib, ... }:
|
||||
(attrsets.attrByPath [
|
||||
pname
|
||||
redistSystem
|
||||
] null feature) != null;
|
||||
|
||||
# TODO(@connorbaker): With an auxiliary file keeping track of the CUDA versions each release supports,
|
||||
# we could filter out releases that don't support our CUDA version.
|
||||
# However, we don't have that currently, so we make a best-effort to try to build TensorRT with whatever
|
||||
# libPath corresponds to our CUDA version.
|
||||
# supportedManifests :: List Manifests
|
||||
supportedManifests = builtins.filter platformIsSupported listOfManifests;
|
||||
|
||||
# Compute versioned attribute name to be used in this package set
|
||||
# Patch version changes should not break the build, so we only use major and minor
|
||||
# computeName :: RedistribRelease -> String
|
||||
computeName =
|
||||
{ version, ... }: cudaLib.mkVersionedName redistName (lib.versions.majorMinor version);
|
||||
in
|
||||
final: _:
|
||||
let
|
||||
# buildCusparseltPackage :: Manifests -> AttrSet Derivation
|
||||
buildCusparseltPackage =
|
||||
{ redistrib, feature }:
|
||||
let
|
||||
drv = final.callPackage ../generic-builders/manifest.nix {
|
||||
inherit pname redistName;
|
||||
redistribRelease = redistrib.${pname};
|
||||
featureRelease = feature.${pname};
|
||||
};
|
||||
in
|
||||
attrsets.nameValuePair (computeName redistrib.${pname}) drv;
|
||||
|
||||
extension =
|
||||
let
|
||||
nameOfNewest = computeName (lists.last supportedManifests).redistrib.${pname};
|
||||
drvs = builtins.listToAttrs (lists.map buildCusparseltPackage supportedManifests);
|
||||
containsDefault = attrsets.optionalAttrs (drvs != { }) { cusparselt = drvs.${nameOfNewest}; };
|
||||
in
|
||||
drvs // containsDefault;
|
||||
in
|
||||
extension
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"libcusparse_lt": {
|
||||
"linux-aarch64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": false,
|
||||
"sample": false,
|
||||
"static": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
# Support matrix can be found at
|
||||
# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-880/support-matrix/index.html
|
||||
#
|
||||
# TODO(@connorbaker):
|
||||
# This is a very similar strategy to CUDA/CUDNN:
|
||||
#
|
||||
# - Get all versions supported by the current release of CUDA
|
||||
# - Build all of them
|
||||
# - Make the newest the default
|
||||
#
|
||||
# Unique twists:
|
||||
#
|
||||
# - Instead of providing different releases for each version of CUDA, CuTensor has multiple subdirectories in `lib`
|
||||
# -- one for each version of CUDA.
|
||||
{
|
||||
cudaLib,
|
||||
cudaMajorMinorVersion,
|
||||
lib,
|
||||
redistSystem,
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
attrsets
|
||||
lists
|
||||
modules
|
||||
versions
|
||||
trivial
|
||||
;
|
||||
|
||||
redistName = "cutensor";
|
||||
pname = "libcutensor";
|
||||
|
||||
cutensorVersions = [
|
||||
"2.0.2"
|
||||
"2.1.0"
|
||||
];
|
||||
|
||||
# Manifests :: { redistrib, feature }
|
||||
|
||||
# Each release of cutensor gets mapped to an evaluated module for that release.
|
||||
# From there, we can get the min/max CUDA versions supported by that release.
|
||||
# listOfManifests :: List Manifests
|
||||
listOfManifests =
|
||||
let
|
||||
configEvaluator =
|
||||
fullCutensorVersion:
|
||||
modules.evalModules {
|
||||
modules = [
|
||||
../modules
|
||||
# We need to nest the manifests in a config.cutensor.manifests attribute so the
|
||||
# module system can evaluate them.
|
||||
{
|
||||
cutensor.manifests = {
|
||||
redistrib = trivial.importJSON (./manifests + "/redistrib_${fullCutensorVersion}.json");
|
||||
feature = trivial.importJSON (./manifests + "/feature_${fullCutensorVersion}.json");
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
# Un-nest the manifests attribute set.
|
||||
releaseGrabber = evaluatedModules: evaluatedModules.config.cutensor.manifests;
|
||||
in
|
||||
lists.map (trivial.flip trivial.pipe [
|
||||
configEvaluator
|
||||
releaseGrabber
|
||||
]) cutensorVersions;
|
||||
|
||||
# Our cudaMajorMinorVersion tells us which version of CUDA we're building against.
|
||||
# The subdirectories in lib/ tell us which versions of CUDA are supported.
|
||||
# Typically the names will look like this:
|
||||
#
|
||||
# - 11
|
||||
# - 12
|
||||
|
||||
# libPath :: String
|
||||
libPath = versions.major cudaMajorMinorVersion;
|
||||
|
||||
# A release is supported if it has a libPath that matches our CUDA version for our platform.
|
||||
# LibPath are not constant across the same release -- one platform may support fewer
|
||||
# CUDA versions than another.
|
||||
# platformIsSupported :: Manifests -> Boolean
|
||||
platformIsSupported =
|
||||
{ feature, redistrib, ... }:
|
||||
(attrsets.attrByPath [
|
||||
pname
|
||||
redistSystem
|
||||
] null feature) != null;
|
||||
|
||||
# TODO(@connorbaker): With an auxiliary file keeping track of the CUDA versions each release supports,
|
||||
# we could filter out releases that don't support our CUDA version.
|
||||
# However, we don't have that currently, so we make a best-effort to try to build TensorRT with whatever
|
||||
# libPath corresponds to our CUDA version.
|
||||
# supportedManifests :: List Manifests
|
||||
supportedManifests = builtins.filter platformIsSupported listOfManifests;
|
||||
|
||||
# Compute versioned attribute name to be used in this package set
|
||||
# Patch version changes should not break the build, so we only use major and minor
|
||||
# computeName :: RedistribRelease -> String
|
||||
computeName =
|
||||
{ version, ... }: cudaLib.mkVersionedName redistName (lib.versions.majorMinor version);
|
||||
in
|
||||
final: _:
|
||||
let
|
||||
# buildCutensorPackage :: Manifests -> AttrSet Derivation
|
||||
buildCutensorPackage =
|
||||
{ redistrib, feature }:
|
||||
let
|
||||
drv = final.callPackage ../generic-builders/manifest.nix {
|
||||
inherit pname redistName libPath;
|
||||
redistribRelease = redistrib.${pname};
|
||||
featureRelease = feature.${pname};
|
||||
};
|
||||
in
|
||||
attrsets.nameValuePair (computeName redistrib.${pname}) drv;
|
||||
|
||||
extension =
|
||||
let
|
||||
nameOfNewest = computeName (lists.last supportedManifests).redistrib.${pname};
|
||||
drvs = builtins.listToAttrs (lists.map buildCutensorPackage supportedManifests);
|
||||
containsDefault = attrsets.optionalAttrs (drvs != { }) { cutensor = drvs.${nameOfNewest}; };
|
||||
in
|
||||
drvs // containsDefault;
|
||||
in
|
||||
extension
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"libcutensor": {
|
||||
"linux-ppc64le": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": false,
|
||||
"sample": false,
|
||||
"static": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"libcutensor": {
|
||||
"linux-sbsa": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": true,
|
||||
"sample": false,
|
||||
"static": true
|
||||
}
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"outputs": {
|
||||
"bin": false,
|
||||
"dev": true,
|
||||
"doc": false,
|
||||
"lib": false,
|
||||
"sample": false,
|
||||
"static": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"release_date": "2024-06-24",
|
||||
"release_label": "2.0.2",
|
||||
"release_product": "cutensor",
|
||||
"libcutensor": {
|
||||
"name": "NVIDIA cuTENSOR",
|
||||
"license": "cuTensor",
|
||||
"license_path": "libcutensor/LICENSE.txt",
|
||||
"version": "2.0.2.4",
|
||||
"linux-x86_64": {
|
||||
"relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-2.0.2.4-archive.tar.xz",
|
||||
"sha256": "957b04ef6343aca404fe5f4a3f1f1d3ac0bd04ceb3acecc93e53f4d63bd91157",
|
||||
"md5": "2b994ecba434e69ee55043cf353e05b4",
|
||||
"size": "545271628"
|
||||
},
|
||||
"linux-ppc64le": {
|
||||
"relative_path": "libcutensor/linux-ppc64le/libcutensor-linux-ppc64le-2.0.2.4-archive.tar.xz",
|
||||
"sha256": "db2c05e231a26fb5efee470e1d8e11cb1187bfe0726b665b87cbbb62a9901ba0",
|
||||
"md5": "6b00e29407452333946744c4084157e8",
|
||||
"size": "543070992"
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-2.0.2.4-archive.tar.xz",
|
||||
"sha256": "9712b54aa0988074146867f9b6f757bf11a61996f3b58b21e994e920b272301b",
|
||||
"md5": "c9bb31a92626a092d0c7152b8b3eaa18",
|
||||
"size": "540299376"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-2.0.2.4-archive.zip",
|
||||
"sha256": "ab2fca16d410863d14f2716cec0d07fb21d20ecd24ee47d309e9970c9c01ed4a",
|
||||
"md5": "f6cfdb29a9a421a1ee4df674dd54028c",
|
||||
"size": "921154033"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"release_date": "2025-01-27",
|
||||
"release_label": "2.1.0",
|
||||
"release_product": "cutensor",
|
||||
"libcutensor": {
|
||||
"name": "NVIDIA cuTENSOR",
|
||||
"license": "cuTensor",
|
||||
"license_path": "libcutensor/LICENSE.txt",
|
||||
"version": "2.1.0.9",
|
||||
"linux-x86_64": {
|
||||
"relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-2.1.0.9-archive.tar.xz",
|
||||
"sha256": "ee59fcb4e8d59fc0d8cebf5f7f23bf2a196a76e6bcdcaa621aedbdcabd20a759",
|
||||
"md5": "ed15120c512dfb3e32b49103850bb9dd",
|
||||
"size": "814871140"
|
||||
},
|
||||
"linux-sbsa": {
|
||||
"relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-2.1.0.9-archive.tar.xz",
|
||||
"sha256": "cef7819c4ecf3120d4f99b08463b8db1a8591be25147d1688371024885b1d2f0",
|
||||
"md5": "fec00a1a825a05c0166eda6625dc587d",
|
||||
"size": "782008004"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-2.1.0.9-archive.zip",
|
||||
"sha256": "ed835ba7fd617000f77e1dff87403d123edf540bd99339e3da2eaab9d32a4040",
|
||||
"md5": "9efcbc0c9c372b0e71e11d4487aa5ffa",
|
||||
"size": "1514752712"
|
||||
}
|
||||
}
|
||||
}
|
||||
152
pkgs/development/cuda-modules/default.nix
Normal file
152
pkgs/development/cuda-modules/default.nix
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
_cuda,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
# Manually provided arguments
|
||||
manifests,
|
||||
}:
|
||||
let
|
||||
inherit (lib.customisation) callPackagesWith;
|
||||
inherit (lib.filesystem) packagesFromDirectoryRecursive;
|
||||
inherit (lib.fixedPoints) composeManyExtensions extends;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.strings) versionAtLeast versionOlder;
|
||||
inherit (lib.versions) major majorMinor;
|
||||
inherit (_cuda.lib)
|
||||
dropDots
|
||||
formatCapabilities
|
||||
mkVersionedName
|
||||
;
|
||||
|
||||
# NOTE: This value is considered an implementation detail and should not be exposed in the attribute set.
|
||||
cudaMajorMinorPatchVersion = manifests.cuda.release_label;
|
||||
cudaMajorMinorVersion = majorMinor cudaMajorMinorPatchVersion;
|
||||
cudaMajorVersion = major cudaMajorMinorPatchVersion;
|
||||
|
||||
cudaPackagesMajorMinorVersionedName = mkVersionedName "cudaPackages" cudaMajorMinorVersion;
|
||||
|
||||
# We must use an instance of Nixpkgs where the CUDA package set we're building is the default; if we do not, members
|
||||
# of the versioned, non-default package sets may rely on (transitively) members of the default, unversioned CUDA
|
||||
# package set.
|
||||
# See `Using cudaPackages.pkgs` in doc/languages-frameworks/cuda.section.md for more information.
|
||||
pkgs' =
|
||||
let
|
||||
cudaPackagesUnversionedName = "cudaPackages";
|
||||
cudaPackagesMajorVersionedName = mkVersionedName cudaPackagesUnversionedName cudaMajorVersion;
|
||||
in
|
||||
pkgs.extend (
|
||||
final: _: {
|
||||
recurseForDerivations = false;
|
||||
# The CUDA package set will be available as cudaPackages_x_y, so we need only update the aliases for the
|
||||
# minor-versioned and unversioned package sets.
|
||||
# cudaPackages_x = cudaPackages_x_y
|
||||
${cudaPackagesMajorVersionedName} = final.${cudaPackagesMajorMinorVersionedName};
|
||||
# cudaPackages = cudaPackages_x
|
||||
${cudaPackagesUnversionedName} = final.${cudaPackagesMajorVersionedName};
|
||||
}
|
||||
);
|
||||
|
||||
cudaPackagesFixedPoint =
|
||||
finalCudaPackages:
|
||||
{
|
||||
# NOTE:
|
||||
# It is important that _cuda is not part of the package set fixed-point. As described by
|
||||
# @SomeoneSerge:
|
||||
# > The layering should be: configuration -> (identifies/is part of) cudaPackages -> (is built using) cudaLib.
|
||||
# > No arrows should point in the reverse directions.
|
||||
# That is to say that cudaLib should only know about package sets and configurations, because it implements
|
||||
# functionality for interpreting configurations, resolving them against data, and constructing package sets.
|
||||
# This decision is driven both by a separation of concerns and by "NAMESET STRICTNESS" (see above).
|
||||
# Also see the comment in `pkgs/top-level/all-packages.nix` about the `_cuda` attribute.
|
||||
|
||||
inherit
|
||||
cudaMajorMinorPatchVersion
|
||||
cudaMajorMinorVersion
|
||||
cudaMajorVersion
|
||||
;
|
||||
|
||||
pkgs = pkgs';
|
||||
|
||||
# Core
|
||||
callPackages = callPackagesWith (pkgs' // finalCudaPackages);
|
||||
|
||||
cudaNamePrefix = "cuda${cudaMajorMinorVersion}";
|
||||
|
||||
cudaOlder = versionOlder cudaMajorMinorVersion;
|
||||
cudaAtLeast = versionAtLeast cudaMajorMinorVersion;
|
||||
|
||||
# These must be modified through callPackage, not by overriding the scope, since we cannot
|
||||
# depend on them recursively as they are used to add top-level attributes.
|
||||
inherit manifests;
|
||||
|
||||
# Create backendStdenv variants for different host compilers, since users may want to build a CUDA project with
|
||||
# Clang or GCC specifically.
|
||||
# TODO(@connorbaker): Because of the way our setup hooks and patching of NVCC works, the user's choice of
|
||||
# backendStdenv is largely disregarded or will cause build failures; fixing this would require the setup hooks
|
||||
# and patching to be made aware of the current environment (perhaps by reading certain environment variables set
|
||||
# by our backendStdenv).
|
||||
# backendClangStdenv = finalCudaPackages.callPackage ./packages/backendStdenv.nix {
|
||||
# stdenv = pkgs'.clangStdenv;
|
||||
# };
|
||||
# backendGccStdenv = finalCudaPackages.callPackage ./packages/backendStdenv.nix {
|
||||
# stdenv = pkgs'.gccStdenv;
|
||||
# };
|
||||
|
||||
# Must be constructed without `callPackage` to avoid replacing the `override` attribute with that of
|
||||
# `callPackage`'s.
|
||||
buildRedist = import ./buildRedist {
|
||||
inherit (pkgs)
|
||||
_cuda
|
||||
autoAddDriverRunpath
|
||||
autoPatchelfHook
|
||||
config
|
||||
fetchurl
|
||||
lib
|
||||
srcOnly
|
||||
stdenv
|
||||
;
|
||||
inherit (finalCudaPackages)
|
||||
autoAddCudaCompatRunpath
|
||||
backendStdenv
|
||||
cudaMajorMinorVersion
|
||||
cudaMajorVersion
|
||||
cudaNamePrefix
|
||||
flags
|
||||
manifests
|
||||
markForCudatoolkitRootHook
|
||||
setupCudaHook
|
||||
;
|
||||
};
|
||||
|
||||
flags =
|
||||
formatCapabilities {
|
||||
inherit (finalCudaPackages.backendStdenv) cudaCapabilities cudaForwardCompat;
|
||||
inherit (_cuda.db) cudaCapabilityToInfo;
|
||||
}
|
||||
# TODO(@connorbaker): Enable the corresponding warnings in `./aliases.nix` after some
|
||||
# time to allow users to migrate to cudaLib and backendStdenv.
|
||||
// {
|
||||
inherit dropDots;
|
||||
cudaComputeCapabilityToName =
|
||||
cudaCapability: _cuda.db.cudaCapabilityToInfo.${cudaCapability}.archName;
|
||||
dropDot = dropDots;
|
||||
isJetsonBuild = finalCudaPackages.backendStdenv.hasJetsonCudaCapability;
|
||||
};
|
||||
}
|
||||
// packagesFromDirectoryRecursive {
|
||||
inherit (finalCudaPackages) callPackage;
|
||||
directory = ./packages;
|
||||
};
|
||||
|
||||
composedExtensions = composeManyExtensions (
|
||||
optionals config.allowAliases [
|
||||
(import ./aliases.nix { inherit lib; })
|
||||
]
|
||||
++ _cuda.extensions
|
||||
);
|
||||
in
|
||||
pkgs'.makeScopeWithSplicing' {
|
||||
otherSplices = pkgs'.generateSplicesForMkScope [ cudaPackagesMajorMinorVersionedName ];
|
||||
f = extends composedExtensions cudaPackagesFixedPoint;
|
||||
}
|
||||
19
pkgs/development/cuda-modules/packages/README.md
Normal file
19
pkgs/development/cuda-modules/packages/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# packages
|
||||
|
||||
Packages which are not created by the redistributable builder.
|
||||
|
||||
## Conventions
|
||||
|
||||
- All new packages should include the following lines as part of their arguments to `stdenv.mkDerivation`:
|
||||
|
||||
```nix
|
||||
finalAttrs: {
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
# NOTE: Depends on the CUDA package set, so use cudaNamePrefix.
|
||||
name = "${cudaNamePrefix}-${finalAttrs.pname}-${finalAttrs.version}";
|
||||
}
|
||||
```
|
||||
|
||||
If the package does not require elements of the package set, then the `cudaNamePrefix` must be omitted: changing the name of a derivation yields a different hash and store path, so we would end up with multiple different store paths with the same content.
|
||||
@@ -6,8 +6,8 @@
|
||||
# E.g. for cudaPackages_12_9 we use gcc14 with gcc's libstdc++
|
||||
# Cf. https://github.com/NixOS/nixpkgs/pull/218265 for context
|
||||
{
|
||||
config,
|
||||
_cuda,
|
||||
config,
|
||||
cudaMajorMinorVersion,
|
||||
lib,
|
||||
pkgs,
|
||||
@@ -15,7 +15,11 @@
|
||||
stdenvAdapters,
|
||||
}:
|
||||
let
|
||||
inherit (builtins) toJSON;
|
||||
inherit (builtins)
|
||||
throw
|
||||
toJSON
|
||||
toString
|
||||
;
|
||||
inherit (_cuda.db) allSortedCudaCapabilities cudaCapabilityToInfo nvccCompatibilities;
|
||||
inherit (_cuda.lib)
|
||||
_cudaCapabilityIsDefault
|
||||
@@ -24,9 +28,21 @@ let
|
||||
getRedistSystem
|
||||
mkVersionedName
|
||||
;
|
||||
inherit (lib) addErrorContext;
|
||||
inherit (lib.customisation) extendDerivation;
|
||||
inherit (lib.lists) filter intersectLists subtractLists;
|
||||
inherit (lib)
|
||||
addErrorContext
|
||||
assertMsg
|
||||
extendDerivation
|
||||
filter
|
||||
findFirst
|
||||
intersectLists
|
||||
pipe
|
||||
range
|
||||
reverseList
|
||||
subtractLists
|
||||
toIntBase10
|
||||
versionAtLeast
|
||||
;
|
||||
inherit (lib.versions) major;
|
||||
|
||||
# NOTE: By virtue of processing a sorted list (allSortedCudaCapabilities), our groups will be sorted.
|
||||
|
||||
@@ -45,6 +61,9 @@ let
|
||||
passthruExtra = {
|
||||
nvccHostCCMatchesStdenvCC = backendStdenv.cc == stdenv.cc;
|
||||
|
||||
# TODO(@connorbaker): Does it make sense to expose the `stdenv` we were called with and the `stdenv` selected
|
||||
# prior to using `stdenvAdapters.useLibsFrom`?
|
||||
|
||||
# The Nix system of the host platform.
|
||||
hostNixSystem = stdenv.hostPlatform.system;
|
||||
|
||||
@@ -146,9 +165,78 @@ let
|
||||
_evaluateAssertions assertions
|
||||
);
|
||||
|
||||
# TODO(@connorbaker): Seems like `stdenvAdapters.useLibsFrom` breaks clangStdenv's ability to find header files.
|
||||
# To reproduce: use `nix shell .#cudaPackages_12_6.backendClangStdenv.cc` since CUDA 12.6 supports at most Clang
|
||||
# 18, but the current stdenv uses Clang 19, requiring this code path.
|
||||
# With:
|
||||
#
|
||||
# ```cpp
|
||||
# #include <cmath>
|
||||
#
|
||||
# int main() {
|
||||
# double value = 0.5;
|
||||
# double result = std::sin(value);
|
||||
# return 0;
|
||||
# }
|
||||
# ```
|
||||
#
|
||||
# we get:
|
||||
#
|
||||
# ```console
|
||||
# $ clang++ ./main.cpp
|
||||
# ./main.cpp:1:10: fatal error: 'cmath' file not found
|
||||
# 1 | #include <cmath>
|
||||
# | ^~~~~~~
|
||||
# 1 error generated.
|
||||
# ```
|
||||
# TODO(@connorbaker): Seems like even using unmodified `clangStdenv` causes issues -- saxpy fails to build CMake
|
||||
# errors during CUDA compiler identification about invalid redefinitions of things like `realpath`.
|
||||
backendStdenv =
|
||||
stdenvAdapters.useLibsFrom stdenv
|
||||
pkgs."gcc${nvccCompatibilities.${cudaMajorMinorVersion}.gcc.maxMajorVersion}Stdenv";
|
||||
let
|
||||
hostCCName =
|
||||
if stdenv.cc.isGNU then
|
||||
"gcc"
|
||||
else if stdenv.cc.isClang then
|
||||
"clang"
|
||||
else
|
||||
throw "cudaPackages.backendStdenv: unsupported host compiler: ${stdenv.cc.name}";
|
||||
|
||||
versions = nvccCompatibilities.${cudaMajorMinorVersion}.${hostCCName};
|
||||
|
||||
stdenvIsSupportedVersion =
|
||||
versionAtLeast (major stdenv.cc.version) versions.minMajorVersion
|
||||
&& versionAtLeast versions.maxMajorVersion (major stdenv.cc.version);
|
||||
|
||||
maybeGetVersionedCC =
|
||||
if hostCCName == "gcc" then
|
||||
version: pkgs."gcc${version}Stdenv" or null
|
||||
else
|
||||
version: pkgs."llvmPackages_${version}".stdenv or null;
|
||||
|
||||
maybeHostStdenv =
|
||||
pipe (range (toIntBase10 versions.minMajorVersion) (toIntBase10 versions.maxMajorVersion))
|
||||
[
|
||||
# Convert integers to strings.
|
||||
(map toString)
|
||||
# Prefer the highest available version.
|
||||
reverseList
|
||||
# Map to the actual stdenvs or null if unavailable.
|
||||
(map maybeGetVersionedCC)
|
||||
# Get the first available version.
|
||||
(findFirst (x: x != null) null)
|
||||
];
|
||||
in
|
||||
# If the current stdenv's compiler version is compatible, or we're on an unsupported host system, use stdenv
|
||||
# directly.
|
||||
# If we're on an unsupported host system (like darwin), there's not much else we can do, but we should not break
|
||||
# evaluation on unsupported systems.
|
||||
if stdenvIsSupportedVersion || passthruExtra.hostRedistSystem == "unsupported" then
|
||||
stdenv
|
||||
# Otherwise, try to find a compatible stdenv.
|
||||
else
|
||||
assert assertMsg (maybeHostStdenv != null)
|
||||
"backendStdenv: no supported host compiler found (tried ${hostCCName} ${versions.minMajorVersion} to ${versions.maxMajorVersion})";
|
||||
stdenvAdapters.useLibsFrom stdenv maybeHostStdenv;
|
||||
in
|
||||
# TODO: Consider testing whether we in fact use the newer libstdc++
|
||||
extendDerivation assertCondition passthruExtra backendStdenv
|
||||
|
||||
220
pkgs/development/cuda-modules/packages/cuda-samples.nix
Normal file
220
pkgs/development/cuda-modules/packages/cuda-samples.nix
Normal file
@@ -0,0 +1,220 @@
|
||||
{
|
||||
backendStdenv,
|
||||
_cuda,
|
||||
cmake,
|
||||
cuda_cccl,
|
||||
cuda_cudart,
|
||||
cuda_nvcc,
|
||||
cuda_nvrtc,
|
||||
cuda_nvtx,
|
||||
cuda_profiler_api,
|
||||
cudaAtLeast,
|
||||
cudaNamePrefix,
|
||||
cudaOlder,
|
||||
fetchFromGitHub,
|
||||
flags,
|
||||
lib,
|
||||
libcublas,
|
||||
libcufft,
|
||||
libcurand,
|
||||
libcusolver,
|
||||
libcusparse,
|
||||
libnpp,
|
||||
libnvjitlink,
|
||||
libnvjpeg,
|
||||
}:
|
||||
backendStdenv.mkDerivation (finalAttrs: {
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
name = "${cudaNamePrefix}-${finalAttrs.pname}-${finalAttrs.version}";
|
||||
pname = "cuda-samples";
|
||||
version = "12.8";
|
||||
|
||||
# We should be able to use samples from the latest version of CUDA
|
||||
# on most of the CUDA package sets we have.
|
||||
# Plus, 12.8 and later are rewritten to use CMake which makes it much, much easier to build.
|
||||
src = fetchFromGitHub {
|
||||
owner = "NVIDIA";
|
||||
repo = "cuda-samples";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-Ba0Fi0v/sQ+1iJ4mslgyIAE+oK5KO0lMoTQCC91vpiA=";
|
||||
};
|
||||
|
||||
prePatch =
|
||||
# https://github.com/NVIDIA/cuda-samples/issues/333
|
||||
''
|
||||
nixLog "removing sample 0_Introduction/UnifiedMemoryStreams which requires OpenMP support for CUDA"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/0_Introduction/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
'add_subdirectory(UnifiedMemoryStreams)' \
|
||||
'# add_subdirectory(UnifiedMemoryStreams)'
|
||||
''
|
||||
# This sample tries to use a relative path, which doesn't work for our splayed installation.
|
||||
+ ''
|
||||
nixLog "patching sample 0_Introduction/matrixMul_nvrtc"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
"\''${CUDAToolkit_BIN_DIR}/../include/cooperative_groups" \
|
||||
"${lib.getOutput "include" cuda_cudart}/include/cooperative_groups" \
|
||||
--replace-fail \
|
||||
"\''${CUDAToolkit_BIN_DIR}/../include/nv" \
|
||||
"${lib.getOutput "include" cuda_cccl}/include/nv" \
|
||||
--replace-fail \
|
||||
"\''${CUDAToolkit_BIN_DIR}/../include/cuda" \
|
||||
"${lib.getOutput "include" cuda_cccl}/include/cuda"
|
||||
''
|
||||
# These three samples give undefined references, like
|
||||
# nvlink error : Undefined reference to '__cudaCDP2Free' in 'CMakeFiles/cdpBezierTessellation.dir/BezierLineCDP.cu.o'
|
||||
# nvlink error : Undefined reference to '__cudaCDP2Malloc' in 'CMakeFiles/cdpBezierTessellation.dir/BezierLineCDP.cu.o'
|
||||
# nvlink error : Undefined reference to '__cudaCDP2GetParameterBufferV2' in 'CMakeFiles/cdpBezierTessellation.dir/BezierLineCDP.cu.o'
|
||||
# nvlink error : Undefined reference to '__cudaCDP2LaunchDeviceV2' in 'CMakeFiles/cdpBezierTessellation.dir/BezierLineCDP.cu.o'
|
||||
+ ''
|
||||
for sample in cdp{AdvancedQuicksort,BezierTessellation,Quadtree,SimplePrint,SimpleQuicksort}; do
|
||||
nixLog "removing sample 3_CUDA_Features/$sample which fails to link"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/3_CUDA_Features/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
"add_subdirectory($sample)" \
|
||||
"# add_subdirectory($sample)"
|
||||
done
|
||||
unset -v sample
|
||||
''
|
||||
+ lib.optionalString (cudaOlder "12.4") ''
|
||||
nixLog "removing sample 3_CUDA_Features/graphConditionalNodes which requires at least CUDA 12.4"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/3_CUDA_Features/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
"add_subdirectory(graphConditionalNodes)" \
|
||||
"# add_subdirectory(graphConditionalNodes)"
|
||||
''
|
||||
# For some reason this sample requires a static library, which we don't propagate by default due to size.
|
||||
+ ''
|
||||
nixLog "patching sample 4_CUDA_Libraries/simpleCUFFT_callback to use dynamic library"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/4_CUDA_Libraries/simpleCUFFT_callback/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
'CUDA::cufft_static' \
|
||||
'CUDA::cufft'
|
||||
''
|
||||
# Patch to use the correct path to libnvJitLink.so, or disable the sample if older than 12.4.
|
||||
+ lib.optionalString (cudaOlder "12.4") ''
|
||||
nixLog "removing sample 4_CUDA_Libraries/jitLto which requires at least CUDA 12.4"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/4_CUDA_Libraries/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
"add_subdirectory(jitLto)" \
|
||||
"# add_subdirectory(jitLto)"
|
||||
''
|
||||
+ lib.optionalString (cudaAtLeast "12.4") ''
|
||||
nixLog "patching sample 4_CUDA_Libraries/jitLto to use correct path to libnvJitLink.so"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/4_CUDA_Libraries/jitLto/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
"\''${CUDAToolkit_LIBRARY_DIR}/libnvJitLink.so" \
|
||||
"${lib.getLib libnvjitlink}/lib/libnvJitLink.so"
|
||||
''
|
||||
# /build/NVIDIA-cuda-samples-v12.8/Samples/4_CUDA_Libraries/watershedSegmentationNPP/watershedSegmentationNPP.cpp:272:80: error: cannot convert 'size_t*' {aka 'long unsigned int*'} to 'int*'
|
||||
# 272 | nppStatus = nppiSegmentWatershedGetBufferSize_8u_C1R(oSizeROI[nImage], &aSegmentationScratchBufferSize[nImage]);
|
||||
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# | |
|
||||
# | size_t* {aka long unsigned int*}
|
||||
+ lib.optionalString (cudaOlder "12.8") ''
|
||||
nixLog "removing sample 4_CUDA_Libraries/watershedSegmentationNPP which requires at least CUDA 12.8"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/4_CUDA_Libraries/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
"add_subdirectory(watershedSegmentationNPP)" \
|
||||
"# add_subdirectory(watershedSegmentationNPP)"
|
||||
''
|
||||
# NVVM samples require a specific build of LLVM, which is a hassle.
|
||||
+ ''
|
||||
nixLog "removing samples 7_libNVVM which require a specific build of LLVM"
|
||||
substituteInPlace \
|
||||
"$NIX_BUILD_TOP/$sourceRoot/Samples/CMakeLists.txt" \
|
||||
--replace-fail \
|
||||
'add_subdirectory(7_libNVVM)' \
|
||||
'# add_subdirectory(7_libNVVM)'
|
||||
''
|
||||
# Don't use hard-coded CUDA architectures
|
||||
+ ''
|
||||
nixLog "patching CMakeLists.txt to use provided CUDA architectures"
|
||||
local path=""
|
||||
while IFS= read -r -d $'\0' path; do
|
||||
nixLog "removing CMAKE_CUDA_ARCHITECTURES declaration from $path"
|
||||
substituteInPlace \
|
||||
"$path" \
|
||||
--replace-fail \
|
||||
'set(CMAKE_CUDA_ARCHITECTURES' \
|
||||
'# set(CMAKE_CUDA_ARCHITECTURES'
|
||||
done < <(grep --files-with-matches --null "set(CMAKE_CUDA_ARCHITECTURES" --recursive "$NIX_BUILD_TOP/$sourceRoot")
|
||||
unset -v path
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
cuda_nvcc
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
cuda_cccl
|
||||
cuda_cudart
|
||||
cuda_nvrtc
|
||||
cuda_nvtx
|
||||
cuda_profiler_api
|
||||
libcublas
|
||||
libcufft
|
||||
libcurand
|
||||
libcusolver
|
||||
libcusparse
|
||||
libnpp
|
||||
libnvjitlink
|
||||
libnvjpeg
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" flags.cmakeCudaArchitecturesString)
|
||||
(lib.cmakeBool "BUILD_TEGRA" backendStdenv.hasJetsonCudaCapability)
|
||||
];
|
||||
|
||||
# TODO(@connorbaker):
|
||||
# For some reason, using the combined find command doesn't delete directories:
|
||||
# find "$PWD/Samples" \
|
||||
# \( -type d -name CMakeFiles \) \
|
||||
# -o \( -type f -name cmake_install.cmake \) \
|
||||
# -o \( -type f -name Makefile \) \
|
||||
# -exec rm -rf {} +
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
pushd "$NIX_BUILD_TOP/$sourceRoot/''${cmakeBuildDir:?}" >/dev/null
|
||||
|
||||
nixLog "deleting CMake related files"
|
||||
|
||||
find "$PWD/Samples" -type d -name CMakeFiles -exec rm -rf {} +
|
||||
find "$PWD/Samples" -type f -name cmake_install.cmake -exec rm -rf {} +
|
||||
find "$PWD/Samples" -type f -name Makefile -exec rm -rf {} +
|
||||
|
||||
nixLog "copying $PWD/Samples to $out/"
|
||||
mkdir -p "$out"
|
||||
cp -rv "$PWD/Samples"/* "$out/"
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Samples for CUDA Developers which demonstrates features in CUDA Toolkit";
|
||||
homepage = "https://github.com/NVIDIA/cuda-samples";
|
||||
license = lib.licenses.nvidiaCuda;
|
||||
platforms = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
];
|
||||
maintainers = [ lib.maintainers.connorbaker ];
|
||||
teams = [ lib.teams.cuda ];
|
||||
};
|
||||
})
|
||||
34
pkgs/development/cuda-modules/packages/cuda_cccl.nix
Normal file
34
pkgs/development/cuda-modules/packages/cuda_cccl.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
buildRedist,
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_cccl";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
];
|
||||
|
||||
prePatch = lib.optionalString (cudaAtLeast "13.0") ''
|
||||
nixLog "removing top-level $PWD/include/nv directory"
|
||||
rm -rfv "$PWD/include/nv"
|
||||
nixLog "un-nesting top-level $PWD/include/cccl directory"
|
||||
mv -v "$PWD/include/cccl"/* "$PWD/include/"
|
||||
nixLog "removing empty $PWD/include/cccl directory"
|
||||
rmdir -v "$PWD/include/cccl"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Building blocks that make it easier to write safe and efficient CUDA C++ code";
|
||||
longDescription = ''
|
||||
The goal of CCCL is to provide CUDA C++ developers with building blocks that make it easier to write safe and
|
||||
efficient code.
|
||||
'';
|
||||
homepage = "https://github.com/NVIDIA/cccl";
|
||||
changelog = "https://github.com/NVIDIA/cccl/releases";
|
||||
};
|
||||
}
|
||||
20
pkgs/development/cuda-modules/packages/cuda_compat.nix
Normal file
20
pkgs/development/cuda-modules/packages/cuda_compat.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_compat";
|
||||
|
||||
# NOTE: Using multiple outputs with symlinks causes build cycles.
|
||||
# To avoid that (and troubleshooting why), we just use a single output.
|
||||
outputs = [ "out" ];
|
||||
|
||||
autoPatchelfIgnoreMissingDeps = [
|
||||
"libnvrm_gpu.so"
|
||||
"libnvrm_mem.so"
|
||||
"libnvdla_runtime.so"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Provides minor version forward compatibility for the CUDA runtime";
|
||||
homepage = "https://docs.nvidia.com/deploy/cuda-compatibility";
|
||||
};
|
||||
}
|
||||
27
pkgs/development/cuda-modules/packages/cuda_crt.nix
Normal file
27
pkgs/development/cuda-modules/packages/cuda_crt.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ backendStdenv, buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_crt";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
brokenAssertions = [
|
||||
# TODO(@connorbaker): Build fails on x86 when using pkgsLLVM.
|
||||
# .../include/crt/host_defines.h:67:2:
|
||||
# error: "libc++ is not supported on x86 system"
|
||||
#
|
||||
# 67 | #error "libc++ is not supported on x86 system"
|
||||
# | ^
|
||||
#
|
||||
# 1 error generated.
|
||||
#
|
||||
# # --error 0x1 --
|
||||
{
|
||||
message = "cannot use libc++ on x86_64-linux";
|
||||
assertion = backendStdenv.hostNixSystem == "x86_64-linux" -> backendStdenv.cc.libcxx == null;
|
||||
}
|
||||
];
|
||||
|
||||
# There's a comment with a reference to /usr
|
||||
allowFHSReferences = true;
|
||||
}
|
||||
98
pkgs/development/cuda-modules/packages/cuda_cudart.nix
Normal file
98
pkgs/development/cuda-modules/packages/cuda_cudart.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
# TODO(@connorbaker): cuda_cudart.dev depends on crt/host_config.h, which is from
|
||||
# (getDev cuda_nvcc). It would be nice to be able to encode that.
|
||||
{
|
||||
_cuda,
|
||||
addDriverRunpath,
|
||||
backendStdenv,
|
||||
buildRedist,
|
||||
cuda_cccl,
|
||||
cuda_compat,
|
||||
cuda_crt,
|
||||
cuda_nvcc,
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_cudart";
|
||||
|
||||
# NOTE: A number of packages expect cuda_cudart to be in a single directory.
|
||||
# NOTE: CMake expects the static libraries to exist alongside the dynamic libraries,
|
||||
# so we may need to revisit whether we have a static output at all.
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
propagatedBuildOutputs = [
|
||||
"static" # required by CMake
|
||||
"stubs" # always propagate, even when cuda_compat is used, to avoid symbol linking errors
|
||||
];
|
||||
|
||||
# When cuda_compat is available, propagate it.
|
||||
# NOTE: `cuda_compat` can be disabled by setting the package to `null`. This is useful in cases where
|
||||
# the host OS has a recent enough CUDA driver that the compatibility library isn't needed.
|
||||
propagatedBuildInputs =
|
||||
# Add the dependency on NVCC's include directory.
|
||||
# - crt/host_config.h
|
||||
# TODO(@connorbaker): Check that the dependency offset for this is correct.
|
||||
[ (lib.getOutput "include" cuda_nvcc) ]
|
||||
# TODO(@connorbaker): From CUDA 13.0, crt/host_config.h is in cuda_crt
|
||||
++ lib.optionals (cudaAtLeast "13.0") [ (lib.getOutput "include" cuda_crt) ]
|
||||
# Add the dependency on CCCL's include directory.
|
||||
# - nv/target
|
||||
# TODO(@connorbaker): Check that the dependency offset for this is correct.
|
||||
++ [ (lib.getOutput "include" cuda_cccl) ]
|
||||
++ lib.optionals (backendStdenv.hasJetsonCudaCapability && cuda_compat != null) [
|
||||
cuda_compat
|
||||
];
|
||||
|
||||
allowFHSReferences = false;
|
||||
|
||||
# Patch the `cudart` package config files so they reference lib
|
||||
postPatch = ''
|
||||
local path=""
|
||||
while IFS= read -r -d $'\0' path; do
|
||||
nixLog "patching $path"
|
||||
sed -i \
|
||||
-e "s|^cudaroot\s*=.*\$||" \
|
||||
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
||||
"$path"
|
||||
done < <(find -iname 'cudart-*.pc' -print0)
|
||||
unset -v path
|
||||
''
|
||||
# Patch the `cuda` package config files so they reference stubs
|
||||
# TODO: Will this always pull in the stubs output and cause its setup hook to be executed?
|
||||
+ ''
|
||||
local path=""
|
||||
while IFS= read -r -d $'\0' path; do
|
||||
nixLog "patching $path"
|
||||
sed -i \
|
||||
-e "s|^cudaroot\s*=.*\$||" \
|
||||
-e "s|^libdir\s*=.*/lib\$|libdir=''${!outputStubs:?}/lib/stubs|" \
|
||||
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
||||
"$path"
|
||||
done < <(find -iname 'cuda-*.pc' -print0)
|
||||
unset -v path
|
||||
'';
|
||||
|
||||
# Namelink may not be enough, add a soname.
|
||||
# Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/25536
|
||||
# NOTE: Relative symlinks is fine since this is all within the same output.
|
||||
postInstall = ''
|
||||
pushd "''${!outputStubs:?}/lib/stubs" >/dev/null
|
||||
if [[ -f libcuda.so && ! -f libcuda.so.1 ]]; then
|
||||
nixLog "creating versioned symlink for libcuda.so stub"
|
||||
ln -srv libcuda.so libcuda.so.1
|
||||
fi
|
||||
nixLog "creating symlinks for stubs in lib directory"
|
||||
ln -srvt "''${!outputStubs:?}/lib/" *.so *.so.*
|
||||
popd >/dev/null
|
||||
'';
|
||||
|
||||
meta.description = "CUDA Runtime";
|
||||
}
|
||||
17
pkgs/development/cuda-modules/packages/cuda_cuobjdump.nix
Normal file
17
pkgs/development/cuda-modules/packages/cuda_cuobjdump.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_cuobjdump";
|
||||
outputs = [ "out" ];
|
||||
|
||||
meta = {
|
||||
description = "Extracts information from CUDA binary files (both standalone and those embedded in host binaries) and presents them in human readable format";
|
||||
longDescription = ''
|
||||
`cuobjdump` extracts information from CUDA binary files (both standalone and those embedded in host binaries)
|
||||
and presents them in human readable format. The output of cuobjdump includes CUDA assembly code for each kernel,
|
||||
CUDA ELF section headers, string tables, relocators and other CUDA specific sections. It also extracts embedded
|
||||
ptx text from host binaries.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/cuda-binary-utilities#cuobjdump";
|
||||
};
|
||||
}
|
||||
30
pkgs/development/cuda-modules/packages/cuda_cupti.nix
Normal file
30
pkgs/development/cuda-modules/packages/cuda_cupti.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
backendStdenv,
|
||||
buildRedist,
|
||||
lib,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_cupti";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"samples"
|
||||
]
|
||||
++ lib.optionals (backendStdenv.hostNixSystem == "x86_64-linux") [ "static" ];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = {
|
||||
description = "C-based interface for creating profiling and tracing tools designed for CUDA applications";
|
||||
longDescription = ''
|
||||
The CUDA Profiling Tools Interface (CUPTI) provides a C-based interface for creating profiling and tracing tools
|
||||
designed for CUDA applications.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cupti";
|
||||
changelog = "https://docs.nvidia.com/cupti/release-notes/release-notes.html";
|
||||
};
|
||||
}
|
||||
21
pkgs/development/cuda-modules/packages/cuda_cuxxfilt.nix
Normal file
21
pkgs/development/cuda-modules/packages/cuda_cuxxfilt.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_cuxxfilt";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"bin"
|
||||
"dev"
|
||||
"include"
|
||||
"static"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Decode low-level identifiers that have been mangled by CUDA C++ into user readable names";
|
||||
longDescription = ''
|
||||
cu++filt decodes (demangles) low-level identifiers that have been mangled by CUDA C++ into user readable names.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/cuda-binary-utilities#cu-filt";
|
||||
};
|
||||
}
|
||||
33
pkgs/development/cuda-modules/packages/cuda_demo_suite.nix
Normal file
33
pkgs/development/cuda-modules/packages/cuda_demo_suite.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
buildRedist,
|
||||
libcufft,
|
||||
libcurand,
|
||||
libGLU,
|
||||
libglut,
|
||||
libglvnd,
|
||||
mesa,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_demo_suite";
|
||||
|
||||
buildInputs = [
|
||||
libcufft
|
||||
libcurand
|
||||
libGLU
|
||||
libglut
|
||||
libglvnd
|
||||
mesa
|
||||
];
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
meta = {
|
||||
description = "Pre-built applications which use CUDA";
|
||||
longDescription = ''
|
||||
The CUDA Demo Suite contains pre-built applications which use CUDA. These applications demonstrate the
|
||||
capabilities and details of NVIDIA GPUs.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/demo-suite";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_documentation";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = {
|
||||
homepage = "https://docs.nvidia.com/cuda";
|
||||
changelog = "https://docs.nvidia.com/cuda/cuda-toolkit-release-notes";
|
||||
};
|
||||
}
|
||||
71
pkgs/development/cuda-modules/packages/cuda_gdb.nix
Normal file
71
pkgs/development/cuda-modules/packages/cuda_gdb.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
backendStdenv,
|
||||
buildRedist,
|
||||
cudaAtLeast,
|
||||
expat,
|
||||
gmp,
|
||||
lib,
|
||||
libxcrypt-legacy,
|
||||
ncurses,
|
||||
python3,
|
||||
}:
|
||||
let
|
||||
python3MajorMinorVersion = lib.versions.majorMinor python3.version;
|
||||
in
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_gdb";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"bin"
|
||||
];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
buildInputs = [
|
||||
gmp
|
||||
]
|
||||
# aarch64, sbsa needs expat
|
||||
++ lib.optionals backendStdenv.hostPlatform.isAarch64 [ expat ]
|
||||
# From 12.5, cuda-gdb comes with Python TUI wrappers
|
||||
++ lib.optionals (cudaAtLeast "12.5") [
|
||||
libxcrypt-legacy
|
||||
ncurses
|
||||
python3
|
||||
];
|
||||
|
||||
# Remove binaries requiring Python3 versions we do not have
|
||||
postInstall = lib.optionalString (cudaAtLeast "12.5") ''
|
||||
pushd "''${!outputBin}/bin" >/dev/null
|
||||
nixLog "removing cuda-gdb-python*-tui binaries for Python 3 versions other than ${python3MajorMinorVersion}"
|
||||
for pygdb in cuda-gdb-python*-tui; do
|
||||
if [[ "$pygdb" == "cuda-gdb-python${python3MajorMinorVersion}-tui" ]]; then
|
||||
continue
|
||||
fi
|
||||
nixLog "removing $pygdb"
|
||||
rm -rf "$pygdb"
|
||||
done
|
||||
unset -v pygdb
|
||||
popd >/dev/null
|
||||
'';
|
||||
|
||||
brokenAssertions = [
|
||||
{
|
||||
# TODO(@connorbaker): Figure out which are supported.
|
||||
message = "python 3 version is supported";
|
||||
assertion = true;
|
||||
}
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "NVIDIA tool for debugging CUDA applications on Linux and QNX systems";
|
||||
longDescription = ''
|
||||
CUDA-GDB is the NVIDIA tool for debugging CUDA applications running on Linux and QNX. CUDA-GDB is an extension
|
||||
to GDB, the GNU Project debugger. The tool provides developers with a mechanism for debugging CUDA
|
||||
applications running on actual hardware.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/cuda-gdb";
|
||||
changelog = "https://docs.nvidia.com/cuda/cuda-gdb#release-notes";
|
||||
};
|
||||
}
|
||||
19
pkgs/development/cuda-modules/packages/cuda_nsight.nix
Normal file
19
pkgs/development/cuda-modules/packages/cuda_nsight.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nsight";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = {
|
||||
description = "Nsight Eclipse Plugins Edition";
|
||||
longDescription = ''
|
||||
NVIDIA Nsight Eclipse Edition is a unified CPU plus GPU integrated development environment (IDE) for developing
|
||||
CUDA applications on Linux and Mac OS X for the x86, POWER and ARM platforms. It is designed to help developers
|
||||
on all stages of the software development process.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/nsight-eclipse-plugins-guide";
|
||||
};
|
||||
}
|
||||
175
pkgs/development/cuda-modules/packages/cuda_nvcc.nix
Normal file
175
pkgs/development/cuda-modules/packages/cuda_nvcc.nix
Normal file
@@ -0,0 +1,175 @@
|
||||
{
|
||||
_cuda,
|
||||
backendStdenv,
|
||||
buildRedist,
|
||||
cudaAtLeast,
|
||||
cudaOlder,
|
||||
lib,
|
||||
libnvvm,
|
||||
}:
|
||||
buildRedist (finalAttrs: {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvcc";
|
||||
|
||||
# NOTE: May need to restrict cuda_nvcc to a single output to avoid breaking consumers which expect NVCC
|
||||
# to be within a single directory structure. This happens partly because NVCC is also home to NVVM.
|
||||
outputs = [
|
||||
"out"
|
||||
]
|
||||
# CUDA 13.0 has essentially nothing other than binaries.
|
||||
++ lib.optionals (cudaOlder "13.0") [
|
||||
"bin"
|
||||
"dev"
|
||||
"include"
|
||||
"static"
|
||||
];
|
||||
|
||||
# The nvcc and cicc binaries contain hard-coded references to /usr
|
||||
allowFHSReferences = true;
|
||||
|
||||
# Entries here will be in nativeBuildInputs when cuda_nvcc is in nativeBuildInputs
|
||||
propagatedBuildInputs = [ backendStdenv.cc ];
|
||||
|
||||
# Patch the nvcc.profile.
|
||||
# Syntax:
|
||||
# - `=` for assignment,
|
||||
# - `?=` for conditional assignment,
|
||||
# - `+=` to "prepend",
|
||||
# - `=+` to "append".
|
||||
|
||||
# Cf. https://web.archive.org/web/20220912081901/https://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/nvcc.pdf
|
||||
|
||||
# We set all variables with the lowest priority (=+), but we do force
|
||||
# nvcc to use the fixed backend toolchain. Cf. comments in
|
||||
# backend-stdenv.nix
|
||||
|
||||
# As an example, here's the nvcc.profile for CUDA 11.8-12.4 (yes, that is a leading newline):
|
||||
|
||||
#
|
||||
# TOP = $(_HERE_)/..
|
||||
#
|
||||
# NVVMIR_LIBRARY_DIR = $(TOP)/$(_NVVM_BRANCH_)/libdevice
|
||||
#
|
||||
# LD_LIBRARY_PATH += $(TOP)/lib:
|
||||
# PATH += $(TOP)/$(_NVVM_BRANCH_)/bin:$(_HERE_):
|
||||
#
|
||||
# INCLUDES += "-I$(TOP)/$(_TARGET_DIR_)/include" $(_SPACE_)
|
||||
#
|
||||
# LIBRARIES =+ $(_SPACE_) "-L$(TOP)/$(_TARGET_DIR_)/lib$(_TARGET_SIZE_)/stubs" "-L$(TOP)/$(_TARGET_DIR_)/lib$(_TARGET_SIZE_)"
|
||||
#
|
||||
# CUDAFE_FLAGS +=
|
||||
# PTXAS_FLAGS +=
|
||||
|
||||
# And here's the nvcc.profile for CUDA 12.5:
|
||||
|
||||
#
|
||||
# TOP = $(_HERE_)/..
|
||||
#
|
||||
# CICC_PATH = $(TOP)/nvvm/bin
|
||||
# CICC_NEXT_PATH = $(TOP)/nvvm-next/bin
|
||||
# NVVMIR_LIBRARY_DIR = $(TOP)/nvvm/libdevice
|
||||
#
|
||||
# LD_LIBRARY_PATH += $(TOP)/lib:
|
||||
# PATH += $(CICC_PATH):$(_HERE_):
|
||||
#
|
||||
# INCLUDES += "-I$(TOP)/$(_TARGET_DIR_)/include" $(_SPACE_)
|
||||
#
|
||||
# LIBRARIES =+ $(_SPACE_) "-L$(TOP)/$(_TARGET_DIR_)/lib$(_TARGET_SIZE_)/stubs" "-L$(TOP)/$(_TARGET_DIR_)/lib$(_TARGET_SIZE_)"
|
||||
#
|
||||
# CUDAFE_FLAGS +=
|
||||
# PTXAS_FLAGS +=
|
||||
|
||||
postInstall =
|
||||
let
|
||||
# TODO: Should we also patch the LIBRARIES line's use of $(TOP)/$(_TARGET_DIR_)?
|
||||
oldNvvmDir = lib.concatStringsSep "/" (
|
||||
[ "$(TOP)" ]
|
||||
++ lib.optionals (cudaOlder "12.5") [ "$(_NVVM_BRANCH_)" ]
|
||||
++ lib.optionals (cudaAtLeast "12.5") [ "nvvm" ]
|
||||
);
|
||||
newNvvmDir = ''''${!outputBin:?}/nvvm'';
|
||||
in
|
||||
lib.optionalString finalAttrs.finalPackage.meta.available (
|
||||
# From CUDA 13.0, NVVM is available as a separate library and not bundled in the NVCC redist.
|
||||
lib.optionalString (cudaOlder "13.0") ''
|
||||
nixLog "moving $PWD/nvvm to ''${!outputBin:?} and renaming lib64 to lib"
|
||||
moveToOutput "nvvm" "''${!outputBin:?}"
|
||||
mv --verbose --no-clobber "${newNvvmDir}/lib64" "${newNvvmDir}/lib"
|
||||
''
|
||||
# NVVM is unpacked and made top-level; we cannot make a symlink to it because build systems (like CMake)
|
||||
# may take the target and do relative path operations to it.
|
||||
+ lib.optionalString (cudaAtLeast "13.0") ''
|
||||
nixLog "copying ${libnvvm} to ${newNvvmDir} and fixing permissions"
|
||||
cp -rv "${libnvvm}" "${newNvvmDir}"
|
||||
chmod -Rv u+w "${newNvvmDir}"
|
||||
''
|
||||
# Unconditional patching to remove the use of $(_TARGET_SIZE_) since we don't use lib64 in Nixpkgs
|
||||
+ ''
|
||||
nixLog 'removing $(_TARGET_SIZE_) from nvcc.profile'
|
||||
substituteInPlace "''${!outputBin:?}/bin/nvcc.profile" \
|
||||
--replace-fail \
|
||||
'$(_TARGET_SIZE_)' \
|
||||
""
|
||||
''
|
||||
# Unconditional patching to switch to the correct include paths.
|
||||
# NOTE: _TARGET_DIR_ appears to be used for the target architecture, which is relevant for cross-compilation.
|
||||
+ ''
|
||||
nixLog "patching nvcc.profile to use the correct include paths"
|
||||
substituteInPlace "''${!outputBin:?}/bin/nvcc.profile" \
|
||||
--replace-fail \
|
||||
'$(TOP)/$(_TARGET_DIR_)/include' \
|
||||
"''${!outputInclude:?}/include"
|
||||
''
|
||||
# Fixup the nvcc.profile to use the correct paths for NVVM.
|
||||
# NOTE: In our replacement substitution, we use double quotes to allow for variable expansion.
|
||||
# NOTE: We use a trailing slash only on the NVVM directory replacement to prevent partial matches.
|
||||
# + lib.optionalString (cudaOlder "13.0") ''
|
||||
+ ''
|
||||
nixLog "patching nvcc.profile to use the correct NVVM paths"
|
||||
substituteInPlace "''${!outputBin:?}/bin/nvcc.profile" \
|
||||
--replace-fail \
|
||||
'${oldNvvmDir}/' \
|
||||
"${newNvvmDir}/"
|
||||
|
||||
nixLog "adding ${newNvvmDir} to nvcc.profile"
|
||||
cat << EOF >> "''${!outputBin:?}/bin/nvcc.profile"
|
||||
|
||||
# Expose the split-out nvvm
|
||||
LIBRARIES =+ \$(_SPACE_) "-L${newNvvmDir}/lib"
|
||||
INCLUDES =+ \$(_SPACE_) "-I${newNvvmDir}/include"
|
||||
EOF
|
||||
''
|
||||
# Add the dependency on backendStdenv.cc to the nvcc.profile.
|
||||
+ ''
|
||||
nixLog "adding backendStdenv.cc to nvcc.profile"
|
||||
cat << EOF >> "''${!outputBin:?}/bin/nvcc.profile"
|
||||
|
||||
# Fix a compatible backend compiler
|
||||
PATH += "${backendStdenv.cc}/bin":
|
||||
EOF
|
||||
''
|
||||
);
|
||||
|
||||
brokenAssertions = [
|
||||
# TODO(@connorbaker): Build fails on x86 when using pkgsLLVM.
|
||||
# .../include/crt/host_defines.h:67:2:
|
||||
# error: "libc++ is not supported on x86 system"
|
||||
#
|
||||
# 67 | #error "libc++ is not supported on x86 system"
|
||||
# | ^
|
||||
#
|
||||
# 1 error generated.
|
||||
#
|
||||
# # --error 0x1 --
|
||||
{
|
||||
message = "cannot use libc++ on x86_64-linux";
|
||||
assertion = backendStdenv.hostNixSystem == "x86_64-linux" -> backendStdenv.cc.libcxx == null;
|
||||
}
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "CUDA compiler driver";
|
||||
homepage = "https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc";
|
||||
mainProgram = "nvcc";
|
||||
};
|
||||
})
|
||||
18
pkgs/development/cuda-modules/packages/cuda_nvdisasm.nix
Normal file
18
pkgs/development/cuda-modules/packages/cuda_nvdisasm.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvdisasm";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
meta = {
|
||||
description = "Extracts information from standalone cubin files and presents them in human readable format";
|
||||
longDescription = ''
|
||||
`nvdisasm` extracts information from standalone cubin files and presents them in human readable format. The
|
||||
output of `nvdisasm` includes CUDA assembly code for each kernel, listing of ELF data sections and other CUDA
|
||||
specific sections. Output style and options are controlled through `nvdisasm` command-line options. `nvdisasm`
|
||||
also does control flow analysis to annotate jump/branch targets and makes the output easier to read.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/cuda-binary-utilities#nvdisasm";
|
||||
};
|
||||
}
|
||||
47
pkgs/development/cuda-modules/packages/cuda_nvml_dev.nix
Normal file
47
pkgs/development/cuda-modules/packages/cuda_nvml_dev.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ buildRedist, lib }:
|
||||
buildRedist (finalAttrs: {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvml_dev";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
# TODO(@connorbaker): Add a setup hook to the outputStubs output to automatically replace rpath entries
|
||||
# containing the stubs output with the driver link.
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
# Include the stubs output since it provides libnvidia-ml.so.
|
||||
propagatedBuildOutputs = lib.optionals (lib.elem "stubs" finalAttrs.outputs) [ "stubs" ];
|
||||
|
||||
# TODO: Some programs try to link against libnvidia-ml.so.1, so make an alias.
|
||||
# Not sure about the version number though!
|
||||
postInstall = lib.optionalString (lib.elem "stubs" finalAttrs.outputs) ''
|
||||
pushd "''${!outputStubs:?}/lib/stubs" >/dev/null
|
||||
if [[ -f libnvidia-ml.so && ! -f libnvidia-ml.so.1 ]]; then
|
||||
nixLog "creating versioned symlink for libnvidia-ml.so stub"
|
||||
ln -sr libnvidia-ml.so libnvidia-ml.so.1
|
||||
fi
|
||||
if [[ -f libnvidia-ml.a && ! -f libnvidia-ml.a.1 ]]; then
|
||||
nixLog "creating versioned symlink for libnvidia-ml.a stub"
|
||||
ln -sr libnvidia-ml.a libnvidia-ml.a.1
|
||||
fi
|
||||
nixLog "creating symlinks for stubs in lib directory"
|
||||
ln -srt "''${!outputStubs:?}/lib/" *.so *.so.*
|
||||
popd >/dev/null
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "C-based programmatic interface for monitoring and managing various states within Data Center GPUs";
|
||||
longDescription = ''
|
||||
The NVIDIA Management Library (NVML) is a C-based programmatic interface for monitoring and managing various
|
||||
states within Data Center GPUs. It is intended to be a platform for building 3rd party applications, and is also
|
||||
the underlying library for the NVIDIA-supported nvidia-smi tool.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/management-library-nvml";
|
||||
};
|
||||
})
|
||||
36
pkgs/development/cuda-modules/packages/cuda_nvprof.nix
Normal file
36
pkgs/development/cuda-modules/packages/cuda_nvprof.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
buildRedist,
|
||||
cuda_cudart,
|
||||
cuda_cupti,
|
||||
lib,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvprof";
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"bin"
|
||||
"lib"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
(lib.getOutput "stubs" cuda_cudart)
|
||||
cuda_cupti
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Collect and view profiling data from the command-line";
|
||||
longDescription = ''
|
||||
The `nvprof` profiling tool enables you to collect and view profiling data from the command-line. `nvprof`
|
||||
enables the collection of a timeline of CUDA-related activities on both CPU and GPU, including kernel execution,
|
||||
memory transfers, memory set and CUDA API calls and events or metrics for CUDA kernels. Profiling options are
|
||||
provided to `nvprof` through command-line options. Profiling results are displayed in the console after the
|
||||
profiling data is collected, and may also be saved for later viewing by either `nvprof` or the Visual Profiler.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/profiler-users-guide#nvprof";
|
||||
changelog = "https://docs.nvidia.com/cuda/profiler-users-guide#changelog";
|
||||
};
|
||||
}
|
||||
15
pkgs/development/cuda-modules/packages/cuda_nvprune.nix
Normal file
15
pkgs/development/cuda-modules/packages/cuda_nvprune.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvprune";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
meta = {
|
||||
description = "Prune host object files and libraries to only contain device code for the specified targets";
|
||||
longDescription = ''
|
||||
`nvprune` prunes host object files and libraries to only contain device code for the specified targets.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/cuda-binary-utilities#nvprune";
|
||||
};
|
||||
}
|
||||
25
pkgs/development/cuda-modules/packages/cuda_nvrtc.nix
Normal file
25
pkgs/development/cuda-modules/packages/cuda_nvrtc.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvrtc";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = {
|
||||
description = "Runtime compilation library for CUDA C++";
|
||||
longDescription = ''
|
||||
NVRTC is a runtime compilation library for CUDA C++. It accepts CUDA C++ source code in character string form
|
||||
and creates handles that can be used to obtain the PTX.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/cuda/nvrtc";
|
||||
};
|
||||
}
|
||||
23
pkgs/development/cuda-modules/packages/cuda_nvtx.nix
Normal file
23
pkgs/development/cuda-modules/packages/cuda_nvtx.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvtx";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "C-based Application Programming Interface (API) for annotating events, code ranges, and resources in your applications";
|
||||
longDescription = ''
|
||||
NVTX is a cross-platform API for annotating source code to provide contextual information to developer tools.
|
||||
|
||||
The NVTX API is written in C, with wrappers provided for C++ and Python.
|
||||
'';
|
||||
homepage = "https://github.com/NVIDIA/NVTX";
|
||||
changelog = "https://github.com/NVIDIA/NVTX/releases";
|
||||
};
|
||||
}
|
||||
18
pkgs/development/cuda-modules/packages/cuda_nvvp.nix
Normal file
18
pkgs/development/cuda-modules/packages/cuda_nvvp.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_nvvp";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = {
|
||||
description = "Cross-platform performance profiling tool for optimizing CUDA C/C++ applications";
|
||||
longDescription = ''
|
||||
The NVIDIA Visual Profiler is a cross-platform performance profiling tool that delivers developers vital
|
||||
feedback for optimizing CUDA C/C++ applications.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/nvidia-visual-profiler";
|
||||
};
|
||||
}
|
||||
22
pkgs/development/cuda-modules/packages/cuda_opencl.nix
Normal file
22
pkgs/development/cuda-modules/packages/cuda_opencl.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_opencl";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Low-level API for heterogeneous computing that runs on CUDA-powered GPUs";
|
||||
longDescription = ''
|
||||
OpenCL™ (Open Computing Language) is a low-level API for heterogeneous computing that runs on CUDA-powered GPUs.
|
||||
Using the OpenCL API, developers can launch compute kernels written using a limited subset of the C programming
|
||||
language on a GPU.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/opencl";
|
||||
};
|
||||
}
|
||||
13
pkgs/development/cuda-modules/packages/cuda_profiler_api.nix
Normal file
13
pkgs/development/cuda-modules/packages/cuda_profiler_api.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_profiler_api";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
];
|
||||
|
||||
meta.description = "API for profiling CUDA runtime";
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_sandbox_dev";
|
||||
outputs = [ "out" ];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "cuda_sanitizer_api";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = {
|
||||
description = "Enables the creation of sanitizing and tracing tools that target CUDA applications";
|
||||
longDescription = ''
|
||||
The Compute Sanitizer API enables the creation of sanitizing and tracing tools that target CUDA applications.
|
||||
Examples of such tools are memory and race condition checkers.
|
||||
'';
|
||||
homepage = "https://docs.nvidia.com/compute-sanitizer/SanitizerApiGuide";
|
||||
};
|
||||
}
|
||||
@@ -73,8 +73,9 @@ symlinkJoin rec {
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Wrapper substituting the deprecated runfile-based CUDA installation";
|
||||
license = licenses.nvidiaCuda;
|
||||
license = lib.licenses.nvidiaCudaRedist;
|
||||
teams = [ lib.teams.cuda ];
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
{
|
||||
autoAddDriverRunpath,
|
||||
backendStdenv,
|
||||
catch2_3,
|
||||
cmake,
|
||||
cuda_cccl,
|
||||
cuda_cudart,
|
||||
cuda_nvcc,
|
||||
cuda_nvrtc,
|
||||
cudnn,
|
||||
fetchFromGitHub,
|
||||
gitUpdater,
|
||||
lib,
|
||||
libcublas,
|
||||
ninja,
|
||||
nlohmann_json,
|
||||
stdenv,
|
||||
cuda_cccl ? null,
|
||||
cuda_cudart ? null,
|
||||
cuda_nvcc ? null,
|
||||
cuda_nvrtc ? null,
|
||||
cudnn ? null,
|
||||
libcublas ? null,
|
||||
}:
|
||||
let
|
||||
inherit (lib.lists) optionals;
|
||||
@@ -23,9 +23,8 @@ let
|
||||
optionalString
|
||||
;
|
||||
in
|
||||
|
||||
# TODO(@connorbaker): This should be a hybrid C++/Python package.
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
backendStdenv.mkDerivation (finalAttrs: {
|
||||
pname = "cudnn-frontend";
|
||||
version = "1.9.0";
|
||||
|
||||
@@ -121,7 +120,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
description = "A c++ wrapper for the cudnn backend API";
|
||||
homepage = "https://github.com/NVIDIA/cudnn-frontend";
|
||||
license = lib.licenses.mit;
|
||||
badPlatforms = optionals (cudnn == null) finalAttrs.meta.platforms;
|
||||
# TODO(@connorbaker): How tightly coupled is this library to specific cuDNN versions?
|
||||
# Should it be marked as broken if it doesn't match our expected version?
|
||||
platforms = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
|
||||
77
pkgs/development/cuda-modules/packages/cudnn.nix
Normal file
77
pkgs/development/cuda-modules/packages/cudnn.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
_cuda,
|
||||
buildRedist,
|
||||
lib,
|
||||
libcublas,
|
||||
patchelf,
|
||||
zlib,
|
||||
}:
|
||||
buildRedist (finalAttrs: {
|
||||
redistName = "cudnn";
|
||||
pname = "cudnn";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
# NOTE: Verions of CUDNN after 9.0 no longer depend on libcublas:
|
||||
# https://docs.nvidia.com/deeplearning/cudnn/latest/release-notes.html?highlight=cublas#cudnn-9-0-0
|
||||
# However, NVIDIA only provides libcublasLT via the libcublas package.
|
||||
(lib.getLib libcublas)
|
||||
zlib
|
||||
];
|
||||
|
||||
# Tell autoPatchelf about runtime dependencies. *_infer* libraries only
|
||||
# exist in CuDNN 8.
|
||||
# NOTE: Versions from CUDNN releases have four components.
|
||||
postFixup =
|
||||
lib.optionalString
|
||||
(lib.versionAtLeast finalAttrs.version "8.0.5.0" && lib.versionOlder finalAttrs.version "9.0.0.0")
|
||||
''
|
||||
${lib.getExe patchelf} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
||||
${lib.getExe patchelf} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
|
||||
'';
|
||||
|
||||
# TODO(@connorbaker): Broken conditions for cuDNN used out of scope.
|
||||
# platformAssertions =
|
||||
# let
|
||||
# cudaTooOld = cudaOlder finalAttrs.passthru.featureRelease.minCudaVersion;
|
||||
# cudaTooNew =
|
||||
# (finalAttrs.passthru.featureRelease.maxCudaVersion != null)
|
||||
# && lib.versionOlder finalAttrs.passthru.featureRelease.maxCudaVersion cudaMajorMinorVersion;
|
||||
# in
|
||||
# prevAttrs.passthru.platformAssertions or [ ]
|
||||
# ++ [
|
||||
# {
|
||||
# message = "CUDA version is too old";
|
||||
# assertion = cudaTooOld;
|
||||
# }
|
||||
# {
|
||||
# message = "CUDA version is too new";
|
||||
# assertion = cudaTooNew;
|
||||
# }
|
||||
# ];
|
||||
|
||||
meta = {
|
||||
description = "GPU-accelerated library of primitives for deep neural networks";
|
||||
longDescription = ''
|
||||
The NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for deep neural
|
||||
networks.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/cudnn";
|
||||
changelog = "https://docs.nvidia.com/deeplearning/cudnn/backend/latest/release-notes.html";
|
||||
|
||||
license = _cuda.lib.licenses.cudnn;
|
||||
|
||||
maintainers = with lib.maintainers; [
|
||||
mdaiter
|
||||
samuela
|
||||
connorbaker
|
||||
];
|
||||
};
|
||||
})
|
||||
14
pkgs/development/cuda-modules/packages/cudnn_8_9.nix
Normal file
14
pkgs/development/cuda-modules/packages/cudnn_8_9.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
_cuda,
|
||||
backendStdenv,
|
||||
cudnn,
|
||||
}:
|
||||
let
|
||||
version = if backendStdenv.hasJetsonCudaCapability then "8.9.5" else "8.9.7";
|
||||
in
|
||||
# TODO(@connorbaker): Support for old versions of CUDNN should be removed.
|
||||
cudnn.overrideAttrs (prevAttrs: {
|
||||
passthru = prevAttrs.passthru // {
|
||||
release = _cuda.manifests.cudnn.${version}.cudnn;
|
||||
};
|
||||
})
|
||||
14
pkgs/development/cuda-modules/packages/driver_assistant.nix
Normal file
14
pkgs/development/cuda-modules/packages/driver_assistant.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "driver_assistant";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
platformAssertions = [
|
||||
{
|
||||
message = "Package is not supported; use drivers from linuxPackages";
|
||||
assertion = false;
|
||||
}
|
||||
];
|
||||
}
|
||||
19
pkgs/development/cuda-modules/packages/fabricmanager.nix
Normal file
19
pkgs/development/cuda-modules/packages/fabricmanager.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ buildRedist, zlib }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "fabricmanager";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"bin"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
buildInputs = [ zlib ];
|
||||
|
||||
meta.homepage = "https://docs.nvidia.com/datacenter/tesla/fabric-manager-user-guide";
|
||||
}
|
||||
16
pkgs/development/cuda-modules/packages/imex.nix
Normal file
16
pkgs/development/cuda-modules/packages/imex.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ buildRedist, zlib }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "imex";
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
buildInputs = [ zlib ];
|
||||
|
||||
meta = {
|
||||
description = "Service which supports GPU memory export and import (NVLink P2P) and shared memory operations across OS domains in an NVLink multi-node deployment";
|
||||
homepage = "https://docs.nvidia.com/multi-node-nvlink-systems/imex-guide";
|
||||
};
|
||||
}
|
||||
22
pkgs/development/cuda-modules/packages/libcublas.nix
Normal file
22
pkgs/development/cuda-modules/packages/libcublas.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcublas";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "CUDA Basic Linear Algebra Subroutine library";
|
||||
longDescription = ''
|
||||
The cuBLAS library is an implementation of BLAS (Basic Linear Algebra Subprograms) on top of the NVIDIA CUDA runtime.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/cublas";
|
||||
};
|
||||
}
|
||||
21
pkgs/development/cuda-modules/packages/libcudla.nix
Normal file
21
pkgs/development/cuda-modules/packages/libcudla.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
backendStdenv,
|
||||
buildRedist,
|
||||
lib,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcudla";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
autoPatchelfIgnoreMissingDeps = lib.optionals backendStdenv.hasJetsonCudaCapability [
|
||||
"libnvcudla.so"
|
||||
];
|
||||
}
|
||||
19
pkgs/development/cuda-modules/packages/libcufft.nix
Normal file
19
pkgs/development/cuda-modules/packages/libcufft.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcufft";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "High-performance FFT product CUDA library";
|
||||
homepage = "https://developer.nvidia.com/cufft";
|
||||
};
|
||||
}
|
||||
32
pkgs/development/cuda-modules/packages/libcufile.nix
Normal file
32
pkgs/development/cuda-modules/packages/libcufile.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
buildRedist,
|
||||
cuda_cudart,
|
||||
lib,
|
||||
numactl,
|
||||
rdma-core,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcufile";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
];
|
||||
|
||||
allowFHSReferences = true;
|
||||
|
||||
buildInputs = [
|
||||
(lib.getOutput "stubs" cuda_cudart)
|
||||
numactl
|
||||
rdma-core
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Library to leverage GDS technology";
|
||||
homepage = "https://docs.nvidia.com/gpudirect-storage/api-reference-guide";
|
||||
};
|
||||
}
|
||||
24
pkgs/development/cuda-modules/packages/libcurand.nix
Normal file
24
pkgs/development/cuda-modules/packages/libcurand.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ buildRedist }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcurand";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Helper module for the cuBLASMp library that allows it to efficiently perform communications between different GPUs";
|
||||
longDescription = ''
|
||||
Communication Abstraction Library (CAL) is a helper module for the cuBLASMp library that allows it to
|
||||
efficiently perform communications between different GPUs.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/curand";
|
||||
changelog = "https://docs.nvidia.com/cuda/cublasmp/release_notes";
|
||||
};
|
||||
}
|
||||
36
pkgs/development/cuda-modules/packages/libcusolver.nix
Normal file
36
pkgs/development/cuda-modules/packages/libcusolver.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
buildRedist,
|
||||
lib,
|
||||
libcublas,
|
||||
libcusparse,
|
||||
libnvjitlink,
|
||||
}:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcusolver";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
(lib.getLib libcublas)
|
||||
(lib.getLib libcusparse)
|
||||
libnvjitlink
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Collection of dense and sparse direct linear solvers and Eigen solvers";
|
||||
longDescription = ''
|
||||
The NVIDIA cuSOLVER library provides a collection of dense and sparse direct linear solvers and Eigen solvers
|
||||
which deliver significant acceleration for Computer Vision, CFD, Computational Chemistry, and Linear
|
||||
Optimization applications.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/cusolver";
|
||||
};
|
||||
}
|
||||
26
pkgs/development/cuda-modules/packages/libcusparse.nix
Normal file
26
pkgs/development/cuda-modules/packages/libcusparse.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ buildRedist, libnvjitlink }:
|
||||
buildRedist {
|
||||
redistName = "cuda";
|
||||
pname = "libcusparse";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
"stubs"
|
||||
];
|
||||
|
||||
buildInputs = [ libnvjitlink ];
|
||||
|
||||
meta = {
|
||||
description = "GPU-accelerated basic linear algebra subroutines for sparse matrix computations for unstructured sparsity";
|
||||
longDescription = ''
|
||||
The cuSPARSE APIs provides GPU-accelerated basic linear algebra subroutines for sparse matrix computations for
|
||||
unstructured sparsity.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/cusparse";
|
||||
changelog = "https://docs.nvidia.com/cuda/cusparse";
|
||||
};
|
||||
}
|
||||
38
pkgs/development/cuda-modules/packages/libcusparse_lt.nix
Normal file
38
pkgs/development/cuda-modules/packages/libcusparse_lt.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
_cuda,
|
||||
buildRedist,
|
||||
cuda_cudart,
|
||||
lib,
|
||||
libcublas,
|
||||
}:
|
||||
buildRedist (finalAttrs: {
|
||||
redistName = "cusparselt";
|
||||
pname = "libcusparse_lt";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"include"
|
||||
"lib"
|
||||
"static"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
(lib.getLib libcublas)
|
||||
]
|
||||
# For some reason, the 1.4.x release of cusparselt requires the cudart library.
|
||||
++ lib.optionals (lib.hasPrefix "1.4" finalAttrs.version) [ (lib.getLib cuda_cudart) ];
|
||||
|
||||
meta = {
|
||||
description = "High-performance CUDA library dedicated to general matrix-matrix operations in which at least one operand is a structured sparse matrix with 50% sparsity ratio";
|
||||
longDescription = ''
|
||||
NVIDIA cuSPARSELt is a high-performance CUDA library dedicated to general matrix-matrix operations in which at
|
||||
least one operand is a structured sparse matrix with 50% sparsity ratio.
|
||||
'';
|
||||
homepage = "https://developer.nvidia.com/cusparselt-downloads";
|
||||
changelog = "https://docs.nvidia.com/cuda/cublasmp/release_notes";
|
||||
|
||||
maintainers = [ lib.maintainers.sepiabrown ];
|
||||
license = _cuda.lib.licenses.cusparse_lt;
|
||||
};
|
||||
})
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user