Merge staging-next into staging

This commit is contained in:
github-actions[bot]
2021-03-19 00:41:08 +00:00
committed by GitHub
374 changed files with 6106 additions and 2325 deletions

View File

@@ -8,6 +8,14 @@
, cudatoolkit
, fetchurl
, addOpenGLRunpath
, # The distributed version of CUDNN includes both dynamically liked .so files,
# as well as statically linked .a files. However, CUDNN is quite large
# (multiple gigabytes), so you can save some space in your nix store by
# removing the statically linked libraries if you are not using them.
#
# Setting this to true removes the statically linked .a files.
# Setting this to false keeps these statically linked .a files.
removeStatic ? false
}:
stdenv.mkDerivation {
@@ -23,6 +31,8 @@ stdenv.mkDerivation {
nativeBuildInputs = [ addOpenGLRunpath ];
installPhase = ''
runHook preInstall
function fixRunPath {
p=$(patchelf --print-rpath $1)
patchelf --set-rpath "''${p:+$p:}${lib.makeLibraryPath [ stdenv.cc.cc ]}:\$ORIGIN/" $1
@@ -35,6 +45,10 @@ stdenv.mkDerivation {
mkdir -p $out
cp -a include $out/include
cp -a lib64 $out/lib64
'' + lib.optionalString removeStatic ''
rm -f $out/lib64/*.a
'' + ''
runHook postInstall
'';
# Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.

View File

@@ -0,0 +1,37 @@
{ callPackage
, cudatoolkit_10_1, cudatoolkit_10_2
, cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2
}:
rec {
cutensor_cudatoolkit_10_1 = callPackage ./generic.nix rec {
version = "1.2.2.5";
libPath = "lib/10.1";
cudatoolkit = cudatoolkit_10_1;
# 1.2.2 is compatible with CUDA 11.0, 11.1, and 11.2:
# ephemeral doc at https://developer.nvidia.com/cutensor/downloads
sha256 = "1dl9bd71frhac9cb8lvnh71zfsnqxbxbfhndvva2zf6nh0my4klm";
};
cutensor_cudatoolkit_10_2 = cutensor_cudatoolkit_10_1.override {
libPath = "lib/10.2";
cudatoolkit = cudatoolkit_10_2;
};
cutensor_cudatoolkit_10 = cutensor_cudatoolkit_10_2;
cutensor_cudatoolkit_11_0 = cutensor_cudatoolkit_10_2.override {
libPath = "lib/11";
cudatoolkit = cudatoolkit_11_0;
};
cutensor_cudatoolkit_11_1 = cutensor_cudatoolkit_11_0.override {
cudatoolkit = cudatoolkit_11_1;
};
cutensor_cudatoolkit_11_2 = cutensor_cudatoolkit_11_0.override {
cudatoolkit = cudatoolkit_11_2;
};
cutensor_cudatoolkit_11 = cutensor_cudatoolkit_11_2;
}

View File

@@ -0,0 +1,69 @@
{ stdenv
, lib
, libPath
, cudatoolkit
, fetchurl
, autoPatchelfHook
, addOpenGLRunpath
, version
, sha256
}:
let
mostOfVersion = builtins.concatStringsSep "."
(lib.take 3 (lib.versions.splitVersion version));
in
stdenv.mkDerivation {
pname = "cudatoolkit-${cudatoolkit.majorVersion}-cutensor";
inherit version;
src = fetchurl {
url = "https://developer.download.nvidia.com/compute/cutensor/${mostOfVersion}/local_installers/libcutensor-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}-${version}.tar.gz";
inherit sha256;
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [
autoPatchelfHook
addOpenGLRunpath
];
buildInputs = [
stdenv.cc.cc.lib
];
propagatedBuildInputs = [
cudatoolkit
];
# Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.
# See the explanation in addOpenGLRunpath.
installPhase = ''
mkdir -p "$out" "$dev"
mv include "$dev"
mv ${libPath} "$out/lib"
function finalRPathFixups {
for lib in $out/lib/lib*.so; do
addOpenGLRunpath $lib
done
}
postFixupHooks+=(finalRPathFixups)
'';
passthru = {
inherit cudatoolkit;
majorVersion = lib.versions.major version;
};
meta = with lib; {
description = "cuTENSOR: A High-Performance CUDA Library For Tensor Primitives";
homepage = "https://developer.nvidia.com/cutensor";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ obsidian-systems-maintenance ];
};
}

View File

@@ -10,7 +10,7 @@ let
version = "3.9.0";
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "liblapack";
inherit version;
@@ -23,6 +23,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ gfortran cmake ];
# Configure stage fails on aarch64-darwin otherwise, due to either clang 11 or gfortran 10.
hardeningDisable = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "stackprotector" ];
cmakeFlags = [
"-DCMAKE_Fortran_FLAGS=-fPIC"
"-DLAPACKE=ON"
@@ -33,6 +36,26 @@ stdenv.mkDerivation {
doCheck = true;
# Some CBLAS related tests fail on Darwin:
# 14 - CBLAS-xscblat2 (Failed)
# 15 - CBLAS-xscblat3 (Failed)
# 17 - CBLAS-xdcblat2 (Failed)
# 18 - CBLAS-xdcblat3 (Failed)
# 20 - CBLAS-xccblat2 (Failed)
# 21 - CBLAS-xccblat3 (Failed)
# 23 - CBLAS-xzcblat2 (Failed)
# 24 - CBLAS-xzcblat3 (Failed)
#
# Upstream issue to track:
# * https://github.com/Reference-LAPACK/lapack/issues/440
ctestArgs = lib.optionalString stdenv.isDarwin "-E '^(CBLAS-(x[sdcz]cblat[23]))$'";
checkPhase = ''
runHook preCheck
ctest ${ctestArgs}
runHook postCheck
'';
meta = with lib; {
inherit version;
description = "Linear Algebra PACKage";

View File

@@ -8,8 +8,8 @@
, fixDarwinDylibNames
, cudaSupport
, cudatoolkit_10_2
, cudnn_cudatoolkit_10_2
, cudatoolkit_11_1
, cudnn_cudatoolkit_11_1
}:
let
@@ -38,7 +38,7 @@ in stdenv.mkDerivation {
installPhase = ''
# Copy headers and CMake files.
install -Dm755 -t $dev/lib lib/*.a
mkdir -p $dev
cp -r include $dev
cp -r share $dev
@@ -109,8 +109,8 @@ in stdenv.mkDerivation {
passthru.tests.cmake = callPackage ./test {
inherit cudaSupport;
cudatoolkit = cudatoolkit_10_2;
cudnn = cudnn_cudatoolkit_10_2;
cudatoolkit = cudatoolkit_11_1;
cudnn = cudnn_cudatoolkit_11_1;
};
meta = with lib; {

View File

@@ -8,7 +8,7 @@ version: {
hash = "sha256-xBaNyI7eiQnSArHMITonrQQLZnZCZK/SWKOTWnxzdpc=";
};
x86_64-linux-cuda = {
url = "https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-${version}.zip";
hash = "sha256-rNEyE4+jfeX7cU0aNYd5b0pZGYT0PNPnDnS1PIsrMeM=";
url = "https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-${version}%2Bcu111.zip";
hash = "sha256-uQ7ptOuzowJ0JSPIvJHyNotBfpsqAnxpMDLq7Vl6L00=";
};
}

View File

@@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "primesieve";
version = "7.5";
version = "7.6";
nativeBuildInputs = [cmake];
src = fetchurl {
url = "https://github.com/kimwalisch/primesieve/archive/v${version}.tar.gz";
sha256 = "0g60br3p8di92jx3pr2bb51xh15gg57l7qvwzwn7xf7l585hgi7v";
sha256 = "sha256-SFZp6Pmmx05SiUfSdN9wXxPKrydtRg0PA3uNvAycCpk=";
};
meta = with lib; {