mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
services/hardware: add nvidia-container-toolkit
This commit is contained in:
parent
fd464f0543
commit
8ba61ebb8a
9 changed files with 145 additions and 29 deletions
|
@ -72,6 +72,8 @@ in
|
|||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
**Deprecated**, please use virtualisation.containers.cdi.dynamic.nvidia.enable instead.
|
||||
|
||||
Enable nvidia-docker wrapper, supporting NVIDIA GPUs inside docker containers.
|
||||
'';
|
||||
};
|
||||
|
@ -185,6 +187,16 @@ in
|
|||
users.groups.docker.gid = config.ids.gids.docker;
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
# Docker 25.0.0 supports CDI by default
|
||||
# (https://docs.docker.com/engine/release-notes/25.0/#new). Encourage
|
||||
# moving to CDI as opposed to having deprecated runtime
|
||||
# wrappers.
|
||||
warnings = lib.optionals (cfg.enableNvidia && (lib.strings.versionAtLeast cfg.package.version "25")) [
|
||||
''
|
||||
You have set virtualisation.docker.enableNvidia. This option is deprecated, please set virtualisation.containers.cdi.dynamic.nvidia.enable instead.
|
||||
''
|
||||
];
|
||||
|
||||
systemd.services.docker = {
|
||||
wantedBy = optional cfg.enableOnBoot "multi-user.target";
|
||||
after = [ "network.target" "docker.socket" ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue