Merge pull request #299578 from ConnorBaker/fix/treewide-cuda-reformat-nixfmt-rfc-style-2024-03-01
treewide: CUDA reformat with `nixfmt-rfc-style`
This commit is contained in:
@@ -102,3 +102,6 @@ fb0e5be84331188a69b3edd31679ca6576edb75a
|
|||||||
|
|
||||||
# systemd: break too long lines of Nix code
|
# systemd: break too long lines of Nix code
|
||||||
67643f8ec84bef1482204709073e417c9f07eb87
|
67643f8ec84bef1482204709073e417c9f07eb87
|
||||||
|
|
||||||
|
# {pkgs/development/cuda-modules,pkgs/test/cuda,pkgs/top-level/cuda-packages.nix}: reformat all CUDA files with nixfmt-rfc-style 2023-03-01
|
||||||
|
802a1b4d3338f24cbc4efd704616654456d75a94
|
||||||
|
|||||||
50
.github/workflows/check-nix-format.yml
vendored
Normal file
50
.github/workflows/check-nix-format.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# This file was copied mostly from check-maintainers-sorted.yaml.
|
||||||
|
# NOTE: Formatting with the RFC-style nixfmt command is not yet stable. See
|
||||||
|
# https://github.com/NixOS/rfcs/pull/166.
|
||||||
|
# Because of this, this action is not yet enabled for all files -- only for
|
||||||
|
# those who have opted in.
|
||||||
|
name: Check that Nix files are formatted
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
nixos:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository_owner == 'NixOS'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
|
||||||
|
with:
|
||||||
|
# pull_request_target checks out the base branch by default
|
||||||
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||||
|
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
|
||||||
|
with:
|
||||||
|
# explicitly enable sandbox
|
||||||
|
extra_nix_config: sandbox = true
|
||||||
|
- name: Install nixfmt
|
||||||
|
run: nix-env -f default.nix -iAP nixfmt-rfc-style
|
||||||
|
- name: Check that Nix files are formatted according to the RFC style
|
||||||
|
# Each environment variable beginning with NIX_FMT_PATHS_ is a list of
|
||||||
|
# paths to check with nixfmt.
|
||||||
|
env:
|
||||||
|
# Format paths related to the Nixpkgs CUDA ecosystem.
|
||||||
|
NIX_FMT_PATHS_CUDA: |
|
||||||
|
pkgs/development/cuda-modules
|
||||||
|
pkgs/test/cuda
|
||||||
|
pkgs/top-level/cuda-packages.nix
|
||||||
|
# Iterate over all environment variables beginning with NIX_FMT_PATHS_.
|
||||||
|
run: |
|
||||||
|
for env_var in "${!NIX_FMT_PATHS_@}"; do
|
||||||
|
readarray -t paths <<< "${!env_var}"
|
||||||
|
if [[ "${paths[*]}" == "" ]]; then
|
||||||
|
echo "Error: $env_var is empty."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Checking paths: ${paths[@]}"
|
||||||
|
if ! nixfmt --check "${paths[@]}"; then
|
||||||
|
echo "Error: nixfmt failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -21,6 +21,6 @@ let
|
|||||||
assertCondition = true;
|
assertCondition = true;
|
||||||
in
|
in
|
||||||
|
|
||||||
/* TODO: Consider testing whether we in fact use the newer libstdc++ */
|
# TODO: Consider testing whether we in fact use the newer libstdc++
|
||||||
|
|
||||||
lib.extendDerivation assertCondition passthruExtra cudaStdenv
|
lib.extendDerivation assertCondition passthruExtra cudaStdenv
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) lists strings;
|
inherit (lib) lists strings;
|
||||||
in
|
in
|
||||||
backendStdenv.mkDerivation (
|
backendStdenv.mkDerivation (finalAttrs: {
|
||||||
finalAttrs: {
|
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
pname = "cuda-samples";
|
pname = "cuda-samples";
|
||||||
@@ -75,5 +74,4 @@ backendStdenv.mkDerivation (
|
|||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
maintainers = with lib.maintainers; [ obsidian-systems-maintenance ] ++ lib.teams.cuda.members;
|
maintainers = with lib.maintainers; [ obsidian-systems-maintenance ] ++ lib.teams.cuda.members;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ let
|
|||||||
featureRelease
|
featureRelease
|
||||||
;
|
;
|
||||||
}).overrideAttrs
|
}).overrideAttrs
|
||||||
(
|
(prevAttrs: {
|
||||||
prevAttrs: {
|
|
||||||
# Add the package-specific license.
|
# Add the package-specific license.
|
||||||
meta = prevAttrs.meta // {
|
meta = prevAttrs.meta // {
|
||||||
license =
|
license =
|
||||||
@@ -78,8 +77,7 @@ let
|
|||||||
in
|
in
|
||||||
lib.licenses.nvidiaCudaRedist // { inherit url; };
|
lib.licenses.nvidiaCudaRedist // { inherit url; };
|
||||||
};
|
};
|
||||||
}
|
});
|
||||||
);
|
|
||||||
in
|
in
|
||||||
drv;
|
drv;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
{cudaVersion, lib, addDriverRunpath}:
|
{
|
||||||
|
cudaVersion,
|
||||||
|
lib,
|
||||||
|
addDriverRunpath,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) attrsets lists strings;
|
inherit (lib) attrsets lists strings;
|
||||||
# cudaVersionOlder : Version -> Boolean
|
# cudaVersionOlder : Version -> Boolean
|
||||||
@@ -8,15 +12,16 @@ let
|
|||||||
|
|
||||||
addBuildInputs =
|
addBuildInputs =
|
||||||
drv: buildInputs:
|
drv: buildInputs:
|
||||||
drv.overrideAttrs (prevAttrs: {buildInputs = prevAttrs.buildInputs ++ buildInputs;});
|
drv.overrideAttrs (prevAttrs: {
|
||||||
|
buildInputs = prevAttrs.buildInputs ++ buildInputs;
|
||||||
|
});
|
||||||
in
|
in
|
||||||
# NOTE: Filter out attributes that are not present in the previous version of
|
# NOTE: Filter out attributes that are not present in the previous version of
|
||||||
# the package set. This is necessary to prevent the appearance of attributes
|
# the package set. This is necessary to prevent the appearance of attributes
|
||||||
# like `cuda_nvcc` in `cudaPackages_10_0, which predates redistributables.
|
# like `cuda_nvcc` in `cudaPackages_10_0, which predates redistributables.
|
||||||
final: prev:
|
final: prev:
|
||||||
attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
||||||
libcufile = prev.libcufile.overrideAttrs (
|
libcufile = prev.libcufile.overrideAttrs (prevAttrs: {
|
||||||
prevAttrs: {
|
|
||||||
buildInputs = prevAttrs.buildInputs ++ [
|
buildInputs = prevAttrs.buildInputs ++ [
|
||||||
final.libcublas.lib
|
final.libcublas.lib
|
||||||
final.pkgs.numactl
|
final.pkgs.numactl
|
||||||
@@ -26,8 +31,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
autoPatchelfIgnoreMissingDeps =
|
autoPatchelfIgnoreMissingDeps =
|
||||||
prevAttrs.autoPatchelfIgnoreMissingDeps
|
prevAttrs.autoPatchelfIgnoreMissingDeps
|
||||||
++ lists.optionals (cudaVersionOlder "11.7") [ "libcufile.so.0" ];
|
++ lists.optionals (cudaVersionOlder "11.7") [ "libcufile.so.0" ];
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
libcusolver = addBuildInputs prev.libcusolver (
|
libcusolver = addBuildInputs prev.libcusolver (
|
||||||
# Always depends on this
|
# Always depends on this
|
||||||
@@ -42,8 +46,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
lists.optionals (cudaVersionAtLeast "12.0") [ final.libnvjitlink.lib ]
|
lists.optionals (cudaVersionAtLeast "12.0") [ final.libnvjitlink.lib ]
|
||||||
);
|
);
|
||||||
|
|
||||||
cuda_cudart = prev.cuda_cudart.overrideAttrs (
|
cuda_cudart = prev.cuda_cudart.overrideAttrs (prevAttrs: {
|
||||||
prevAttrs: {
|
|
||||||
# Remove once cuda-find-redist-features has a special case for libcuda
|
# Remove once cuda-find-redist-features has a special case for libcuda
|
||||||
outputs =
|
outputs =
|
||||||
prevAttrs.outputs
|
prevAttrs.outputs
|
||||||
@@ -77,11 +80,9 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
|
ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
|
||||||
ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
|
ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
|
||||||
'';
|
'';
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
cuda_compat = prev.cuda_compat.overrideAttrs (
|
cuda_compat = prev.cuda_compat.overrideAttrs (prevAttrs: {
|
||||||
prevAttrs: {
|
|
||||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
||||||
"libnvrm_gpu.so"
|
"libnvrm_gpu.so"
|
||||||
"libnvrm_mem.so"
|
"libnvrm_mem.so"
|
||||||
@@ -92,8 +93,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
"Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" =
|
"Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" =
|
||||||
!final.flags.isJetsonBuild;
|
!final.flags.isJetsonBuild;
|
||||||
};
|
};
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
cuda_gdb = addBuildInputs prev.cuda_gdb (
|
cuda_gdb = addBuildInputs prev.cuda_gdb (
|
||||||
# x86_64 only needs gmp from 12.0 and on
|
# x86_64 only needs gmp from 12.0 and on
|
||||||
@@ -176,9 +176,9 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
cuda_nvprof = prev.cuda_nvprof.overrideAttrs (
|
cuda_nvprof = prev.cuda_nvprof.overrideAttrs (prevAttrs: {
|
||||||
prevAttrs: {buildInputs = prevAttrs.buildInputs ++ [final.cuda_cupti.lib];}
|
buildInputs = prevAttrs.buildInputs ++ [ final.cuda_cupti.lib ];
|
||||||
);
|
});
|
||||||
|
|
||||||
cuda_demo_suite = addBuildInputs prev.cuda_demo_suite [
|
cuda_demo_suite = addBuildInputs prev.cuda_demo_suite [
|
||||||
final.pkgs.freeglut
|
final.pkgs.freeglut
|
||||||
@@ -189,8 +189,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
final.libcurand.lib
|
final.libcurand.lib
|
||||||
];
|
];
|
||||||
|
|
||||||
nsight_compute = prev.nsight_compute.overrideAttrs (
|
nsight_compute = prev.nsight_compute.overrideAttrs (prevAttrs: {
|
||||||
prevAttrs: {
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
prevAttrs.nativeBuildInputs
|
prevAttrs.nativeBuildInputs
|
||||||
++ (
|
++ (
|
||||||
@@ -207,8 +206,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
|||||||
else
|
else
|
||||||
[ final.pkgs.qt6.qtwebview ]
|
[ final.pkgs.qt6.qtwebview ]
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
nsight_systems = prev.nsight_systems.overrideAttrs (
|
nsight_systems = prev.nsight_systems.overrideAttrs (
|
||||||
prevAttrs:
|
prevAttrs:
|
||||||
|
|||||||
@@ -144,8 +144,7 @@ backendStdenv.mkDerivation rec {
|
|||||||
gst_all_1.gstreamer
|
gst_all_1.gstreamer
|
||||||
gst_all_1.gst-plugins-base
|
gst_all_1.gst-plugins-base
|
||||||
])
|
])
|
||||||
++ (
|
++ (with qt6; [
|
||||||
with qt6; [
|
|
||||||
qtmultimedia
|
qtmultimedia
|
||||||
qttools
|
qttools
|
||||||
qtpositioning
|
qtpositioning
|
||||||
@@ -153,8 +152,7 @@ backendStdenv.mkDerivation rec {
|
|||||||
qtsvg
|
qtsvg
|
||||||
qtwebchannel
|
qtwebchannel
|
||||||
qtwebengine
|
qtwebengine
|
||||||
]
|
])
|
||||||
)
|
|
||||||
));
|
));
|
||||||
|
|
||||||
# Prepended to runpaths by autoPatchelf.
|
# Prepended to runpaths by autoPatchelf.
|
||||||
@@ -170,7 +168,8 @@ backendStdenv.mkDerivation rec {
|
|||||||
"${placeholder "out"}/nvvm/lib64"
|
"${placeholder "out"}/nvvm/lib64"
|
||||||
];
|
];
|
||||||
|
|
||||||
autoPatchelfIgnoreMissingDeps = [
|
autoPatchelfIgnoreMissingDeps =
|
||||||
|
[
|
||||||
# This is the hardware-dependent userspace driver that comes from
|
# This is the hardware-dependent userspace driver that comes from
|
||||||
# nvidia_x11 package. It must be deployed at runtime in
|
# nvidia_x11 package. It must be deployed at runtime in
|
||||||
# /run/opengl-driver/lib or pointed at by LD_LIBRARY_PATH variable, rather
|
# /run/opengl-driver/lib or pointed at by LD_LIBRARY_PATH variable, rather
|
||||||
@@ -182,7 +181,8 @@ backendStdenv.mkDerivation rec {
|
|||||||
# This dependency is asked for by target-linux-x64/CollectX/RedHat/x86_64/libssl.so.10
|
# This dependency is asked for by target-linux-x64/CollectX/RedHat/x86_64/libssl.so.10
|
||||||
# - do we even want to use nvidia-shipped libssl?
|
# - do we even want to use nvidia-shipped libssl?
|
||||||
"libcom_err.so.2"
|
"libcom_err.so.2"
|
||||||
] ++ lib.optionals (lib.versionOlder version "10.1") [
|
]
|
||||||
|
++ lib.optionals (lib.versionOlder version "10.1") [
|
||||||
# For Cuda 10.0, nVidia also shipped a jre implementation which needed
|
# For Cuda 10.0, nVidia also shipped a jre implementation which needed
|
||||||
# two old versions of ffmpeg which are not available in nixpkgs
|
# two old versions of ffmpeg which are not available in nixpkgs
|
||||||
"libavcodec.so.54"
|
"libavcodec.so.54"
|
||||||
@@ -282,7 +282,14 @@ backendStdenv.mkDerivation rec {
|
|||||||
for qtlib in $out/host-linux-x64/Plugins/*/libq*.so; do
|
for qtlib in $out/host-linux-x64/Plugins/*/libq*.so; do
|
||||||
qtdir=$(basename $(dirname $qtlib))
|
qtdir=$(basename $(dirname $qtlib))
|
||||||
filename=$(basename $qtlib)
|
filename=$(basename $qtlib)
|
||||||
for qtpkgdir in ${lib.concatMapStringsSep " " (x: qt6Packages.${x}) ["qtbase" "qtimageformats" "qtsvg" "qtwayland"]}; do
|
for qtpkgdir in ${
|
||||||
|
lib.concatMapStringsSep " " (x: qt6Packages.${x}) [
|
||||||
|
"qtbase"
|
||||||
|
"qtimageformats"
|
||||||
|
"qtsvg"
|
||||||
|
"qtwayland"
|
||||||
|
]
|
||||||
|
}; do
|
||||||
if [ -e $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename ]; then
|
if [ -e $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename ]; then
|
||||||
ln -snf $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename $qtlib
|
ln -snf $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename $qtlib
|
||||||
fi
|
fi
|
||||||
@@ -303,8 +310,9 @@ backendStdenv.mkDerivation rec {
|
|||||||
''}
|
''}
|
||||||
|
|
||||||
# Remove some cruft.
|
# Remove some cruft.
|
||||||
${lib.optionalString ((lib.versionAtLeast version "7.0") && (lib.versionOlder version "10.1"))
|
${lib.optionalString (
|
||||||
"rm $out/bin/uninstall*"}
|
(lib.versionAtLeast version "7.0") && (lib.versionOlder version "10.1")
|
||||||
|
) "rm $out/bin/uninstall*"}
|
||||||
|
|
||||||
# Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
|
# Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
|
||||||
if [ -d "$out"/cuda-samples ]; then
|
if [ -d "$out"/cuda-samples ]; then
|
||||||
@@ -360,8 +368,7 @@ backendStdenv.mkDerivation rec {
|
|||||||
wrapProgram "$out/bin/$b" \
|
wrapProgram "$out/bin/$b" \
|
||||||
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
|
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
|
||||||
done
|
done
|
||||||
${
|
${lib.optionalString (lib.versionAtLeast version "12")
|
||||||
lib.optionalString (lib.versionAtLeast version "12")
|
|
||||||
# Check we don't have any lurking vendored qt libraries that weren't
|
# Check we don't have any lurking vendored qt libraries that weren't
|
||||||
# replaced during installPhase
|
# replaced during installPhase
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -51,13 +51,11 @@ finalAttrs: prevAttrs: {
|
|||||||
homepage = "https://developer.nvidia.com/cudnn";
|
homepage = "https://developer.nvidia.com/cudnn";
|
||||||
maintainers =
|
maintainers =
|
||||||
prevAttrs.meta.maintainers
|
prevAttrs.meta.maintainers
|
||||||
++ (
|
++ (with maintainers; [
|
||||||
with maintainers; [
|
|
||||||
mdaiter
|
mdaiter
|
||||||
samuela
|
samuela
|
||||||
connorbaker
|
connorbaker
|
||||||
]
|
]);
|
||||||
);
|
|
||||||
license = {
|
license = {
|
||||||
shortName = "cuDNN EULA";
|
shortName = "cuDNN EULA";
|
||||||
fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
|
fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
|
||||||
|
|||||||
@@ -65,12 +65,10 @@ let
|
|||||||
# Un-nest the manifests attribute set.
|
# Un-nest the manifests attribute set.
|
||||||
releaseGrabber = evaluatedModules: evaluatedModules.config.cutensor.manifests;
|
releaseGrabber = evaluatedModules: evaluatedModules.config.cutensor.manifests;
|
||||||
in
|
in
|
||||||
lists.map
|
lists.map (trivial.flip trivial.pipe [
|
||||||
(trivial.flip trivial.pipe [
|
|
||||||
configEvaluator
|
configEvaluator
|
||||||
releaseGrabber
|
releaseGrabber
|
||||||
])
|
]) cutensorVersions;
|
||||||
cutensorVersions;
|
|
||||||
|
|
||||||
# Our cudaVersion tells us which version of CUDA we're building against.
|
# Our cudaVersion tells us which version of CUDA we're building against.
|
||||||
# The subdirectories in lib/ tell us which versions of CUDA are supported.
|
# The subdirectories in lib/ tell us which versions of CUDA are supported.
|
||||||
@@ -97,14 +95,10 @@ let
|
|||||||
# platformIsSupported :: Manifests -> Boolean
|
# platformIsSupported :: Manifests -> Boolean
|
||||||
platformIsSupported =
|
platformIsSupported =
|
||||||
{ feature, ... }:
|
{ feature, ... }:
|
||||||
(attrsets.attrByPath
|
(attrsets.attrByPath [
|
||||||
[
|
|
||||||
pname
|
pname
|
||||||
redistArch
|
redistArch
|
||||||
]
|
] null feature) != null;
|
||||||
null
|
|
||||||
feature
|
|
||||||
) != null;
|
|
||||||
|
|
||||||
# TODO(@connorbaker): With an auxilliary file keeping track of the CUDA versions each release supports,
|
# TODO(@connorbaker): With an auxilliary file keeping track of the CUDA versions each release supports,
|
||||||
# we could filter out releases that don't support our CUDA version.
|
# we could filter out releases that don't support our CUDA version.
|
||||||
@@ -129,8 +123,7 @@ let
|
|||||||
redistribRelease = redistrib.${pname};
|
redistribRelease = redistrib.${pname};
|
||||||
featureRelease = feature.${pname};
|
featureRelease = feature.${pname};
|
||||||
};
|
};
|
||||||
fixedDrv = drv.overrideAttrs (
|
fixedDrv = drv.overrideAttrs (prevAttrs: {
|
||||||
prevAttrs: {
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
prevAttrs.buildInputs
|
prevAttrs.buildInputs
|
||||||
++ lists.optionals (strings.versionOlder cudaVersion "11.4") [ final.cudatoolkit ]
|
++ lists.optionals (strings.versionOlder cudaVersion "11.4") [ final.cudatoolkit ]
|
||||||
@@ -149,8 +142,7 @@ let
|
|||||||
url = "https://docs.nvidia.com/cuda/cutensor/license.html";
|
url = "https://docs.nvidia.com/cuda/cutensor/license.html";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
});
|
||||||
);
|
|
||||||
in
|
in
|
||||||
attrsets.nameValuePair (computeName redistrib.${pname}) fixedDrv;
|
attrsets.nameValuePair (computeName redistrib.${pname}) fixedDrv;
|
||||||
|
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ let
|
|||||||
# cudaArchNameToVersions :: AttrSet String (List String)
|
# cudaArchNameToVersions :: AttrSet String (List String)
|
||||||
# Maps the name of a GPU architecture to different versions of that architecture.
|
# Maps the name of a GPU architecture to different versions of that architecture.
|
||||||
# For example, "Ampere" maps to [ "8.0" "8.6" "8.7" ].
|
# For example, "Ampere" maps to [ "8.0" "8.6" "8.7" ].
|
||||||
cudaArchNameToVersions =
|
cudaArchNameToVersions = lists.groupBy' (versions: gpu: versions ++ [ gpu.computeCapability ]) [ ] (
|
||||||
lists.groupBy' (versions: gpu: versions ++ [gpu.computeCapability]) [] (gpu: gpu.archName)
|
gpu: gpu.archName
|
||||||
supportedGpus;
|
) supportedGpus;
|
||||||
|
|
||||||
# cudaComputeCapabilityToName :: AttrSet String String
|
# cudaComputeCapabilityToName :: AttrSet String String
|
||||||
# Maps the version of a GPU architecture to the name of that architecture.
|
# Maps the version of a GPU architecture to the name of that architecture.
|
||||||
@@ -135,7 +135,9 @@ let
|
|||||||
# `all-packages.nix`, which is evaluated on all systems. As such, we need to handle unsupported
|
# `all-packages.nix`, which is evaluated on all systems. As such, we need to handle unsupported
|
||||||
# systems gracefully.
|
# systems gracefully.
|
||||||
# getRedistArch :: String -> String
|
# getRedistArch :: String -> String
|
||||||
getRedistArch = nixSystem: attrsets.attrByPath [ nixSystem ] "unsupported" {
|
getRedistArch =
|
||||||
|
nixSystem:
|
||||||
|
attrsets.attrByPath [ nixSystem ] "unsupported" {
|
||||||
aarch64-linux = if jetsonTargets != [ ] then "linux-aarch64" else "linux-sbsa";
|
aarch64-linux = if jetsonTargets != [ ] then "linux-aarch64" else "linux-sbsa";
|
||||||
x86_64-linux = "linux-x86_64";
|
x86_64-linux = "linux-x86_64";
|
||||||
ppc64le-linux = "linux-ppc64le";
|
ppc64le-linux = "linux-ppc64le";
|
||||||
@@ -147,7 +149,9 @@ let
|
|||||||
# `all-packages.nix`, which is evaluated on all systems. As such, we need to handle unsupported
|
# `all-packages.nix`, which is evaluated on all systems. As such, we need to handle unsupported
|
||||||
# systems gracefully.
|
# systems gracefully.
|
||||||
# getNixSystem :: String -> String
|
# getNixSystem :: String -> String
|
||||||
getNixSystem = redistArch: attrsets.attrByPath [ redistArch ] "unsupported-${redistArch}" {
|
getNixSystem =
|
||||||
|
redistArch:
|
||||||
|
attrsets.attrByPath [ redistArch ] "unsupported-${redistArch}" {
|
||||||
linux-sbsa = "aarch64-linux";
|
linux-sbsa = "aarch64-linux";
|
||||||
linux-aarch64 = "aarch64-linux";
|
linux-aarch64 = "aarch64-linux";
|
||||||
linux-x86_64 = "x86_64-linux";
|
linux-x86_64 = "x86_64-linux";
|
||||||
@@ -209,17 +213,16 @@ let
|
|||||||
# isJetsonBuild :: Boolean
|
# isJetsonBuild :: Boolean
|
||||||
isJetsonBuild =
|
isJetsonBuild =
|
||||||
let
|
let
|
||||||
requestedJetsonDevices =
|
requestedJetsonDevices = lists.filter (
|
||||||
lists.filter (cap: cudaComputeCapabilityToIsJetson.${cap} or false)
|
cap: cudaComputeCapabilityToIsJetson.${cap} or false
|
||||||
cudaCapabilities;
|
) cudaCapabilities;
|
||||||
requestedNonJetsonDevices =
|
requestedNonJetsonDevices = lists.filter (
|
||||||
lists.filter (cap: !(builtins.elem cap requestedJetsonDevices))
|
cap: !(builtins.elem cap requestedJetsonDevices)
|
||||||
cudaCapabilities;
|
) cudaCapabilities;
|
||||||
jetsonBuildSufficientCondition = requestedJetsonDevices != [ ];
|
jetsonBuildSufficientCondition = requestedJetsonDevices != [ ];
|
||||||
jetsonBuildNecessaryCondition = requestedNonJetsonDevices == [ ] && hostPlatform.isAarch64;
|
jetsonBuildNecessaryCondition = requestedNonJetsonDevices == [ ] && hostPlatform.isAarch64;
|
||||||
in
|
in
|
||||||
trivial.throwIf (jetsonBuildSufficientCondition && !jetsonBuildNecessaryCondition)
|
trivial.throwIf (jetsonBuildSufficientCondition && !jetsonBuildNecessaryCondition) ''
|
||||||
''
|
|
||||||
Jetson devices cannot be targeted with non-Jetson devices. Additionally, they require hostPlatform to be aarch64.
|
Jetson devices cannot be targeted with non-Jetson devices. Additionally, they require hostPlatform to be aarch64.
|
||||||
You requested ${builtins.toJSON cudaCapabilities} for host platform ${hostPlatform.system}.
|
You requested ${builtins.toJSON cudaCapabilities} for host platform ${hostPlatform.system}.
|
||||||
Requested Jetson devices: ${builtins.toJSON requestedJetsonDevices}.
|
Requested Jetson devices: ${builtins.toJSON requestedJetsonDevices}.
|
||||||
@@ -228,13 +231,13 @@ let
|
|||||||
- All CUDA capabilities belong to Jetson devices and hostPlatform is aarch64.
|
- All CUDA capabilities belong to Jetson devices and hostPlatform is aarch64.
|
||||||
- No CUDA capabilities belong to Jetson devices.
|
- No CUDA capabilities belong to Jetson devices.
|
||||||
See ${./gpus.nix} for a list of architectures supported by this version of Nixpkgs.
|
See ${./gpus.nix} for a list of architectures supported by this version of Nixpkgs.
|
||||||
''
|
'' jetsonBuildSufficientCondition
|
||||||
jetsonBuildSufficientCondition
|
|
||||||
&& jetsonBuildNecessaryCondition;
|
&& jetsonBuildNecessaryCondition;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# When changing names or formats: pause, validate, and update the assert
|
# When changing names or formats: pause, validate, and update the assert
|
||||||
assert let
|
assert
|
||||||
|
let
|
||||||
expected = {
|
expected = {
|
||||||
cudaCapabilities = [
|
cudaCapabilities = [
|
||||||
"7.5"
|
"7.5"
|
||||||
@@ -284,7 +287,8 @@ asserts.assertMsg ((strings.versionAtLeast cudaVersion "11.2") -> (expected == a
|
|||||||
Actual: ${builtins.toJSON actualWrapped}
|
Actual: ${builtins.toJSON actualWrapped}
|
||||||
'';
|
'';
|
||||||
# Check mixed Jetson and non-Jetson devices
|
# Check mixed Jetson and non-Jetson devices
|
||||||
assert let
|
assert
|
||||||
|
let
|
||||||
expected = false;
|
expected = false;
|
||||||
actual = formatCapabilities {
|
actual = formatCapabilities {
|
||||||
cudaCapabilities = [
|
cudaCapabilities = [
|
||||||
@@ -301,7 +305,8 @@ asserts.assertMsg (expected == actualWrapped) ''
|
|||||||
Actual: ${builtins.toJSON actualWrapped}
|
Actual: ${builtins.toJSON actualWrapped}
|
||||||
'';
|
'';
|
||||||
# Check Jetson-only
|
# Check Jetson-only
|
||||||
assert let
|
assert
|
||||||
|
let
|
||||||
expected = {
|
expected = {
|
||||||
cudaCapabilities = [
|
cudaCapabilities = [
|
||||||
"6.2"
|
"6.2"
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ let
|
|||||||
|
|
||||||
sourceMatchesHost = flags.getNixSystem redistArch == stdenv.hostPlatform.system;
|
sourceMatchesHost = flags.getNixSystem redistArch == stdenv.hostPlatform.system;
|
||||||
in
|
in
|
||||||
backendStdenv.mkDerivation (
|
backendStdenv.mkDerivation (finalAttrs: {
|
||||||
finalAttrs: {
|
|
||||||
# NOTE: Even though there's no actual buildPhase going on here, the derivations of the
|
# NOTE: Even though there's no actual buildPhase going on here, the derivations of the
|
||||||
# redistributables are sensitive to the compiler flags provided to stdenv. The patchelf package
|
# redistributables are sensitive to the compiler flags provided to stdenv. The patchelf package
|
||||||
# is sensitive to the compiler flags provided to stdenv, and we depend on it. As such, we are
|
# is sensitive to the compiler flags provided to stdenv, and we depend on it. As such, we are
|
||||||
@@ -74,14 +73,11 @@ backendStdenv.mkDerivation (
|
|||||||
# Checks whether the redistributable provides an output.
|
# Checks whether the redistributable provides an output.
|
||||||
hasOutput =
|
hasOutput =
|
||||||
output:
|
output:
|
||||||
attrsets.attrByPath
|
attrsets.attrByPath [
|
||||||
[
|
|
||||||
redistArch
|
redistArch
|
||||||
"outputs"
|
"outputs"
|
||||||
output
|
output
|
||||||
]
|
] false featureRelease;
|
||||||
false
|
|
||||||
featureRelease;
|
|
||||||
# Order is important here so we use a list.
|
# Order is important here so we use a list.
|
||||||
possibleOutputs = [
|
possibleOutputs = [
|
||||||
"bin"
|
"bin"
|
||||||
@@ -101,9 +97,7 @@ backendStdenv.mkDerivation (
|
|||||||
# recall that OfBorg will evaluate packages marked as broken and that `cudaPackages` will be evaluated with
|
# recall that OfBorg will evaluate packages marked as broken and that `cudaPackages` will be evaluated with
|
||||||
# `cudaSupport = false`!
|
# `cudaSupport = false`!
|
||||||
additionalOutputs =
|
additionalOutputs =
|
||||||
if redistArch == "unsupported"
|
if redistArch == "unsupported" then possibleOutputs else builtins.filter hasOutput possibleOutputs;
|
||||||
then possibleOutputs
|
|
||||||
else builtins.filter hasOutput possibleOutputs;
|
|
||||||
# The out output is special -- it's the default output and we always include it.
|
# The out output is special -- it's the default output and we always include it.
|
||||||
outputs = [ "out" ] ++ additionalOutputs;
|
outputs = [ "out" ] ++ additionalOutputs;
|
||||||
in
|
in
|
||||||
@@ -187,7 +181,8 @@ backendStdenv.mkDerivation (
|
|||||||
# We do need some other phases, like configurePhase, so the multiple-output setup hook works.
|
# We do need some other phases, like configurePhase, so the multiple-output setup hook works.
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs =
|
||||||
|
[
|
||||||
autoPatchelfHook
|
autoPatchelfHook
|
||||||
# This hook will make sure libcuda can be found
|
# This hook will make sure libcuda can be found
|
||||||
# in typically /lib/opengl-driver by adding that
|
# in typically /lib/opengl-driver by adding that
|
||||||
@@ -205,8 +200,7 @@ backendStdenv.mkDerivation (
|
|||||||
autoAddCudaCompatRunpath
|
autoAddCudaCompatRunpath
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs = [
|
||||||
[
|
|
||||||
# autoPatchelfHook will search for a libstdc++ and we're giving it
|
# autoPatchelfHook will search for a libstdc++ and we're giving it
|
||||||
# one that is compatible with the rest of nixpkgs, even when
|
# one that is compatible with the rest of nixpkgs, even when
|
||||||
# nvcc forces us to use an older gcc
|
# nvcc forces us to use an older gcc
|
||||||
@@ -342,5 +336,4 @@ backendStdenv.mkDerivation (
|
|||||||
# causes Nix to prefer that output over the others if outputSpecified isn't set).
|
# causes Nix to prefer that output over the others if outputSpecified isn't set).
|
||||||
outputsToInstall = [ "out" ];
|
outputsToInstall = [ "out" ];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|||||||
@@ -52,7 +52,9 @@ let
|
|||||||
# - Package: ../modules/${pname}/releases/package.nix
|
# - Package: ../modules/${pname}/releases/package.nix
|
||||||
|
|
||||||
# FIXME: do this at the module system level
|
# FIXME: do this at the module system level
|
||||||
propagatePlatforms = lib.mapAttrs (redistArch: packages: map (p: { inherit redistArch; } // p) packages);
|
propagatePlatforms = lib.mapAttrs (
|
||||||
|
redistArch: packages: map (p: { inherit redistArch; } // p) packages
|
||||||
|
);
|
||||||
|
|
||||||
# All releases across all platforms
|
# All releases across all platforms
|
||||||
# See ../modules/${pname}/releases/releases.nix
|
# See ../modules/${pname}/releases/releases.nix
|
||||||
@@ -81,8 +83,7 @@ let
|
|||||||
|
|
||||||
# All the supported packages we can build for our platform.
|
# All the supported packages we can build for our platform.
|
||||||
# perSystemReleases :: List Package
|
# perSystemReleases :: List Package
|
||||||
allReleases = lib.pipe releaseSets
|
allReleases = lib.pipe releaseSets [
|
||||||
[
|
|
||||||
(lib.attrValues)
|
(lib.attrValues)
|
||||||
(lists.flatten)
|
(lists.flatten)
|
||||||
(lib.groupBy (p: lib.versions.majorMinor p.version))
|
(lib.groupBy (p: lib.versions.majorMinor p.version))
|
||||||
@@ -115,7 +116,10 @@ let
|
|||||||
buildPackage =
|
buildPackage =
|
||||||
package:
|
package:
|
||||||
let
|
let
|
||||||
shims = final.callPackage shimsFn {inherit package; inherit (package) redistArch; };
|
shims = final.callPackage shimsFn {
|
||||||
|
inherit package;
|
||||||
|
inherit (package) redistArch;
|
||||||
|
};
|
||||||
name = computeName package;
|
name = computeName package;
|
||||||
drv = final.callPackage ./manifest.nix {
|
drv = final.callPackage ./manifest.nix {
|
||||||
inherit pname;
|
inherit pname;
|
||||||
@@ -129,7 +133,9 @@ let
|
|||||||
# versionedDerivations :: AttrSet Derivation
|
# versionedDerivations :: AttrSet Derivation
|
||||||
versionedDerivations = builtins.listToAttrs (lists.map buildPackage allReleases);
|
versionedDerivations = builtins.listToAttrs (lists.map buildPackage allReleases);
|
||||||
|
|
||||||
defaultDerivation = { ${pname} = (buildPackage newest).value; };
|
defaultDerivation = {
|
||||||
|
${pname} = (buildPackage newest).value;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
versionedDerivations // defaultDerivation;
|
versionedDerivations // defaultDerivation;
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
{options, ...}: {options.cuda.manifests = options.generic.manifests;}
|
{ options, ... }:
|
||||||
|
{
|
||||||
|
options.cuda.manifests = options.generic.manifests;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
{options, ...}: {options.cutensor.manifests = options.generic.manifests;}
|
{ options, ... }:
|
||||||
|
{
|
||||||
|
options.cutensor.manifests = options.generic.manifests;
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ let
|
|||||||
nccl
|
nccl
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
backendStdenv.mkDerivation (
|
backendStdenv.mkDerivation (finalAttrs: {
|
||||||
finalAttrs: {
|
|
||||||
|
|
||||||
pname = "nccl-tests";
|
pname = "nccl-tests";
|
||||||
version = "2.13.9";
|
version = "2.13.9";
|
||||||
@@ -80,5 +79,4 @@ backendStdenv.mkDerivation (
|
|||||||
broken = !config.cudaSupport || (mpiSupport && mpi == null);
|
broken = !config.cudaSupport || (mpiSupport && mpi == null);
|
||||||
maintainers = with maintainers; [ jmillerpdt ] ++ teams.cuda.members;
|
maintainers = with maintainers; [ jmillerpdt ] ++ teams.cuda.members;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ let
|
|||||||
cudaVersion
|
cudaVersion
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
backendStdenv.mkDerivation (
|
backendStdenv.mkDerivation (finalAttrs: {
|
||||||
finalAttrs: {
|
|
||||||
pname = "nccl";
|
pname = "nccl";
|
||||||
version = "2.20.5-1";
|
version = "2.20.5-1";
|
||||||
|
|
||||||
@@ -111,5 +110,4 @@ backendStdenv.mkDerivation (
|
|||||||
]
|
]
|
||||||
++ teams.cuda.members;
|
++ teams.cuda.members;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,35 +2,22 @@ final: _: {
|
|||||||
# Helper hook used in both autoAddCudaCompatRunpath and
|
# Helper hook used in both autoAddCudaCompatRunpath and
|
||||||
# autoAddDriverRunpath that applies a generic patching action to all elf
|
# autoAddDriverRunpath that applies a generic patching action to all elf
|
||||||
# files with a dynamic linking section.
|
# files with a dynamic linking section.
|
||||||
autoFixElfFiles =
|
autoFixElfFiles = final.callPackage (
|
||||||
final.callPackage
|
{ makeSetupHook }: makeSetupHook { name = "auto-fix-elf-files"; } ./auto-fix-elf-files.sh
|
||||||
(
|
) { };
|
||||||
{makeSetupHook}:
|
|
||||||
makeSetupHook
|
|
||||||
{
|
|
||||||
name = "auto-fix-elf-files";
|
|
||||||
}
|
|
||||||
./auto-fix-elf-files.sh
|
|
||||||
)
|
|
||||||
{};
|
|
||||||
|
|
||||||
# Internal hook, used by cudatoolkit and cuda redist packages
|
# Internal hook, used by cudatoolkit and cuda redist packages
|
||||||
# to accommodate automatic CUDAToolkit_ROOT construction
|
# to accommodate automatic CUDAToolkit_ROOT construction
|
||||||
markForCudatoolkitRootHook =
|
markForCudatoolkitRootHook = final.callPackage (
|
||||||
final.callPackage
|
|
||||||
(
|
|
||||||
{ makeSetupHook }:
|
{ makeSetupHook }:
|
||||||
makeSetupHook { name = "mark-for-cudatoolkit-root-hook"; } ./mark-for-cudatoolkit-root-hook.sh
|
makeSetupHook { name = "mark-for-cudatoolkit-root-hook"; } ./mark-for-cudatoolkit-root-hook.sh
|
||||||
)
|
) { };
|
||||||
{};
|
|
||||||
|
|
||||||
# Currently propagated by cuda_nvcc or cudatoolkit, rather than used directly
|
# Currently propagated by cuda_nvcc or cudatoolkit, rather than used directly
|
||||||
setupCudaHook =
|
setupCudaHook = (
|
||||||
(final.callPackage
|
final.callPackage (
|
||||||
(
|
|
||||||
{ makeSetupHook, backendStdenv }:
|
{ makeSetupHook, backendStdenv }:
|
||||||
makeSetupHook
|
makeSetupHook {
|
||||||
{
|
|
||||||
name = "setup-cuda-hook";
|
name = "setup-cuda-hook";
|
||||||
|
|
||||||
substitutions.setupCudaHook = placeholder "out";
|
substitutions.setupCudaHook = placeholder "out";
|
||||||
@@ -41,24 +28,24 @@ final: _: {
|
|||||||
# Required in addition to ccRoot as otherwise bin/gcc is looked up
|
# Required in addition to ccRoot as otherwise bin/gcc is looked up
|
||||||
# when building CMakeCUDACompilerId.cu
|
# when building CMakeCUDACompilerId.cu
|
||||||
substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++";
|
substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++";
|
||||||
}
|
} ./setup-cuda-hook.sh
|
||||||
./setup-cuda-hook.sh
|
) { }
|
||||||
)
|
|
||||||
{}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
autoAddDriverRunpath =
|
autoAddDriverRunpath = final.callPackage (
|
||||||
final.callPackage
|
|
||||||
(
|
|
||||||
{addDriverRunpath, autoFixElfFiles, makeSetupHook}:
|
|
||||||
makeSetupHook
|
|
||||||
{
|
{
|
||||||
|
addDriverRunpath,
|
||||||
|
autoFixElfFiles,
|
||||||
|
makeSetupHook,
|
||||||
|
}:
|
||||||
|
makeSetupHook {
|
||||||
name = "auto-add-opengl-runpath-hook";
|
name = "auto-add-opengl-runpath-hook";
|
||||||
propagatedBuildInputs = [addDriverRunpath autoFixElfFiles];
|
propagatedBuildInputs = [
|
||||||
}
|
addDriverRunpath
|
||||||
./auto-add-driver-runpath-hook.sh
|
autoFixElfFiles
|
||||||
)
|
];
|
||||||
{};
|
} ./auto-add-driver-runpath-hook.sh
|
||||||
|
) { };
|
||||||
|
|
||||||
# Deprecated: an alias kept for compatibility. Consider removing after 24.11
|
# Deprecated: an alias kept for compatibility. Consider removing after 24.11
|
||||||
autoAddOpenGLRunpathHook = final.autoAddDriverRunpath;
|
autoAddOpenGLRunpathHook = final.autoAddDriverRunpath;
|
||||||
@@ -68,12 +55,13 @@ final: _: {
|
|||||||
# patched elf files, but `cuda_compat` path must take precedence (otherwise,
|
# patched elf files, but `cuda_compat` path must take precedence (otherwise,
|
||||||
# it doesn't have any effect) and thus appear first. Meaning this hook must be
|
# it doesn't have any effect) and thus appear first. Meaning this hook must be
|
||||||
# executed last.
|
# executed last.
|
||||||
autoAddCudaCompatRunpath =
|
autoAddCudaCompatRunpath = final.callPackage (
|
||||||
final.callPackage
|
|
||||||
(
|
|
||||||
{makeSetupHook, autoFixElfFiles, cuda_compat ? null }:
|
|
||||||
makeSetupHook
|
|
||||||
{
|
{
|
||||||
|
makeSetupHook,
|
||||||
|
autoFixElfFiles,
|
||||||
|
cuda_compat ? null,
|
||||||
|
}:
|
||||||
|
makeSetupHook {
|
||||||
name = "auto-add-cuda-compat-runpath-hook";
|
name = "auto-add-cuda-compat-runpath-hook";
|
||||||
propagatedBuildInputs = [ autoFixElfFiles ];
|
propagatedBuildInputs = [ autoFixElfFiles ];
|
||||||
|
|
||||||
@@ -87,8 +75,6 @@ final: _: {
|
|||||||
# Pre-cuda_compat CUDA release:
|
# Pre-cuda_compat CUDA release:
|
||||||
meta.badPlatforms = final.lib.optionals (cuda_compat == null) final.lib.platforms.all;
|
meta.badPlatforms = final.lib.optionals (cuda_compat == null) final.lib.platforms.all;
|
||||||
meta.platforms = cuda_compat.meta.platforms or [ ];
|
meta.platforms = cuda_compat.meta.platforms or [ ];
|
||||||
}
|
} ./auto-add-cuda-compat-runpath.sh
|
||||||
./auto-add-cuda-compat-runpath.sh
|
) { };
|
||||||
)
|
|
||||||
{};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,10 +41,7 @@ let
|
|||||||
gpus = builtins.import ../development/cuda-modules/gpus.nix;
|
gpus = builtins.import ../development/cuda-modules/gpus.nix;
|
||||||
nvccCompatibilities = builtins.import ../development/cuda-modules/nvcc-compatibilities.nix;
|
nvccCompatibilities = builtins.import ../development/cuda-modules/nvcc-compatibilities.nix;
|
||||||
flags = callPackage ../development/cuda-modules/flags.nix { inherit cudaVersion gpus; };
|
flags = callPackage ../development/cuda-modules/flags.nix { inherit cudaVersion gpus; };
|
||||||
passthruFunction =
|
passthruFunction = final: ({
|
||||||
final:
|
|
||||||
(
|
|
||||||
{
|
|
||||||
inherit cudaVersion lib pkgs;
|
inherit cudaVersion lib pkgs;
|
||||||
inherit gpus nvccCompatibilities flags;
|
inherit gpus nvccCompatibilities flags;
|
||||||
cudaMajorVersion = versions.major cudaVersion;
|
cudaMajorVersion = versions.major cudaVersion;
|
||||||
@@ -76,8 +73,7 @@ let
|
|||||||
saxpy = final.callPackage ../development/cuda-modules/saxpy { };
|
saxpy = final.callPackage ../development/cuda-modules/saxpy { };
|
||||||
nccl = final.callPackage ../development/cuda-modules/nccl { };
|
nccl = final.callPackage ../development/cuda-modules/nccl { };
|
||||||
nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests { };
|
nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests { };
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
mkVersionedPackageName =
|
mkVersionedPackageName =
|
||||||
name: version:
|
name: version:
|
||||||
@@ -86,7 +82,8 @@ let
|
|||||||
(strings.replaceStrings [ "." ] [ "_" ] (versions.majorMinor version))
|
(strings.replaceStrings [ "." ] [ "_" ] (versions.majorMinor version))
|
||||||
];
|
];
|
||||||
|
|
||||||
composedExtension = fixedPoints.composeManyExtensions ([
|
composedExtension = fixedPoints.composeManyExtensions (
|
||||||
|
[
|
||||||
(import ../development/cuda-modules/setup-hooks/extension.nix)
|
(import ../development/cuda-modules/setup-hooks/extension.nix)
|
||||||
(callPackage ../development/cuda-modules/cuda/extension.nix { inherit cudaVersion; })
|
(callPackage ../development/cuda-modules/cuda/extension.nix { inherit cudaVersion; })
|
||||||
(callPackage ../development/cuda-modules/cuda/overrides.nix { inherit cudaVersion; })
|
(callPackage ../development/cuda-modules/cuda/overrides.nix { inherit cudaVersion; })
|
||||||
@@ -109,9 +106,9 @@ let
|
|||||||
})
|
})
|
||||||
(callPackage ../development/cuda-modules/cuda-samples/extension.nix { inherit cudaVersion; })
|
(callPackage ../development/cuda-modules/cuda-samples/extension.nix { inherit cudaVersion; })
|
||||||
(callPackage ../development/cuda-modules/cuda-library-samples/extension.nix { })
|
(callPackage ../development/cuda-modules/cuda-library-samples/extension.nix { })
|
||||||
] ++ lib.optionals config.allowAliases [
|
]
|
||||||
(import ../development/cuda-modules/aliases.nix)
|
++ lib.optionals config.allowAliases [ (import ../development/cuda-modules/aliases.nix) ]
|
||||||
]);
|
);
|
||||||
|
|
||||||
cudaPackages = customisation.makeScope newScope (
|
cudaPackages = customisation.makeScope newScope (
|
||||||
fixedPoints.extends composedExtension passthruFunction
|
fixedPoints.extends composedExtension passthruFunction
|
||||||
|
|||||||
Reference in New Issue
Block a user