Add Nvidia Docker toolkit support
This commit is contained in:
@@ -6,13 +6,17 @@
|
||||
extraBackends = [ pkgs.sane-airscan ];
|
||||
disabledDefaultBackends = [ "escl" ];
|
||||
};
|
||||
logitech.wireless.enable = false;
|
||||
logitech.wireless.enableGraphical = false;
|
||||
logitech.wireless = {
|
||||
enable = false;
|
||||
enableGraphical = false;
|
||||
};
|
||||
graphics.enable = true;
|
||||
enableRedistributableFirmware = true;
|
||||
keyboard.qmk.enable = true;
|
||||
bluetooth.enable = true;
|
||||
bluetooth.powerOnBoot = true;
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = false;
|
||||
};
|
||||
};
|
||||
local.hardware-clock.enable = false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
@@ -14,7 +15,10 @@ in
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
environment.systemPackages = with pkgs; [ nvidia-docker ];
|
||||
hardware = {
|
||||
nvidia-container-toolkit.enable = true;
|
||||
nvidia = {
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
@@ -37,4 +41,21 @@ in
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
# Making nvidia docker toolkit work:
|
||||
#
|
||||
# sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
|
||||
#
|
||||
# sudo nvidia-ctk cdi list
|
||||
#
|
||||
# sudo tee /etc/docker/daemon.json > /dev/null <<EOF
|
||||
# {
|
||||
# "features": {
|
||||
# "cdi": true
|
||||
# }
|
||||
# }
|
||||
# EOF
|
||||
#
|
||||
# docker run --device nvidia.com/gpu=all
|
||||
|
||||
Reference in New Issue
Block a user