2022-04-15 01:41:22 +00:00
|
|
|
final: prev: let
|
|
|
|
### Cuda Toolkit
|
|
|
|
|
|
|
|
# Function to build the class cudatoolkit package
|
|
|
|
buildCudaToolkitPackage = final.callPackage ./common.nix;
|
|
|
|
|
|
|
|
# Version info for the classic cudatoolkit packages that contain everything that is in redist.
|
|
|
|
cudatoolkitVersions = final.lib.importTOML ./versions.toml;
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
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";
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
### Add classic cudatoolkit package
|
2023-03-08 16:32:21 +00:00
|
|
|
cudatoolkit =
|
|
|
|
let
|
|
|
|
attrs = builtins.removeAttrs finalVersion [ "gcc" ];
|
|
|
|
attrs' = attrs // { inherit backendStdenv; };
|
|
|
|
in
|
|
|
|
buildCudaToolkitPackage attrs';
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
cudaFlags = final.callPackage ./flags.nix {};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit
|
|
|
|
backendStdenv
|
|
|
|
cudatoolkit
|
|
|
|
cudaFlags;
|
2022-04-15 01:41:22 +00:00
|
|
|
}
|