From NixOS Wiki

This guide is about setting up NixOS to correctly use your AMD Graphics card if it is relatively new (aka, after the GCN architecture).

Basic Setup

For ordinary desktop / gaming usage, AMD GPUs are expected to work out of the box. As with any desktop configuration though, graphics acceleration does need to be enabled.

hardware.opengl = {
  enable = true;
  driSupport = true;
  driSupport32Bit = true;

For 24.11 unstable release = {
  enable = true;
  enable32Bit = true;


Dual Monitors

If you encounter problems having multiple monitors connected to your GPU, adding `video` parameters for each connector to the kernel command line sometimes helps.

For example:

boot.kernelParams = [

With the connector names (like `DP-1`), the resolution and frame rate adjusted accordingly.

To figure out the connector names, execute the following command while your monitors are connected:

head /sys/class/drm/*/status

Special Configuration

The following configurations are only required if you have a specific reason for needing them. They are not expected to be necessary for a typical desktop / gaming setup.

Enable Southern Islands (SI) and Sea Islands (CIK) support

The oldest architectures that AMDGPU supports are Southern Islands (SI, i.e. GCN 1) and Sea Islands (CIK, i.e. GCN 2), but support for them is disabled by default. To use AMDGPU instead of the radeon driver, you can set the kernel parameters:

# for Southern Islands (SI i.e. GCN 1) cards
boot.kernelParams = [ "radeon.si_support=0" "amdgpu.si_support=1" ];
# for Sea Islands (CIK i.e. GCN 2) cards
boot.kernelParams = [ "radeon.cik_support=0" "amdgpu.cik_support=1" ];

Doing this is required to use Vulkan on these cards, as the radeon driver doesn't support it.


Most software has the HIP libraries hard-coded. You can work around it on NixOS by using:

  systemd.tmpfiles.rules = 
    rocmEnv = pkgs.symlinkJoin {
      name = "rocm-combined";
      paths = with pkgs.rocmPackages; [
  in [
    "L+    /opt/rocm   -    -    -     -    ${rocmEnv}"


Hardware accelerated rendering can be achieved by using the package blender-hip.

Currently, you need to use the latest kernel for blender-hip to work.


hardware.opengl.extraPackages = with pkgs; [

You should also install the clinfo package to verify that OpenCL is correctly setup (or check in the program you use to see if it is now available, such as in Darktable).

Radeon 500 series (aka Polaris)

As of ROCm 4.5, AMD has disabled OpenCL on Polaris based cards. This can be re-enabled by setting the environment variable ROC_ENABLE_PRE_VEGA=1

environment.variables = {


Vulkan is already enabled by default (using Mesa RADV) on 64 bit applications. The settings to control it are:

hardware.opengl.driSupport = true; # This is already enabled by default
hardware.opengl.driSupport32Bit = true; # For 32 bit applications


The AMDVLK drivers can be used in addition to the Mesa RADV drivers. The program will choose which one to use:

hardware.opengl.extraPackages = with pkgs; [
# For 32 bit applications 
hardware.opengl.extraPackages32 = with pkgs; [

More information can be found here:

GUI tools

LACT - Linux AMDGPU Controller

This application allows you to control your AMD GPU on a Linux system.

In order to enable the daemon you need to add the package to environment.systemPackages and enable the `lact` daemon:

  environment.systemPackages = with pkgs; [                                                                                                                                                                               
  ];                                                                                                                                                                                                                                                                                                                                            = {
    description = "AMDGPU Control Daemon";
    enable = true;  
    serviceConfig = {
      ExecStart = "${pkgs.lact}/bin/lact daemon";
    wantedBy = [""];