From 36ba5681fab9d18481dae80be0393eedc1f134d1 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 31 Mar 2023 17:36:54 +0300 Subject: [PATCH 01/11] faiss: respect config.cudaCapabilities --- .../libraries/science/math/faiss/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 3e4e227f83e2..9bc7eda5ab74 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -3,9 +3,8 @@ , fetchFromGitHub , stdenv , cmake -, cudaPackages +, cudaPackages ? { } , cudaSupport ? config.cudaSupport or false -, cudaCapabilities ? [ "60" "70" "80" "86" ] , pythonSupport ? true , pythonPackages , llvmPackages @@ -27,7 +26,8 @@ let pname = "faiss"; version = "1.7.2"; - inherit (cudaPackages) cudatoolkit; + inherit (cudaPackages) cudatoolkit cudaFlags; + inherit (cudaFlags) cudaCapabilities dropDot; in stdenv.mkDerivation { inherit pname version; @@ -72,7 +72,7 @@ stdenv.mkDerivation { "-DFAISS_ENABLE_PYTHON=${if pythonSupport then "ON" else "OFF"}" "-DFAISS_OPT_LEVEL=${optLevel}" ] ++ lib.optionals cudaSupport [ - "-DCMAKE_CUDA_ARCHITECTURES=${lib.concatStringsSep ";" cudaCapabilities}" + "-DCMAKE_CUDA_ARCHITECTURES=${builtins.concatStringsSep ";" (map dropDot cudaCapabilities)}" ]; @@ -101,6 +101,11 @@ stdenv.mkDerivation { addOpenGLRunpath $demos/bin/* ''; + # Need buildPythonPackage for this one + # pythonCheckImports = [ + # "faiss" + # ]; + passthru = { inherit cudaSupport cudaPackages pythonSupport; From 95d21285bd596cd2adc11f516d6a989599863440 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Apr 2022 16:57:03 +0300 Subject: [PATCH 02/11] nvidia-thrust: init at 1.16.0 --- .../libraries/nvidia-thrust/default.nix | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/development/libraries/nvidia-thrust/default.nix diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix new file mode 100644 index 000000000000..ea83b083d1b4 --- /dev/null +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -0,0 +1,61 @@ +{ lib +, fetchFromGitHub +, stdenv +, cmake +, cudaPackages +, symlinkJoin +}: +let + pname = "nvidia-thrust"; + version = "1.16.0"; + + # TODO: Would like to use this: + cudaJoined = symlinkJoin { + name = "cuda-packages-unsplit"; + paths = with cudaPackages; [ + cuda_nvcc + cuda_cudart # cuda_runtime.h + libcublas + ]; + }; +in +stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "NVIDIA"; + repo = "thrust"; + rev = version; + fetchSubmodules = true; + hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ="; + }; + + nativeBuildInputs = [ + cmake + + # goes in native build inputs because thrust looks for headers + # in a path relative to nvcc... + # + # Works when build=host, but we only support + # cuda on x86_64 anyway + + # TODO: but instead using this + # cudaJoined + cudaPackages.cudatoolkit + ]; + + cmakeFlags = [ + "-DTHRUST_INCLUDE_CUB_CMAKE=ON" + ]; + + meta = with lib; { + description = '' + A high-level C++ parallel algorithms library + that builds on top of CUDA, TBB, OpenMP, etc. + ''; + homepage = "https://github.com/NVIDIA/thrust"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ SomeoneSerge ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fca8efb5b8fc..2e16e72f19c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10306,6 +10306,8 @@ with pkgs; nvfetcher = haskell.lib.compose.justStaticExecutables haskellPackages.nvfetcher; + nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { }; + miller = callPackage ../tools/text/miller { }; milu = callPackage ../applications/misc/milu { }; From a0920575b42b84c406cfed2f91c30f6e5793e530 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Apr 2022 17:23:45 +0300 Subject: [PATCH 03/11] nvidia-thrust: allow omp/tbb instead of cuda --- .../libraries/nvidia-thrust/default.nix | 36 +++++++++++++++++-- pkgs/top-level/all-packages.nix | 8 +++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index ea83b083d1b4..13f562f24d23 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -1,10 +1,31 @@ { lib +, config , fetchFromGitHub , stdenv , cmake +, pkg-config +, cudaSupport ? config.cudaSupport or false , cudaPackages , symlinkJoin +, enableOpenmp ? true +, enableTbb ? false +, tbb +, hostSystem ? "CPP" +, deviceSystem ? let + devices = lib.optional cudaSupport "CUDA" + ++ lib.optional enableTbb "TBB" + ++ lib.optional enableOpenmp "OMP" + ++ [ "CPP" ]; + in + builtins.head devices }: + +assert builtins.elem deviceSystem [ "CPP" "OMP" "TBB" "CUDA" ]; +assert builtins.elem hostSystem [ "CPP" "OMP" "TBB" ]; +assert (deviceSystem == "CUDA") -> cudaSupport; +assert (builtins.elem "TBB" [ deviceSystem hostSystem ]) -> enableTbb; +assert (builtins.elem "OMP" [ deviceSystem hostSystem ]) -> enableOpenmp; + let pname = "nvidia-thrust"; version = "1.16.0"; @@ -30,12 +51,15 @@ stdenv.mkDerivation { hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ="; }; + buildInputs = lib.optional enableTbb tbb; + nativeBuildInputs = [ cmake - + pkg-config + ] ++ lib.optionals cudaSupport [ # goes in native build inputs because thrust looks for headers # in a path relative to nvcc... - # + # Works when build=host, but we only support # cuda on x86_64 anyway @@ -45,9 +69,15 @@ stdenv.mkDerivation { ]; cmakeFlags = [ - "-DTHRUST_INCLUDE_CUB_CMAKE=ON" + "-DTHRUST_INCLUDE_CUB_CMAKE=${if cudaSupport then "ON" else "OFF"}" + "-DTHRUST_DEVICE_SYSTEM=${deviceSystem}" + "-DTHRUST_HOST_SYSTEM=${hostSystem}" ]; + passthru = { + inherit cudaSupport cudaPackages; + }; + meta = with lib; { description = '' A high-level C++ parallel algorithms library diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2e16e72f19c3..4b706f254d6a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10308,6 +10308,14 @@ with pkgs; nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { }; + nvidia-thrust-intel = callPackage ../development/libraries/nvidia-thrust { + enableTbb = true; + }; + + nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust { + cudaSupport = true; + }; + miller = callPackage ../tools/text/miller { }; milu = callPackage ../applications/misc/milu { }; From 6087a4301c2a7b47a84b6632e079b977af537cd2 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Apr 2022 17:41:36 +0300 Subject: [PATCH 04/11] faiss: use the split cudaPackages ...still transitively relies on cudatoolkit (through nvidia-thrust) --- .../libraries/science/math/faiss/default.nix | 24 +++++++++++++++++-- pkgs/top-level/all-packages.nix | 5 ++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 9bc7eda5ab74..7ea2a913307e 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -1,13 +1,16 @@ { lib , config , fetchFromGitHub +, symlinkJoin , stdenv , cmake , cudaPackages ? { } , cudaSupport ? config.cudaSupport or false , pythonSupport ? true +, nvidia-thrust , pythonPackages , llvmPackages +, boost , blas , swig , addOpenGLRunpath @@ -23,11 +26,24 @@ , runCommand }: +assert cudaSupport -> nvidia-thrust.cudaSupport; + let pname = "faiss"; version = "1.7.2"; - inherit (cudaPackages) cudatoolkit cudaFlags; + + inherit (cudaPackages) cudaFlags; inherit (cudaFlags) cudaCapabilities dropDot; + + cudaJoined = symlinkJoin { + name = "cuda-packages-unsplit"; + paths = with cudaPackages; [ + cuda_cudart # cuda_runtime.h + libcublas + libcurand + cuda_nvprof # cuda_profiler_api.h + ]; + }; in stdenv.mkDerivation { inherit pname version; @@ -50,6 +66,9 @@ stdenv.mkDerivation { pythonPackages.wheel ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp + ] ++ lib.optionals cudaSupport [ + cudaJoined + nvidia-thrust ]; propagatedBuildInputs = lib.optionals pythonSupport [ @@ -57,7 +76,7 @@ stdenv.mkDerivation { ]; nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [ - cudatoolkit + cudaPackages.cuda_nvcc addOpenGLRunpath ] ++ lib.optionals pythonSupport [ pythonPackages.python @@ -73,6 +92,7 @@ stdenv.mkDerivation { "-DFAISS_OPT_LEVEL=${optLevel}" ] ++ lib.optionals cudaSupport [ "-DCMAKE_CUDA_ARCHITECTURES=${builtins.concatStringsSep ";" (map dropDot cudaCapabilities)}" + "-DCUDAToolkit_INCLUDE_DIR=${cudaJoined}/include" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4b706f254d6a..6db3ce73e06e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37804,6 +37804,11 @@ with pkgs; swig = swig4; }; + faissWithCuda = faiss.override { + cudaSupport = true; + nvidia-thrust = nvidia-thrust-cuda; + }; + fityk = callPackage ../applications/science/misc/fityk { }; galario = callPackage ../development/libraries/galario { }; From 2e5cb6f4d66f60dbb690064f5d2a5f74652cf36b Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 13 Apr 2022 02:37:57 +0300 Subject: [PATCH 05/11] nvidia-thrust: simplify parameters --- .../libraries/nvidia-thrust/default.nix | 22 ++++++------------- pkgs/top-level/all-packages.nix | 5 +++-- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index 13f562f24d23..f8b7518cd081 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -4,32 +4,24 @@ , stdenv , cmake , pkg-config -, cudaSupport ? config.cudaSupport or false , cudaPackages , symlinkJoin -, enableOpenmp ? true -, enableTbb ? false , tbb + # Upstream defaults: , hostSystem ? "CPP" -, deviceSystem ? let - devices = lib.optional cudaSupport "CUDA" - ++ lib.optional enableTbb "TBB" - ++ lib.optional enableOpenmp "OMP" - ++ [ "CPP" ]; - in - builtins.head devices +, deviceSystem ? if config.cudaSupport or false then "CUDA" else "CPP" }: assert builtins.elem deviceSystem [ "CPP" "OMP" "TBB" "CUDA" ]; assert builtins.elem hostSystem [ "CPP" "OMP" "TBB" ]; -assert (deviceSystem == "CUDA") -> cudaSupport; -assert (builtins.elem "TBB" [ deviceSystem hostSystem ]) -> enableTbb; -assert (builtins.elem "OMP" [ deviceSystem hostSystem ]) -> enableOpenmp; let pname = "nvidia-thrust"; version = "1.16.0"; + tbbSupport = builtins.elem "TBB" [ deviceSystem hostSystem ]; + cudaSupport = deviceSystem == "CUDA"; + # TODO: Would like to use this: cudaJoined = symlinkJoin { name = "cuda-packages-unsplit"; @@ -51,13 +43,13 @@ stdenv.mkDerivation { hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ="; }; - buildInputs = lib.optional enableTbb tbb; + buildInputs = lib.optionals tbbSupport [ tbb ]; nativeBuildInputs = [ cmake pkg-config ] ++ lib.optionals cudaSupport [ - # goes in native build inputs because thrust looks for headers + # Goes in native build inputs because thrust looks for headers # in a path relative to nvcc... # Works when build=host, but we only support diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6db3ce73e06e..18bade5fc0ff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10309,11 +10309,12 @@ with pkgs; nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { }; nvidia-thrust-intel = callPackage ../development/libraries/nvidia-thrust { - enableTbb = true; + hostSystem = "TBB"; + deviceSystem = if config.cudaSupport or false then "CUDA" else "TBB"; }; nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust { - cudaSupport = true; + deviceSystem = "CUDA"; }; miller = callPackage ../tools/text/miller { }; From 79046b7a5ebd2f882104d9eec1732c8a6612f4e2 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 13 Apr 2022 02:39:53 +0300 Subject: [PATCH 06/11] faiss: prefer optionals over optional --- pkgs/development/libraries/science/math/faiss/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 7ea2a913307e..48d22bf178ed 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -16,8 +16,8 @@ , addOpenGLRunpath , optLevel ? let optLevels = - lib.optional stdenv.hostPlatform.avx2Support "avx2" - ++ lib.optional stdenv.hostPlatform.sse4_1Support "sse4" + lib.optionals stdenv.hostPlatform.avx2Support [ "avx2" ] + ++ lib.optionals stdenv.hostPlatform.sse4_1Support [ "sse4" ] ++ [ "generic" ]; in # Choose the maximum available optimization level From 22eaf090a17873ad103fd585ed10c4a0ce2acdd9 Mon Sep 17 00:00:00 2001 From: Serge K Date: Wed, 13 Apr 2022 02:47:04 +0300 Subject: [PATCH 07/11] nvidia-thrust: one-liner meta.description Co-authored-by: Samuel Ainsworth --- pkgs/development/libraries/nvidia-thrust/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index f8b7518cd081..1c673837c28c 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -71,10 +71,7 @@ stdenv.mkDerivation { }; meta = with lib; { - description = '' - A high-level C++ parallel algorithms library - that builds on top of CUDA, TBB, OpenMP, etc. - ''; + description = "A high-level C++ parallel algorithms library that builds on top of CUDA, TBB, OpenMP, etc"; homepage = "https://github.com/NVIDIA/thrust"; license = licenses.asl20; platforms = platforms.unix; From 4965af4364c6af1ccc9c981542e11d38dac082de Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 13 Apr 2022 03:09:51 +0300 Subject: [PATCH 08/11] nvidia-thrust: explain (host|device)System --- .../libraries/nvidia-thrust/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index 1c673837c28c..545607ead2d1 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -7,12 +7,20 @@ , cudaPackages , symlinkJoin , tbb - # Upstream defaults: , hostSystem ? "CPP" -, deviceSystem ? if config.cudaSupport or false then "CUDA" else "CPP" +, deviceSystem ? if config.cudaSupport or false then "CUDA" else "OMP" }: -assert builtins.elem deviceSystem [ "CPP" "OMP" "TBB" "CUDA" ]; +# Policy for device_vector +assert builtins.elem deviceSystem [ + "CPP" # Serial on CPU + "OMP" # Parallel with OpenMP + "TBB" # Parallel with Intel TBB + "CUDA" # Parallel on GPU +]; + +# Policy for host_vector +# Always lives on CPU, but execution can be made parallel assert builtins.elem hostSystem [ "CPP" "OMP" "TBB" ]; let From 83b4eec3622f05a565fcf6976eaf92d4059d8a06 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 13 Apr 2022 23:11:57 +0300 Subject: [PATCH 09/11] nvidia-thrust: cudatoolkit -> redist cudaPackages --- .../libraries/nvidia-thrust/default.nix | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index 545607ead2d1..679b2c61c45a 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -4,7 +4,7 @@ , stdenv , cmake , pkg-config -, cudaPackages +, cudaPackages ? { } , symlinkJoin , tbb , hostSystem ? "CPP" @@ -27,6 +27,9 @@ let pname = "nvidia-thrust"; version = "1.16.0"; + inherit (cudaPackages) backendStdenv cudaFlags; + cudaCapabilities = map cudaFlags.dropDot cudaFlags.cudaCapabilities; + tbbSupport = builtins.elem "TBB" [ deviceSystem hostSystem ]; cudaSupport = deviceSystem == "CUDA"; @@ -35,9 +38,13 @@ let name = "cuda-packages-unsplit"; paths = with cudaPackages; [ cuda_nvcc + cuda_nvrtc # symbols: cudaLaunchDevice, &c; notice postBuild cuda_cudart # cuda_runtime.h libcublas ]; + postBuild = '' + ln -s $out/lib $out/lib64 + ''; }; in stdenv.mkDerivation { @@ -51,6 +58,15 @@ stdenv.mkDerivation { hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ="; }; + # NVIDIA's "compiler hacks" seem like work-arounds for legacy toolchains and + # cause us errors such as: + # > Thrust's test harness uses CMAKE_CXX_COMPILER for the CUDA host compiler. + # > Refusing to overwrite specified CMAKE_CUDA_HOST_COMPILER + # So we un-fix cmake after them: + postPatch = '' + echo > cmake/ThrustCompilerHacks.cmake + ''; + buildInputs = lib.optionals tbbSupport [ tbb ]; nativeBuildInputs = [ @@ -59,23 +75,21 @@ stdenv.mkDerivation { ] ++ lib.optionals cudaSupport [ # Goes in native build inputs because thrust looks for headers # in a path relative to nvcc... - - # Works when build=host, but we only support - # cuda on x86_64 anyway - - # TODO: but instead using this - # cudaJoined - cudaPackages.cudatoolkit + cudaJoined ]; cmakeFlags = [ "-DTHRUST_INCLUDE_CUB_CMAKE=${if cudaSupport then "ON" else "OFF"}" "-DTHRUST_DEVICE_SYSTEM=${deviceSystem}" "-DTHRUST_HOST_SYSTEM=${hostSystem}" - ]; + "-DTHRUST_AUTO_DETECT_COMPUTE_ARCHS=OFF" + "-DTHRUST_DISABLE_ARCH_BY_DEFAULT=ON" + ] ++ lib.optionals cudaFlags.enableForwardCompat [ + "-DTHRUST_ENABLE_COMPUTE_FUTURE=ON" + ] ++ map (sm: "THRUST_ENABLE_COMPUTE_${sm}") cudaCapabilities; passthru = { - inherit cudaSupport cudaPackages; + inherit cudaSupport cudaPackages cudaJoined; }; meta = with lib; { From 59013380135f1373a198b4eaf37782965d307258 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 14 Apr 2022 21:40:30 +0300 Subject: [PATCH 10/11] faiss: build with thrust from cuda_cccl ...instead of the separately built nvidia-thrust --- pkgs/development/libraries/science/math/faiss/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 48d22bf178ed..7ffd8f947e48 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -6,8 +6,9 @@ , cmake , cudaPackages ? { } , cudaSupport ? config.cudaSupport or false -, pythonSupport ? true , nvidia-thrust +, useThrustSourceBuild ? true +, pythonSupport ? true , pythonPackages , llvmPackages , boost @@ -42,6 +43,10 @@ let libcublas libcurand cuda_nvprof # cuda_profiler_api.h + ] ++ lib.optionals useThrustSourceBuild [ + nvidia-thrust + ] ++ lib.optionals (!useThrustSourceBuild) [ + cuda_cccl ]; }; in @@ -68,7 +73,6 @@ stdenv.mkDerivation { llvmPackages.openmp ] ++ lib.optionals cudaSupport [ cudaJoined - nvidia-thrust ]; propagatedBuildInputs = lib.optionals pythonSupport [ From 896c77f9dbd5b77ddb498b3573a1722f3a73bc32 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Sun, 9 Oct 2022 01:12:30 +0300 Subject: [PATCH 11/11] faiss: use cuda_profiler_api ...which is now, since cuda 11.8, separate from cuda_nvprof --- pkgs/development/libraries/science/math/faiss/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 7ffd8f947e48..2a6f144d862f 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -42,11 +42,14 @@ let cuda_cudart # cuda_runtime.h libcublas libcurand - cuda_nvprof # cuda_profiler_api.h ] ++ lib.optionals useThrustSourceBuild [ nvidia-thrust ] ++ lib.optionals (!useThrustSourceBuild) [ cuda_cccl + ] ++ lib.optionals (cudaPackages ? cuda_profiler_api) [ + cuda_profiler_api # cuda_profiler_api.h + ] ++ lib.optionals (!(cudaPackages ? cuda_profiler_api)) [ + cuda_nvprof # cuda_profiler_api.h ]; }; in