Unverified Commit c66994ce authored by Connor Baker's avatar Connor Baker Committed by GitHub
Browse files

Merge pull request #301416 from...

Merge pull request #301416 from ConnorBaker/feat/cudaPackages-lessons-learned-from-cross-compilation-attempt

cuda-modules: apply lessons learned from cross-compilation attempts
parents caaff6c4 6208368a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
{
  cudaVersion,
  lib,
  nvccCompatibilities,
  cudaVersion,
  pkgs,
  overrideCC,
  stdenv,
  wrapCCWith,
  stdenvAdapters,
}:

+3 −1
Original line number Diff line number Diff line
{ 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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+3 −1
Original line number Diff line number Diff line
{
  cudaVersion,
  hostPlatform,
  lib,
  stdenv,
}:
let
  cudaVersionToHash = {
@@ -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};
+2 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
  hash,
  lib,
  pkg-config,
  stdenv,
}:
let
  inherit (lib) lists strings;
@@ -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
  '';
Loading