Merge pull request #112636 from danieldk/magma-cuda-11
magma: fix CUDA 11 build
This commit is contained in:
commit
a4816f7a0d
@ -1,8 +1,40 @@
|
|||||||
{ lib, stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
|
{ lib, stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
|
||||||
|
|
||||||
with lib;
|
assert let majorIs = lib.versions.major cudatoolkit.version;
|
||||||
|
in majorIs == "9" || majorIs == "10" || majorIs == "11";
|
||||||
|
|
||||||
let version = "2.5.4";
|
let
|
||||||
|
version = "2.5.4";
|
||||||
|
|
||||||
|
# We define a specific set of CUDA compute capabilities here,
|
||||||
|
# because CUDA 11 does not support compute capability 3.0. Also,
|
||||||
|
# we use it to enable newer capabilities that are not enabled
|
||||||
|
# by magma by default. The list of supported architectures
|
||||||
|
# can be found in magma's top-level CMakeLists.txt.
|
||||||
|
cudaCapabilities = rec {
|
||||||
|
cuda9 = [
|
||||||
|
"Kepler" # 3.0, 3.5
|
||||||
|
"Maxwell" # 5.0
|
||||||
|
"Pascal" # 6.0
|
||||||
|
"Volta" # 7.0
|
||||||
|
];
|
||||||
|
|
||||||
|
cuda10 = [
|
||||||
|
"Turing" # 7.5
|
||||||
|
] ++ cuda9;
|
||||||
|
|
||||||
|
cuda11 = [
|
||||||
|
"sm_35" # sm_30 is not supported by CUDA 11
|
||||||
|
"Maxwell" # 5.0
|
||||||
|
"Pascal" # 6.0
|
||||||
|
"Volta" # 7.0
|
||||||
|
"Turing" # 7.5
|
||||||
|
"Ampere" # 8.0
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
capabilityString = lib.strings.concatStringsSep ","
|
||||||
|
cudaCapabilities."cuda${lib.versions.major cudatoolkit.version}";
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
pname = "magma";
|
pname = "magma";
|
||||||
@ -17,6 +49,8 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
buildInputs = [ cudatoolkit libpthreadstubs lapack blas ];
|
buildInputs = [ cudatoolkit libpthreadstubs lapack blas ];
|
||||||
|
|
||||||
|
cmakeFlags = [ "-DGPU_TARGET=${capabilityString}" ];
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user