summaryrefslogtreecommitdiffstats
path: root/pkgs/development/compilers/cudatoolkit/extension.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/cudatoolkit/extension.nix')
-rw-r--r--pkgs/development/compilers/cudatoolkit/extension.nix24
1 files changed, 21 insertions, 3 deletions
diff --git a/pkgs/development/compilers/cudatoolkit/extension.nix b/pkgs/development/compilers/cudatoolkit/extension.nix
index c11f12b118a2..dd6f7ff2abe7 100644
--- a/pkgs/development/compilers/cudatoolkit/extension.nix
+++ b/pkgs/development/compilers/cudatoolkit/extension.nix
@@ -7,11 +7,29 @@ final: prev: let
# Version info for the classic cudatoolkit packages that contain everything that is in redist.
cudatoolkitVersions = final.lib.importTOML ./versions.toml;
+ finalVersion = cudatoolkitVersions.${final.cudaVersion};
+
+ # Exposed as cudaPackages.backendStdenv.
+ # We don't call it just "stdenv" to avoid confusion: e.g. this toolchain doesn't contain nvcc.
+ # Instead, it's the back-end toolchain for nvcc to use.
+ # We also use this to link a compatible libstdc++ (backendStdenv.cc.cc.lib)
+ # Cf. https://github.com/NixOS/nixpkgs/pull/218265 for context
+ backendStdenv = prev.pkgs."${finalVersion.gcc}Stdenv";
+
### Add classic cudatoolkit package
- cudatoolkit = buildCudaToolkitPackage ((attrs: attrs // { gcc = prev.pkgs.${attrs.gcc}; }) cudatoolkitVersions.${final.cudaVersion});
+ cudatoolkit =
+ let
+ attrs = builtins.removeAttrs finalVersion [ "gcc" ];
+ attrs' = attrs // { inherit backendStdenv; };
+ in
+ buildCudaToolkitPackage attrs';
cudaFlags = final.callPackage ./flags.nix {};
-in {
- inherit cudatoolkit cudaFlags;
+in
+{
+ inherit
+ backendStdenv
+ cudatoolkit
+ cudaFlags;
}