Hey there,
I have two NixOS machines with new hardware. One uses an integrated Intel GPU, the other one a dedicated AMD Radeon GPU.
I read some links and cobbled configs together. However, I am not confident that I ended up with the best possible setup.
Are the posted configs sufficient to get max compute out of the GPUs? Are there useless statements? For example, I don’t understand if it makes sense to set both hardware.graphics.extraPackages and hardware.amdgpu.opencl…
Do I need to set services.xserver.videoDrivers for my Wayland setup (in addition to the below)?
How can I verify I have full hardware acceleration, for example for gaming? Is clinfo sufficient or does it only show what’s available, not necessarily what is used? Is there something similar for Vulkan or OpenGL?
Thank you very much for your time and support ![]()
Configs
These are all configs with regards to GPUs on the respective systems.
Intel
# Intel GPU (including "xe" driver):
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
# Required for modern Intel GPUs (Xe iGPU and ARC)
intel-media-driver # VA-API (iHD) userspace
vpl-gpu-rt # oneVPL (QSV) runtime
# Optional (compute / tooling):
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
];
};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD"; # Prefer the modern iHD backend
};
boot.initrd.kernelModules =
lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8")
[ "xe" ];
AMD
# AMD GPU:
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
rocmPackages.clr.icd
];
};
hardware.amdgpu = {
initrd.enable = true;
opencl.enable = true;
};
Sources
- NixOS Wiki: Intel Graphics
- NixOS Wiki: AMD GPU
- NixOS Wiki: Accelerated Video Playback
- NixOS Manual: GPU Acceleration
- NixOS Options:
hardware.amdgpu - GitHub:
nixos-hardware- Please note that my Lenovo Laptop with an integrated Intel GPU has an Arrow Lake chip, which is not yet included in
nixos-hardware, so I was more or less searching my parts.
- Please note that my Lenovo Laptop with an integrated Intel GPU has an Arrow Lake chip, which is not yet included in