git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #167250 from SomeoneSerge/bump-cudatoolkit

cudatoolkit: 10.2 -> 11.5

commita7bbda4271e0155b1115c86fe7e95dc006a8bbff authorFrederik Rietdijk <fridh@fridh.nl> dateThu 7 Apr 2022, 13:40 (5 years ago) parentb622716386fb0c
10 files changed+52−37
pkgs/applications/science/math/caffe/default.nix+1 pkgs/applications/science/math/mxnet/default.nix+8 pkgs/development/compilers/cudatoolkit/default.nix+1−1 pkgs/development/libraries/opensubdiv/default.nix+9−2 pkgs/development/python-modules/chainer/default.nix+4−2 pkgs/development/python-modules/mxnet/default.nix+5−1 pkgs/tools/misc/ethminer/default.nix+16−9 pkgs/tools/security/truecrack/default.nix+1 pkgs/top-level/all-packages.nix+7−4 pkgs/top-level/python-packages.nix−18
pkgs/applications/science/math/caffe/default.nix+1
@@ -138,6 +138,7 @@ stdenv.mkDerivation rec {
138138 '';
139139 homepage = "http://caffe.berkeleyvision.org/";
140140 maintainers = with maintainers; [ ];
141+ broken = pythonSupport && (python.isPy310);
141142 license = licenses.bsd2;
142143 platforms = platforms.linux ++ platforms.darwin;
143144 };
pkgs/applications/science/math/mxnet/default.nix+8
@@ -2,6 +2,7 @@
22, opencv3, gtest, blas, gomp, llvmPackages, perl
33, cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11
44, cudnnSupport ? cudaSupport, cudnn
5+, cudaCapabilities ? [ "3.7" "5.0" "6.0" "7.0" "7.5" "8.0" "8.6" ]
56}:
67
78assert cudnnSupport -> cudaSupport;
@@ -44,6 +45,7 @@ stdenv.mkDerivation rec {
4445 "-DUSE_OLDCMAKECUDA=ON" # see https://github.com/apache/incubator-mxnet/issues/10743
4546 "-DCUDA_ARCH_NAME=All"
4647 "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
48+ "-DMXNET_CUDA_ARCH=${lib.concatStringsSep ";" cudaCapabilities}"
4749 ] else [ "-DUSE_CUDA=OFF" ])
4850 ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
4951
@@ -60,6 +62,12 @@ stdenv.mkDerivation rec {
6062 rm "$out"/lib/*.a
6163 '';
6264
65+ # used to mark cudaSupport in python310Packages.mxnet as broken;
66+ # other attributes exposed for consistency
67+ passthru = {
68+ inherit cudaSupport cudnnSupport cudatoolkit cudnn;
69+ };
70+
6371 meta = with lib; {
6472 description = "Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler";
6573 homepage = "https://mxnet.incubator.apache.org/";
pkgs/development/compilers/cudatoolkit/default.nix+1−1
@@ -90,5 +90,5 @@ rec {
9090 # latest cudnn, nccl, cutensor, etc! It sometimes happens that CUDA versions
9191 # are released prior to compatibility with the rest of the ecosystem. And
9292 # don't forget to request a review from @NixOS/cuda-maintainers!
93− cudatoolkit_11 = cudatoolkit_11_5;
93+ cudatoolkit_11 = cudatoolkit_11_5; # update me to 11_6 when cudnn>=8.3.3
9494}
pkgs/development/libraries/opensubdiv/default.nix+9−2
@@ -1,6 +1,10 @@
11{ config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU
22, libGL, glew, ocl-icd, python3
33, cudaSupport ? config.cudaSupport or false, cudatoolkit
4+ # For visibility mostly. The whole approach to cuda architectures and capabilities
5+ # will be reworked soon.
6+, cudaArch ? "compute_37"
7+, openclSupport ? !cudaSupport
48, darwin
59}:
610
@@ -24,7 +28,7 @@ stdenv.mkDerivation rec {
2428 glew xorg.libX11 xorg.libXrandr xorg.libXxf86vm xorg.libXcursor
2529 xorg.libXinerama xorg.libXi
2630 ]
27− ++ lib.optional (!stdenv.isDarwin) ocl-icd
31+ ++ lib.optional (openclSupport && !stdenv.isDarwin) ocl-icd
2832 ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [OpenCL Cocoa CoreVideo IOKit AppKit AGL ])
2933 ++ lib.optional cudaSupport cudatoolkit;
3034
@@ -37,8 +41,10 @@ stdenv.mkDerivation rec {
3741 "-DGLEW_INCLUDE_DIR=${glew.dev}/include"
3842 "-DGLEW_LIBRARY=${glew.dev}/lib"
3943 ] ++ lib.optionals cudaSupport [
40− "-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=compute_30"
44+ "-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=${cudaArch}"
4145 "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
46+ ] ++ lib.optionals (!openclSupport) [
47+ "-DNO_OPENCL=1"
4248 ];
4349
4450 postInstall = "rm $out/lib/*.a";
@@ -46,6 +52,7 @@ stdenv.mkDerivation rec {
4652 meta = {
4753 description = "An Open-Source subdivision surface library";
4854 homepage = "http://graphics.pixar.com/opensubdiv";
55+ broken = openclSupport && cudaSupport;
4956 platforms = lib.platforms.unix;
5057 maintainers = [ lib.maintainers.eelco ];
5158 license = lib.licenses.asl20;
pkgs/development/python-modules/chainer/default.nix+4−2
@@ -1,6 +1,6 @@
1−{ lib, buildPythonPackage, fetchFromGitHub, isPy3k
1+{ config, lib, buildPythonPackage, fetchFromGitHub, isPy3k
22, filelock, protobuf, numpy, pytestCheckHook, mock, typing-extensions
3−, cupy, cudaSupport ? false
3+, cupy, cudaSupport ? config.cudaSupport or false
44}:
55
66buildPythonPackage rec {
@@ -39,6 +39,8 @@ buildPythonPackage rec {
3939 meta = with lib; {
4040 description = "A flexible framework of neural networks for deep learning";
4141 homepage = "https://chainer.org/";
42+ # Un-break me when updating chainer next time!
43+ broken = cudaSupport && (lib.versionAtLeast cupy.version "8.0.0");
4244 license = licenses.mit;
4345 maintainers = with maintainers; [ hyphon81 ];
4446 };
pkgs/development/python-modules/mxnet/default.nix+5−1
@@ -6,10 +6,11 @@
66, graphviz
77, python
88, isPy3k
9+, isPy310
910}:
1011
1112buildPythonPackage {
12− inherit (pkgs.mxnet) pname version src meta;
13+ inherit (pkgs.mxnet) pname version src;
1314
1415 buildInputs = [ pkgs.mxnet ];
1516 propagatedBuildInputs = [ requests numpy graphviz ];
@@ -32,4 +33,7 @@ buildPythonPackage {
3233 ln -s ${pkgs.mxnet}/lib/libmxnet.so $out/${python.sitePackages}/mxnet
3334 '';
3435
36+ meta = pkgs.mxnet.meta // {
37+ broken = (pkgs.mxnet.broken or false) || (isPy310 && pkgs.mxnet.cudaSupport);
38+ };
3539}
pkgs/tools/misc/ethminer/default.nix+16−9
@@ -1,6 +1,7 @@
11{
22 lib,
33 stdenv,
4+ fetchpatch,
45 fetchFromGitHub,
56 opencl-headers,
67 cmake,
@@ -31,6 +32,21 @@ stdenv.mkDerivation rec {
3132 fetchSubmodules = true;
3233 };
3334
35+ patches = [
36+ # global context library is separated from libethash
37+ ./add-global-context.patch
38+
39+ # CUDA 11 no longer support SM30
40+ (fetchpatch {
41+ url = "https://github.com/ethereum-mining/ethminer/commit/dae359dff28f376d4ce7ddfbd651dcd34d6dad8f.patch";
42+ hash = "sha256-CJGKc0rXOcKDX1u5VBzc8gyBi1Me9CNATfQzKViqtAA=";
43+ })
44+ ];
45+
46+ postPatch = ''
47+ sed -i 's/_lib_static//' libpoolprotocols/CMakeLists.txt
48+ '';
49+
3450 # NOTE: dbus is broken
3551 cmakeFlags = [
3652 "-DHUNTER_ENABLED=OFF"
@@ -64,15 +80,6 @@ stdenv.mkDerivation rec {
6480 cudatoolkit
6581 ];
6682
67− patches = [
68− # global context library is separated from libethash
69− ./add-global-context.patch
70− ];
71−
72− preConfigure = ''
73− sed -i 's/_lib_static//' libpoolprotocols/CMakeLists.txt
74− '';
75−
7683 postInstall = ''
7784 wrapProgram $out/bin/ethminer --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib
7885 '';
pkgs/tools/security/truecrack/default.nix+1
@@ -33,6 +33,7 @@ gccStdenv.mkDerivation rec {
3333 meta = with lib; {
3434 description = "TrueCrack is a brute-force password cracker for TrueCrypt volumes. It works on Linux and it is optimized for Nvidia Cuda technology.";
3535 homepage = "https://gitlab.com/kalilinux/packages/truecrack";
36+ broken = cudaSupport;
3637 license = licenses.gpl3Plus;
3738 platforms = platforms.unix;
3839 maintainers = with maintainers; [ ethancedwards8 ];
pkgs/top-level/all-packages.nix+7−4
@@ -4625,7 +4625,7 @@ with pkgs;
46254625 cudatoolkit_11_5
46264626 cudatoolkit_11_6;
46274627
4628− cudatoolkit = cudatoolkit_10;
4628+ cudatoolkit = cudatoolkit_11;
46294629
46304630 cudnnPackages = callPackages ../development/libraries/science/math/cudnn { };
46314631 inherit (cudnnPackages)
@@ -4648,7 +4648,7 @@ with pkgs;
46484648 cudnn_8_3_cudatoolkit_11;
46494649
46504650 # Make sure to keep this in sync with the `cudatoolkit` version!
4651− cudnn = cudnn_8_3_cudatoolkit_10;
4651+ cudnn = cudnn_8_3_cudatoolkit_11;
46524652
46534653 cutensorPackages = callPackages ../development/libraries/science/math/cutensor { };
46544654 inherit (cutensorPackages)
@@ -4662,7 +4662,7 @@ with pkgs;
46624662 cutensor_cudatoolkit_11_3
46634663 cutensor_cudatoolkit_11_4;
46644664
4665− cutensor = cutensor_cudatoolkit_10;
4665+ cutensor = cutensor_cudatoolkit_11;
46664666
46674667 curie = callPackage ../data/fonts/curie { };
46684668
@@ -26398,7 +26398,10 @@ with pkgs;
2639826398
2639926399 gpsprune = callPackage ../applications/misc/gpsprune { };
2640026400
26401− gpu-screen-recorder = callPackage ../applications/video/gpu-screen-recorder { };
26401+ gpu-screen-recorder = callPackage ../applications/video/gpu-screen-recorder {
26402+ # rm me as soon as this package gains the support for cuda 11
26403+ cudatoolkit = cudatoolkit_10;
26404+ };
2640226405
2640326406 gpu-screen-recorder-gtk = callPackage ../applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix { };
2640426407
pkgs/top-level/python-packages.nix−18
@@ -8383,24 +8383,6 @@ in {
83838383
83848384 pytorch = callPackage ../development/python-modules/pytorch {
83858385 cudaSupport = pkgs.config.cudaSupport or false;
8386−
8387− # TODO: next time pytorch is updated (to 1.11.0, currently in staging as of
8388− # 2022-03-31), make the following changes:
8389−
8390− # -> cudatoolk_11
8391− cudatoolkit = pkgs.cudatoolkit_10;
8392−
8393− # -> cudnn_8_3_cudatoolkit_11
8394− cudnn = pkgs.cudnn_8_1_cudatoolkit_10;
8395−
8396− # -> cutensor_cudatoolkit_11 (cutensor is a new dependency in v1.11.0)
8397− # cutensor = pkgs.cutensor_cudatoolkit_11;
8398−
8399− # -> setting a custom magma should be unnecessary with v1.11.0
8400− magma = pkgs.magma.override { cudatoolkit = pkgs.cudatoolkit_10; };
8401−
8402− # -> nccl_cudatoolkit_11
8403− nccl = pkgs.nccl.override { cudatoolkit = pkgs.cudatoolkit_10; };
84048386 };
84058387
84068388 pytorch-bin = callPackage ../development/python-modules/pytorch/bin.nix { };