NixOS/hardware/amdgpu.nix

32 lines
837 B
Nix
Raw Permalink Normal View History

{ 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" ];
# 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
];
# 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
];
}