Skip to content

Commit

Permalink
nvidia-container-toolkit: 1.15.0-rc.3 -> 1.17.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ereslibre committed Dec 23, 2024
1 parent d8d3c38 commit 1496324
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ writeScriptBin "nvidia-cdi-generator" ''
--device-name-strategy ${deviceNameStrategy} \
--ldconfig-path ${lib.getExe' glibc "ldconfig"} \
--library-search-path ${lib.getLib nvidia-driver}/lib \
--nvidia-ctk-path ${lib.getExe' nvidia-container-toolkit "nvidia-ctk"}
--nvidia-cdi-hook-path ${lib.getExe' nvidia-container-toolkit.tools "nvidia-cdi-hook"}
}
function additionalMount {
Expand Down
38 changes: 14 additions & 24 deletions pkgs/by-name/nv/nvidia-container-toolkit/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
lib,
glibc,
fetchFromGitLab,
fetchFromGitHub,
makeWrapper,
buildGoModule,
formats,
Expand All @@ -26,14 +26,14 @@ let
cliVersionPackage = "github.com/NVIDIA/nvidia-container-toolkit/internal/info";
in
buildGoModule rec {
pname = "container-toolkit/container-toolkit";
version = "1.15.0-rc.3";
pname = "nvidia-container-toolkit";
version = "1.17.3";

src = fetchFromGitLab {
owner = "nvidia";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = pname;
rev = "v${version}";
hash = "sha256-IH2OjaLbcKSGG44aggolAOuJkjk+GaXnnTbrXfZ0lVo=";
hash = "sha256-o3zkCkX6pmmdNb+K5nObhkItYJ6OaZBpW61sl7/hKPg=";

};

Expand All @@ -50,23 +50,13 @@ buildGoModule rec {
./0001-Add-dlopen-discoverer.patch
];

postPatch = ''
# Replace the default hookDefaultFilePath to the $out path and override
# default ldconfig locations to the one in nixpkgs.
substituteInPlace internal/config/config.go \
--replace '/usr/bin/nvidia-container-runtime-hook' "$out/bin/nvidia-container-runtime-hook" \
--replace '/sbin/ldconfig' '${lib.getBin glibc}/sbin/ldconfig'
substituteInPlace internal/config/config_test.go \
--replace '/sbin/ldconfig' '${lib.getBin glibc}/sbin/ldconfig'
substituteInPlace tools/container/toolkit/toolkit.go \
--replace '/sbin/ldconfig' '${lib.getBin glibc}/sbin/ldconfig'
substituteInPlace cmd/nvidia-ctk/hook/update-ldcache/update-ldcache.go \
--replace '/sbin/ldconfig' '${lib.getBin glibc}/sbin/ldconfig'
'';
subPackages = [
"cmd/nvidia-cdi-hook"
"cmd/nvidia-container-runtime.cdi"
"cmd/nvidia-container-runtime-hook"
"cmd/nvidia-container-runtime.legacy"
"cmd/nvidia-ctk"
];

# Based on upstream's Makefile:
# https://gitlab.com/nvidia/container-toolkit/container-toolkit/-/blob/03cbf9c6cd26c75afef8a2dd68e0306aace80401/Makefile#L64
Expand Down Expand Up @@ -104,7 +94,7 @@ buildGoModule rec {
--prefix PATH : ${libnvidia-container}/bin
mkdir -p $tools/bin
mv $out/bin/{containerd,crio,docker,nvidia-toolkit,toolkit} $tools/bin
mv $out/bin/{nvidia-cdi-hook,nvidia-container-runtime.cdi,nvidia-container-runtime-hook,nvidia-container-runtime.legacy} $tools/bin
''
+ lib.optionalString (configTemplate != null || configTemplatePath != null) ''
mkdir -p $out/etc/nvidia-container-runtime
Expand Down

0 comments on commit 1496324

Please sign in to comment.