diff --git a/gpu-config.nix b/gpu-config.nix new file mode 100644 index 0000000..af2ef6a --- /dev/null +++ b/gpu-config.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + # make the kernel use the correct driver early + boot.initrd.kernelModules = [ "amdgpu" ]; + + hardware.graphics.enable = true; + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware.graphics.enable32Bit = true; + + hardware.graphics.extraPackages = with pkgs; [ + # Mesa drivers (includes OpenGL, Vulkan via RADV) + mesa + + # AMD's official Vulkan driver (optional alternative to RADV) + amdvlk + + # OpenCL support - IMPORTANT: Check which OpenCL implementation works for RX 580 + # For R600-family and newer (RX 580 is GCN 4.0, so should use rusticl eventually) + mesa.opencl # Legacy OpenCL driver (Clover) - being removed soon + # OR for future-proofing (when rusticl becomes default): + # pkgs.mesa.rusticl + + # Video acceleration + libva + libva-utils + vaapiVdpau + ]; +} \ No newline at end of file