From 4a3e7f83f7a210e3b57320e80d900f1f25b59ea8 Mon Sep 17 00:00:00 2001 From: David Guibert Date: Thu, 13 Jun 2019 13:19:24 +0200 Subject: [PATCH 1/3] cudatoolkit: add 10.1.243 --- .../compilers/cudatoolkit/default.nix | 44 ++++++++++++++----- pkgs/top-level/all-packages.nix | 3 +- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/pkgs/development/compilers/cudatoolkit/default.nix b/pkgs/development/compilers/cudatoolkit/default.nix index 8aab9580232..1c7a566c35e 100644 --- a/pkgs/development/compilers/cudatoolkit/default.nix +++ b/pkgs/development/compilers/cudatoolkit/default.nix @@ -53,22 +53,25 @@ let unpackPhase = '' sh $src --keep --noexec - cd pkg/run_files - sh cuda-linux*.run --keep --noexec - sh cuda-samples*.run --keep --noexec - mv pkg ../../$(basename $src) - cd ../.. - rm -rf pkg + ${lib.optionalString (lib.versionOlder version "10.1") '' + cd pkg/run_files + sh cuda-linux*.run --keep --noexec + sh cuda-samples*.run --keep --noexec + mv pkg ../../$(basename $src) + cd ../.. + rm -rf pkg - for patch in $runPatches; do - sh $patch --keep --noexec - mv pkg $(basename $patch) - done + for patch in $runPatches; do + sh $patch --keep --noexec + mv pkg $(basename $patch) + done + ''} ''; installPhase = '' runHook preInstall mkdir $out + ${lib.optionalString (lib.versionOlder version "10.1") '' cd $(basename $src) export PERL5LIB=. perl ./install-linux.pl --prefix="$out" @@ -78,14 +81,22 @@ let perl ./install_patch.pl --silent --accept-eula --installdir="$out" cd .. done + ''} + ${lib.optionalString (lib.versionAtLeast version "10.1") '' + cd pkg/builds/cuda-toolkit + mv * $out/ + ''} rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why? + ${lib.optionalString (lib.versionOlder version "10.1") '' # let's remove the 32-bit libraries, they confuse the lib64->lib mover rm -rf $out/lib + ''} # Remove some cruft. - ${lib.optionalString (lib.versionAtLeast version "7.0") "rm $out/bin/uninstall*"} + ${lib.optionalString ((lib.versionAtLeast version "7.0") && (lib.versionOlder version "10.1")) + "rm $out/bin/uninstall*"} # Fixup path to samples (needed for cuda 6.5 or else nsight will not find them) if [ -d "$out"/cuda-samples ]; then @@ -109,6 +120,9 @@ let # Remove OpenCL libraries as they are provided by ocl-icd and driver. rm -f $out/lib64/libOpenCL* + ${lib.optionalString (lib.versionAtLeast version "10.1") '' + mv $out/lib64 $out/lib + ''} # Set compiler for NVCC. wrapProgram $out/bin/nvcc \ @@ -304,5 +318,13 @@ in rec { gcc = gcc7; }; + cudatoolkit_10_1 = common { + version = "10.1.243"; + url = "https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run"; + sha256 = "0caxhlv2bdq863dfp6wj7nad66ml81vasq2ayf11psvq2b12vhp7"; + + gcc = gcc7; + }; + cudatoolkit_10 = cudatoolkit_10_0; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 85e441b58c7..6d68ea75083 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2473,7 +2473,8 @@ in cudatoolkit_9_1 cudatoolkit_9_2 cudatoolkit_10 - cudatoolkit_10_0; + cudatoolkit_10_0 + cudatoolkit_10_1; cudatoolkit = cudatoolkit_9; From 92690a89376f6f57136f93053308588eebd86dec Mon Sep 17 00:00:00 2001 From: David Guibert Date: Tue, 17 Sep 2019 14:22:02 +0200 Subject: [PATCH 2/3] cuddn: add 10.1 (version 7.6.3) --- .../libraries/science/math/cudnn/default.nix | 11 +++++++++-- pkgs/top-level/all-packages.nix | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/science/math/cudnn/default.nix b/pkgs/development/libraries/science/math/cudnn/default.nix index a33e3ec2009..8cd74939959 100644 --- a/pkgs/development/libraries/science/math/cudnn/default.nix +++ b/pkgs/development/libraries/science/math/cudnn/default.nix @@ -1,4 +1,4 @@ -{ callPackage, cudatoolkit_7, cudatoolkit_7_5, cudatoolkit_8, cudatoolkit_9_0, cudatoolkit_9_1, cudatoolkit_9_2, cudatoolkit_10_0 }: +{ callPackage, cudatoolkit_7, cudatoolkit_7_5, cudatoolkit_8, cudatoolkit_9_0, cudatoolkit_9_1, cudatoolkit_9_2, cudatoolkit_10_0, cudatoolkit_10_1 }: let generic = args: callPackage (import ./generic.nix (removeAttrs args ["cudatoolkit"])) { @@ -65,5 +65,12 @@ in rec { sha256 = "18ys0apiz9afid2s6lvy9qbyi8g66aimb2a7ikl1f3dm09mciprf"; }; - cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_0; + cudnn_cudatoolkit_10_1 = generic rec { + version = "7.6.3"; + cudatoolkit = cudatoolkit_10_1; + srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.6.3.30.tgz"; + sha256 = "0qc9f1xpyfibwqrpqxxq2v9h6w90j0dbx564akwy44c1dls5f99m"; + }; + + cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_1; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d68ea75083..a3f224a8f97 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2488,7 +2488,8 @@ in cudnn_cudatoolkit_9_1 cudnn_cudatoolkit_9_2 cudnn_cudatoolkit_10 - cudnn_cudatoolkit_10_0; + cudnn_cudatoolkit_10_0 + cudnn_cudatoolkit_10_1; cudnn = cudnn_cudatoolkit_9; From 78aff37ff1132c80b4db5e9551ff4404889cf0f4 Mon Sep 17 00:00:00 2001 From: David Guibert Date: Tue, 17 Sep 2019 14:22:38 +0200 Subject: [PATCH 3/3] cudatolkit,cuddn: make 10_1 as default --- pkgs/development/compilers/cudatoolkit/default.nix | 2 +- pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/cudatoolkit/default.nix b/pkgs/development/compilers/cudatoolkit/default.nix index 1c7a566c35e..62b965c44a7 100644 --- a/pkgs/development/compilers/cudatoolkit/default.nix +++ b/pkgs/development/compilers/cudatoolkit/default.nix @@ -326,5 +326,5 @@ in rec { gcc = gcc7; }; - cudatoolkit_10 = cudatoolkit_10_0; + cudatoolkit_10 = cudatoolkit_10_1; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a3f224a8f97..481f8870026 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2476,7 +2476,7 @@ in cudatoolkit_10_0 cudatoolkit_10_1; - cudatoolkit = cudatoolkit_9; + cudatoolkit = cudatoolkit_10; inherit (callPackages ../development/libraries/science/math/cudnn { }) cudnn_cudatoolkit_7 @@ -2491,7 +2491,7 @@ in cudnn_cudatoolkit_10_0 cudnn_cudatoolkit_10_1; - cudnn = cudnn_cudatoolkit_9; + cudnn = cudnn_cudatoolkit_10; curlFull = curl.override { idnSupport = true;