diff --git a/NixOS.md b/NixOS.md index 9d0f51c..626ea24 100644 --- a/NixOS.md +++ b/NixOS.md @@ -899,7 +899,7 @@ Usually most of this should work out of the box on NixOS. Vulkan: - Verification: - If `vulkaninfo` returns information about your GPU, Vulkan is working. https://wiki.archlinux.org/title/Vulkan#Verification - - `nix-shell -p vulkan-tools --run vulkaninfo` + - `nix-shell -p vulkan-tools --run 'vulkaninfo --summary'` - Run `vkcube` (X11) or `vkcube-wayland` (Wayland). It should view a spinning 3D cube and output e.g. `Selected GPU 0: AMD Radeon Graphics (RADV RENOIR)` - `nix-shell -p vulkan-tools --run vkcube-wayland` @@ -922,7 +922,7 @@ Video acceleration: - Verifying: `vdpauinfo`. https://wiki.archlinux.org/title/Hardware_video_acceleration#Verifying_VDPAU - `nix-shell -p vdpauinfo --run vdpauinfo` -GPGPU (General-purpose computing on graphics processing units): +GPGPU (General-purpose computing on graphics processing units, https://wiki.archlinux.org/title/GPGPU): - OpenCL - Verification using `clinfo` - `nix-shell -p clinfo --run 'clinfo -l'` @@ -930,10 +930,19 @@ GPGPU (General-purpose computing on graphics processing units): - `nix-shell -p clinfo --run clinfo` - This output is more verbose. - `Number of platforms` should be >= 1 + - ROCm + - Verify using `nix-shell -p rocmPackages.rocminfo --run rocminfo` + - ROCm gfx version + - `nix-shell -p "rocmPackages.rocminfo" --run "rocminfo" | grep "gfx"` + - Example: `Name: gfx90c` + - According to this website this is in section `GCN GFX9 (Vega)` + - https://discuss.linuxcontainers.org/t/rocm-and-pytorch-on-amd-apu-or-gpu-ai/19743#environment-variables-4 + - https://llvm.org/docs/AMDGPUUsage.html#processors Verify video driver in use: - `lspci -k | grep -EA3 'VGA|3D|Display'`. Example: `Kernel driver in use: amdgpu` - `nix-shell -p pciutils --run 'lspci -k | grep -EA3 "VGA|3D|Display"'` +- `nix-shell -p inxi pciutils mesa-demos --run 'inxi -Gzxx'`. Example: `driver: amdgpu` Verification in general: - Encode a video or play a game and watch AMD GPU usage with `radeontop`. diff --git a/modules/gpu-amd.nix b/modules/gpu-amd.nix index ad352b5..dca4b4c 100644 --- a/modules/gpu-amd.nix +++ b/modules/gpu-amd.nix @@ -39,6 +39,11 @@ in }; }; + nixpkgs.config = { + # Supported by most modern AMD GPUs. + rocmSupport = true; + }; + environment.variables = { # VDPAU does not pick up correct driver. Thus, we need to configure it manually. # https://wiki.archlinux.org/title/Hardware_video_acceleration#Failed_to_open_VDPAU_backend