Skip to content

Commit

Permalink
nixos/adrastea: initialize NVIDIA GPU on startup, in systemd service
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Jun 11, 2024
1 parent 43a8c8d commit 3bd8538
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nixos/configurations/adrastea/nvidia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@ in
environment.sessionVariables = {
NVIDIA_KERNEL = nvidia;
};

# Initialize nvidia gpu card using "nvidia-smi" in root.
systemd.services."nvidia-init" = {
description = "Initialize NVIDIA GPU";
serviceConfig = {
Type = "oneshot";
ExecStart = "${nvidia.bin}/bin/nvidia-smi";
};

wantedBy = [ "multi-user.target" ];
};
}

0 comments on commit 3bd8538

Please sign in to comment.