2023-12-15 17:31:08 +00:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
# Adapted from: https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
|
2023-12-14 22:15:17 +00:00
|
|
|
|
|
|
|
# Make the kernel use the correct driver early
|
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
|
2023-12-15 17:31:08 +00:00
|
|
|
# Make sure Xserver uses the `amdgpu` driver
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
|
|
|
|
2023-12-14 22:15:17 +00:00
|
|
|
# For 32 bit applications
|
|
|
|
hardware.opengl.driSupport32Bit = true;
|
|
|
|
|
|
|
|
# AMDVLK drivers can be used in addition to the Mesa RADV drivers
|
|
|
|
hardware.opengl.extraPackages = with pkgs; [
|
|
|
|
amdvlk
|
|
|
|
rocmPackages.clr.icd
|
|
|
|
];
|
|
|
|
|
2023-12-15 17:31:08 +00:00
|
|
|
# For 32 bit applications
|
|
|
|
hardware.opengl.extraPackages32 = with pkgs; [
|
|
|
|
driversi686Linux.amdvlk
|
|
|
|
];
|
|
|
|
|
2023-12-14 22:15:17 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
nvtop-amd
|
|
|
|
clinfo
|
|
|
|
rocmPackages.clr
|
|
|
|
];
|
|
|
|
}
|