AMD GPU: Difference between revisions
Remove EOL configuration |
Add note about AMDVLK being discontinued. |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
== Basic Setup == | == 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. | 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. | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix">hardware.graphics = { | ||
hardware.graphics = { | |||
enable = true; | enable = true; | ||
enable32Bit = true; | enable32Bit = true; | ||
}; | };</syntaxhighlight> | ||
</syntaxhighlight> | |||
== Problems == | == Problems == | ||
Line 165: | Line 163: | ||
=== Vulkan === | === Vulkan === | ||
Vulkan is already enabled by default (using Mesa RADV) on 64 bit applications. The settings to control it are: | Vulkan is already enabled by default (using Mesa RADV) on 64 bit applications. The settings to control it are now the same as those shown in the basic setup: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix">hardware.graphics.enable = true; | ||
hardware. | hardware.graphics.enable32Bit = true; # Replaced 'driSupport32Bit' | ||
hardware. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==== AMDVLK ==== | ==== AMDVLK ==== | ||
The AMDVLK drivers can be used in addition to the Mesa RADV drivers. The program will choose which one to use: | |||
{{Warning|1=AMDVLK is being discontinued, so the only reason you may want to use it is if you have issues with RADV. See: https://github.com/GPUOpen-Drivers/AMDVLK/discussions/416.}} | |||
The AMDVLK drivers can be used in addition to the Mesa RADV drivers. The program will choose which one to use (mostly defaulting to AMDVLK): | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
Line 197: | Line 197: | ||
More information can be found here: https://nixos.org/manual/nixos/unstable/index.html#sec-gpu-accel-vulkan | More information can be found here: https://nixos.org/manual/nixos/unstable/index.html#sec-gpu-accel-vulkan | ||
One way to avoid installing it system-wide, is creating a wrapper like this: | |||
<syntaxhighlight lang="nix"> | |||
with pkgs; writeShellScriptBin "amdvlk-run" '' | |||
export VK_DRIVER_FILES="${amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgsi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json" | |||
exec "$@" | |||
''; | |||
</syntaxhighlight> | |||
This wrapper can be used per-game inside Steam (<syntaxhighlight lang="sh" inline>amdvlk-run %command%</syntaxhighlight>) and lets RADV to be the system's default. | |||
===== Performance Issues with AMDVLK ===== | |||
Some games choose AMDVLK over RADV, which can cause noticeable performance issues (e.g. <50% less FPS in games) | |||
To force RADV<syntaxhighlight lang="nix"> | |||
environment.variables.AMD_VULKAN_ICD = "RADV"; | |||
</syntaxhighlight> | |||
=== GUI tools === | === GUI tools === | ||
Line 211: | Line 227: | ||
systemd.packages = with pkgs; [ lact ]; | systemd.packages = with pkgs; [ lact ]; | ||
systemd.services.lactd.wantedBy = ["multi-user.target"]; | systemd.services.lactd.wantedBy = ["multi-user.target"]; | ||
</syntaxhighlight>Simple version is:<syntaxhighlight lang="nix"> | |||
services.lact.enable = true; | |||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/hardware/lact.nix | |||
</syntaxhighlight> | </syntaxhighlight> | ||