Merge pull request #301188 from SomeoneSerge/cudaPackages/rename-cudatoolkit
cudaPackages.cudatoolkit: replace with symlinkJoin
This commit is contained in:
commit
446fee38c1
|
@ -315,6 +315,12 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
|
||||||
|
|
||||||
- The `cudaPackages` package scope has been updated to `cudaPackages_12`.
|
- The `cudaPackages` package scope has been updated to `cudaPackages_12`.
|
||||||
|
|
||||||
|
- The deprecated `cudaPackages.cudatoolkit` has been replaced with a
|
||||||
|
symlink-based wrapper for the splayed redistributable CUDA packages. The
|
||||||
|
wrapper only includes tools and libraries necessary to build common packages
|
||||||
|
like e.g. tensorflow. The original runfile-based `cudatoolkit` is still
|
||||||
|
available as `cudatoolkit-legacy-runfile`.
|
||||||
|
|
||||||
- The `halloy` package was updated past 2024.5 which introduced a breaking change by switching the config format from YAML to TOML. See https://github.com/squidowl/halloy/releases/tag/2024.5 for details.
|
- The `halloy` package was updated past 2024.5 which introduced a breaking change by switching the config format from YAML to TOML. See https://github.com/squidowl/halloy/releases/tag/2024.5 for details.
|
||||||
|
|
||||||
- Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version.
|
- Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (cudaPackages) cudatoolkit nccl;
|
inherit (cudaPackages) backendStdenv cudatoolkit nccl;
|
||||||
# The default for cudatoolkit 10.1 is CUDNN 8.0.5, the last version to support CUDA 10.1.
|
# The default for cudatoolkit 10.1 is CUDNN 8.0.5, the last version to support CUDA 10.1.
|
||||||
# However, this caffe does not build with CUDNN 8.x, so we use CUDNN 7.6.5 instead.
|
# However, this caffe does not build with CUDNN 8.x, so we use CUDNN 7.6.5 instead.
|
||||||
# Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default.
|
# Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default.
|
||||||
|
@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
|
||||||
"-DBLAS=open"
|
"-DBLAS=open"
|
||||||
] ++ (if cudaSupport then [
|
] ++ (if cudaSupport then [
|
||||||
"-DCUDA_ARCH_NAME=All"
|
"-DCUDA_ARCH_NAME=All"
|
||||||
"-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
|
"-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc"
|
||||||
] else [ "-DCPU_ONLY=ON" ])
|
] else [ "-DCPU_ONLY=ON" ])
|
||||||
++ ["-DUSE_NCCL=${toggle ncclSupport}"]
|
++ ["-DUSE_NCCL=${toggle ncclSupport}"]
|
||||||
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
|
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (cudaPackages) cudatoolkit cudaFlags cudnn;
|
inherit (cudaPackages) backendStdenv cudatoolkit cudaFlags cudnn;
|
||||||
in
|
in
|
||||||
|
|
||||||
assert cudnnSupport -> cudaSupport;
|
assert cudnnSupport -> cudaSupport;
|
||||||
|
@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
|
||||||
++ (if cudaSupport then [
|
++ (if cudaSupport then [
|
||||||
"-DUSE_OLDCMAKECUDA=ON" # see https://github.com/apache/incubator-mxnet/issues/10743
|
"-DUSE_OLDCMAKECUDA=ON" # see https://github.com/apache/incubator-mxnet/issues/10743
|
||||||
"-DCUDA_ARCH_NAME=All"
|
"-DCUDA_ARCH_NAME=All"
|
||||||
"-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
|
"-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc"
|
||||||
"-DMXNET_CUDA_ARCH=${builtins.concatStringsSep ";" cudaFlags.realArches}"
|
"-DMXNET_CUDA_ARCH=${builtins.concatStringsSep ";" cudaFlags.realArches}"
|
||||||
] else [ "-DUSE_CUDA=OFF" ])
|
] else [ "-DUSE_CUDA=OFF" ])
|
||||||
++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
|
++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
|
||||||
|
|
|
@ -411,7 +411,7 @@ backendStdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A compiler for NVIDIA GPUs, math libraries, and tools";
|
description = "The deprecated runfile-based CUDAToolkit installation (a compiler for NVIDIA GPUs, math libraries, and tools)";
|
||||||
homepage = "https://developer.nvidia.com/cuda-toolkit";
|
homepage = "https://developer.nvidia.com/cuda-toolkit";
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
license = licenses.nvidiaCuda;
|
license = licenses.nvidiaCuda;
|
||||||
|
|
86
pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix
Normal file
86
pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
symlinkJoin,
|
||||||
|
backendStdenv,
|
||||||
|
cudaOlder,
|
||||||
|
cudatoolkit-legacy-runfile,
|
||||||
|
cudaVersion,
|
||||||
|
cuda_cccl ? null,
|
||||||
|
cuda_cudart ? null,
|
||||||
|
cuda_cuobjdump ? null,
|
||||||
|
cuda_cupti ? null,
|
||||||
|
cuda_cuxxfilt ? null,
|
||||||
|
cuda_gdb ? null,
|
||||||
|
cuda_nvcc ? null,
|
||||||
|
cuda_nvdisasm ? null,
|
||||||
|
cuda_nvml_dev ? null,
|
||||||
|
cuda_nvprune ? null,
|
||||||
|
cuda_nvrtc ? null,
|
||||||
|
cuda_nvtx ? null,
|
||||||
|
cuda_profiler_api ? null,
|
||||||
|
cuda_sanitizer_api ? null,
|
||||||
|
libcublas ? null,
|
||||||
|
libcufft ? null,
|
||||||
|
libcurand ? null,
|
||||||
|
libcusolver ? null,
|
||||||
|
libcusparse ? null,
|
||||||
|
libnpp ? null,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
getAllOutputs = p: [
|
||||||
|
(lib.getBin p)
|
||||||
|
(lib.getLib p)
|
||||||
|
(lib.getDev p)
|
||||||
|
];
|
||||||
|
hostPackages = [
|
||||||
|
cuda_cuobjdump
|
||||||
|
cuda_gdb
|
||||||
|
cuda_nvcc
|
||||||
|
cuda_nvdisasm
|
||||||
|
cuda_nvprune
|
||||||
|
];
|
||||||
|
targetPackages = [
|
||||||
|
cuda_cccl
|
||||||
|
cuda_cudart
|
||||||
|
cuda_cupti
|
||||||
|
cuda_cuxxfilt
|
||||||
|
cuda_nvml_dev
|
||||||
|
cuda_nvrtc
|
||||||
|
cuda_nvtx
|
||||||
|
cuda_profiler_api
|
||||||
|
cuda_sanitizer_api
|
||||||
|
libcublas
|
||||||
|
libcufft
|
||||||
|
libcurand
|
||||||
|
libcusolver
|
||||||
|
libcusparse
|
||||||
|
libnpp
|
||||||
|
];
|
||||||
|
|
||||||
|
# This assumes we put `cudatoolkit` in `buildInputs` instead of `nativeBuildInputs`:
|
||||||
|
allPackages = (map (p: p.__spliced.buildHost or p) hostPackages) ++ targetPackages;
|
||||||
|
in
|
||||||
|
|
||||||
|
if cudaOlder "11.4" then
|
||||||
|
cudatoolkit-legacy-runfile
|
||||||
|
else
|
||||||
|
symlinkJoin rec {
|
||||||
|
name = "cuda-merged-${cudaVersion}";
|
||||||
|
version = cudaVersion;
|
||||||
|
|
||||||
|
paths = builtins.concatMap getAllOutputs allPackages;
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
cc = lib.warn "cudaPackages.cudatoolkit is deprecated, refer to the manual and use splayed packages instead" backendStdenv.cc;
|
||||||
|
lib = symlinkJoin {
|
||||||
|
inherit name;
|
||||||
|
paths = map (p: lib.getLib p) allPackages;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A wrapper substituting the deprecated runfile-based CUDA installation";
|
||||||
|
license = licenses.nvidiaCuda;
|
||||||
|
};
|
||||||
|
}
|
|
@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = lib.optionals doCheck [ "-DBUILD_CPP_TEST=ON" ]
|
cmakeFlags = lib.optionals doCheck [ "-DBUILD_CPP_TEST=ON" ]
|
||||||
++ lib.optionals cudaSupport [ "-DUSE_CUDA=1" "-DCMAKE_CXX_COMPILER=${cudaPackages.cudatoolkit.cc}/bin/cc" ]
|
++ lib.optionals cudaSupport [ "-DUSE_CUDA=1" "-DCMAKE_CXX_COMPILER=${cudaPackages.backendStdenv.cc}/bin/cc" ]
|
||||||
++ lib.optionals openclSupport [ "-DUSE_GPU=ON" ]
|
++ lib.optionals openclSupport [ "-DUSE_GPU=ON" ]
|
||||||
++ lib.optionals mpiSupport [ "-DUSE_MPI=ON" ]
|
++ lib.optionals mpiSupport [ "-DUSE_MPI=ON" ]
|
||||||
++ lib.optionals hdfsSupport [
|
++ lib.optionals hdfsSupport [
|
||||||
|
|
|
@ -39,7 +39,7 @@ assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
assert enablePython -> pythonPackages != null;
|
assert enablePython -> pythonPackages != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (cudaPackages) cudatoolkit;
|
inherit (cudaPackages) backendStdenv cudatoolkit;
|
||||||
inherit (cudaPackages.cudaFlags) cudaCapabilities;
|
inherit (cudaPackages.cudaFlags) cudaCapabilities;
|
||||||
|
|
||||||
version = "3.4.18";
|
version = "3.4.18";
|
||||||
|
@ -241,7 +241,7 @@ stdenv.mkDerivation {
|
||||||
(opencvFlag "TBB" enableTbb)
|
(opencvFlag "TBB" enableTbb)
|
||||||
] ++ lib.optionals enableCuda [
|
] ++ lib.optionals enableCuda [
|
||||||
"-DCUDA_FAST_MATH=ON"
|
"-DCUDA_FAST_MATH=ON"
|
||||||
"-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
|
"-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc"
|
||||||
"-DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr"
|
"-DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr"
|
||||||
"-DCUDA_ARCH_BIN=${lib.concatStringsSep ";" cudaCapabilities}"
|
"-DCUDA_ARCH_BIN=${lib.concatStringsSep ";" cudaCapabilities}"
|
||||||
"-DCUDA_ARCH_PTX=${lib.last cudaCapabilities}"
|
"-DCUDA_ARCH_PTX=${lib.last cudaCapabilities}"
|
||||||
|
|
|
@ -75,8 +75,8 @@ stdenv.mkDerivation rec {
|
||||||
"-DUSE_CUDA=ON"
|
"-DUSE_CUDA=ON"
|
||||||
# Their CMakeLists.txt does not respect CUDA_HOST_COMPILER, instead using the CXX compiler.
|
# Their CMakeLists.txt does not respect CUDA_HOST_COMPILER, instead using the CXX compiler.
|
||||||
# https://github.com/dmlc/xgboost/blob/ccf43d4ba0a94e2f0a3cc5a526197539ae46f410/CMakeLists.txt#L145
|
# https://github.com/dmlc/xgboost/blob/ccf43d4ba0a94e2f0a3cc5a526197539ae46f410/CMakeLists.txt#L145
|
||||||
"-DCMAKE_C_COMPILER=${cudaPackages.cudatoolkit.cc}/bin/gcc"
|
"-DCMAKE_C_COMPILER=${cudaPackages.backendStdenv.cc}/bin/gcc"
|
||||||
"-DCMAKE_CXX_COMPILER=${cudaPackages.cudatoolkit.cc}/bin/g++"
|
"-DCMAKE_CXX_COMPILER=${cudaPackages.backendStdenv.cc}/bin/g++"
|
||||||
] ++ lib.optionals
|
] ++ lib.optionals
|
||||||
(cudaSupport
|
(cudaSupport
|
||||||
&& lib.versionAtLeast cudaPackages.cudatoolkit.version "11.4.0")
|
&& lib.versionAtLeast cudaPackages.cudatoolkit.version "11.4.0")
|
||||||
|
|
|
@ -69,7 +69,11 @@ let
|
||||||
backendStdenv = final.callPackage ../development/cuda-modules/backend-stdenv.nix { };
|
backendStdenv = final.callPackage ../development/cuda-modules/backend-stdenv.nix { };
|
||||||
|
|
||||||
# Loose packages
|
# Loose packages
|
||||||
cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit { };
|
|
||||||
|
# TODO: Move to aliases.nix once all Nixpkgs has migrated to the splayed CUDA packages
|
||||||
|
cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit/redist-wrapper.nix { };
|
||||||
|
cudatoolkit-legacy-runfile = final.callPackage ../development/cuda-modules/cudatoolkit { };
|
||||||
|
|
||||||
saxpy = final.callPackage ../development/cuda-modules/saxpy { };
|
saxpy = final.callPackage ../development/cuda-modules/saxpy { };
|
||||||
nccl = final.callPackage ../development/cuda-modules/nccl { };
|
nccl = final.callPackage ../development/cuda-modules/nccl { };
|
||||||
nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests { };
|
nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests { };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user