From d14fe7d7c07ecd99ca19c7c0fe3ffa95cfca42d7 Mon Sep 17 00:00:00 2001 From: brian Date: Fri, 12 Dec 2025 20:59:41 -0500 Subject: [PATCH] Add gpu-config.nix --- gpu-config.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 gpu-config.nix 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