Skip to content

Commit

Permalink
nvidia-podman: remove nvidia wrapper
Browse files Browse the repository at this point in the history
Since version 4.1.0, podman has support for CDI, and is the
recommended way to expose GPU's for containers for podman.

More information: https://web.archive.org/web/20240729183805/https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-podman

(cherry picked from commit 058e8f5)
  • Loading branch information
ereslibre committed Aug 22, 2024
1 parent 50e7e13 commit 9cff87c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 35 deletions.
7 changes: 1 addition & 6 deletions nixos/modules/virtualisation/podman/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ in
lib.mkIf cfg.enable {
warnings = lib.optionals cfg.enableNvidia [
''
You have set virtualisation.podman.enableNvidia. This option is deprecated, please set virtualisation.containers.cdi.dynamic.nvidia.enable instead.
You have set virtualisation.podman.enableNvidia. This option is deprecated, please set hardware.nvidia-container-toolkit.enable instead.
''
];

Expand All @@ -189,11 +189,6 @@ in
enable = true; # Enable common /etc/containers configuration
containersConf.settings = {
network.network_backend = "netavark";
} // lib.optionalAttrs cfg.enableNvidia {
engine = {
conmon_env_vars = [ "PATH=${lib.makeBinPath [ pkgs.nvidia-podman ]}" ];
runtimes.nvidia = [ "${pkgs.nvidia-podman}/bin/nvidia-container-runtime" ];
};
};
};

Expand Down
28 changes: 0 additions & 28 deletions pkgs/by-name/nv/nvidia-container-toolkit/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,6 @@ lib.makeScope newScope (
configTemplate = self.dockerConfig;
};

podmanConfig = {
disable-require = true;
#swarm-resource = "DOCKER_RESOURCE_GPU";

nvidia-container-cli = {
#root = "/run/nvidia/driver";
#path = "/usr/bin/nvidia-container-cli";
environment = [ ];
#debug = "/var/log/nvidia-container-runtime-hook.log";
ldcache = "/tmp/ld.so.cache";
load-kmods = true;
no-cgroups = true;
#user = "root:video";
ldconfig = "@@glibcbin@/bin/ldconfig";
};
};
nvidia-container-toolkit-podman = self.nvidia-container-toolkit-docker.override {
configTemplate = self.podmanConfig;
};

nvidia-docker = symlinkJoin {
name = "nvidia-docker";
paths = [
Expand All @@ -60,13 +40,5 @@ lib.makeScope newScope (
};
nvidia-docker-unwrapped =
self.callPackage ./nvidia-docker.nix { };

nvidia-podman = symlinkJoin {
name = "nvidia-podman";
paths = [
self.nvidia-container-toolkit-podman
];
inherit (self.nvidia-container-toolkit-podman) meta;
};
}
)
1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ mapAliases ({
noto-fonts-emoji = noto-fonts-color-emoji; # Added 2023-09-09
noto-fonts-extra = noto-fonts; # Added 2023-04-08
NSPlist = nsplist; # Added 2024-01-05
nvidia-podman = throw "podman should use the Container Device Interface (CDI) instead. See https://web.archive.org/web/20240729183805/https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-podman"; # Added 2024-08-02
nvidia-thrust = throw "nvidia-thrust has been removed because the project was deprecated; use cudaPackages.cuda_cccl";
nvtop = lib.warn "nvtop has been renamed to nvtopPackages.full" nvtopPackages.full; # Added 2024-02-25
nvtop-amd = lib.warn "nvtop-amd has been renamed to nvtopPackages.amd" nvtopPackages.amd; # Added 2024-02-25
Expand Down
1 change: 0 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23494,7 +23494,6 @@ with pkgs;
{ };
inherit (nvidiaCtkPackages)
nvidia-docker
nvidia-podman
;

nvidia-vaapi-driver = lib.hiPrio (callPackage ../development/libraries/nvidia-vaapi-driver { });
Expand Down

0 comments on commit 9cff87c

Please sign in to comment.