Skip to content

Commit

Permalink
cudaPackages_11_3.saxpy: fallback to the cudatoolkit runfile
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneSerge committed Dec 5, 2023
1 parent 182e6b4 commit e084a6c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkgs/development/compilers/cudatoolkit/saxpy/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{ autoAddOpenGLRunpathHook
, backendStdenv
, cmake
, cuda_cccl
, cuda_cudart
, cuda_cccl ? null
, cuda_cudart ? null
, cudaFlags
, cuda_nvcc
, cuda_nvcc ? null
, cudatoolkit ? null
, lib
, libcublas
, libcublas ? null
, setupCudaHook
, stdenv
}:
Expand All @@ -17,23 +18,24 @@ backendStdenv.mkDerivation {

src = ./.;

buildInputs = [
buildInputs = lib.optionals (cuda_cudart != null) [
libcublas
cuda_cudart
cuda_cccl
] ++ lib.optionals (cuda_cudart == null) [
cudatoolkit
];
nativeBuildInputs = [
cmake

# NOTE: this needs to be pkgs.buildPackages.cudaPackages_XX_Y.cuda_nvcc for
# cross-compilation to work. This should work automatically once we move to
# spliced scopes. Delete this comment once that happens
cuda_nvcc

# Alternatively, we could remove the propagated hook from cuda_nvcc and add
# directly:
# setupCudaHook
autoAddOpenGLRunpathHook
] ++ lib.optionals (cuda_nvcc != null) [
cuda_nvcc
] ++ lib.optionals (cuda_nvcc == null) [
cudatoolkit
];

cmakeFlags = [
Expand Down

0 comments on commit e084a6c

Please sign in to comment.