Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuda-modules: apply lessons learned from cross-compilation attempts #301416

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkgs/development/cuda-modules/backend-stdenv.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
cudaVersion,
lib,
nvccCompatibilities,
cudaVersion,
pkgs,
overrideCC,
stdenv,
wrapCCWith,
stdenvAdapters,
}:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ hostPlatform, lib }:
{ lib, stdenv }:
let
inherit (stdenv) hostPlatform;

# Samples are built around the CUDA Toolkit, which is not available for
# aarch64. Check for both CUDA version and platform.
platformIsSupported = hostPlatform.isx86_64 && hostPlatform.isLinux;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ in
# CUTENSOR_ROOT is double escaped
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "\''${CUTENSOR_ROOT}/include" "${cutensor.dev}/include"
--replace-fail "\''${CUTENSOR_ROOT}/include" "${cutensor.dev}/include"
'';

CUTENSOR_ROOT = cutensor;
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/cuda-modules/cuda-samples/extension.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
cudaVersion,
hostPlatform,
lib,
stdenv,
}:
let
cudaVersionToHash = {
Expand All @@ -23,6 +23,8 @@ let
"12.3" = "sha256-fjVp0G6uRCWxsfe+gOwWTN+esZfk0O5uxS623u0REAk=";
};

inherit (stdenv) hostPlatform;

# Samples are built around the CUDA Toolkit, which is not available for
# aarch64. Check for both CUDA version and platform.
cudaVersionIsSupported = cudaVersionToHash ? ${cudaVersion};
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/cuda-modules/cuda-samples/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
hash,
lib,
pkg-config,
stdenv,
}:
let
inherit (lib) lists strings;
Expand Down Expand Up @@ -63,7 +64,7 @@ backendStdenv.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall

install -Dm755 -t $out/bin bin/${backendStdenv.hostPlatform.parsed.cpu.name}/${backendStdenv.hostPlatform.parsed.kernel.name}/release/*
install -Dm755 -t $out/bin bin/${stdenv.hostPlatform.parsed.cpu.name}/${stdenv.hostPlatform.parsed.kernel.name}/release/*

runHook postInstall
'';
Expand Down
Loading