1

Enable GPU support for some services

This commit is contained in:
2023-09-01 13:32:59 +02:00
parent 5947626dde
commit 284817838d
3 changed files with 9 additions and 5 deletions

View File

@ -83,7 +83,7 @@
users.users.christoph = { users.users.christoph = {
isNormalUser = true; isNormalUser = true;
description = "Christoph"; description = "Christoph";
extraGroups = ["networkmanager" "wheel" "docker"]; extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish; shell = pkgs.fish;
packages = with pkgs; []; packages = with pkgs; [];
}; };
@ -95,6 +95,7 @@
alejandra alejandra
nnn nnn
busybox busybox
glances
]; ];
programs = { programs = {
@ -129,10 +130,10 @@
enable = true; enable = true;
autoPrune.enable = true; autoPrune.enable = true;
enableNvidia = true; enableNvidia = true;
rootless = { # rootless = {
enable = true; # enable = true;
setSocketVariable = true; # setSocketVariable = true;
}; # };
}; };
oci-containers.backend = "docker"; oci-containers.backend = "docker";
}; };

View File

@ -30,6 +30,8 @@
extraOptions = [ extraOptions = [
# "--restart=always" # Conflicts with NixOS' default of using --rm # "--restart=always" # Conflicts with NixOS' default of using --rm
# "--gpus device=0" # This only works when I start the container using sudo, but not from the systemd service?
"--runtime=nvidia" # Older option but seems to work
]; ];
}; };
} }

View File

@ -29,6 +29,7 @@
extraOptions = [ extraOptions = [
# "--restart=always" # Conflicts with NixOS' default of using --rm # "--restart=always" # Conflicts with NixOS' default of using --rm
"--runtime=nvidia"
]; ];
}; };
} }