ROCm support

This commit is contained in:
Daniel Langbein 2025-02-08 17:06:30 +01:00
parent 239354ab9f
commit 9fde99826e
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
2 changed files with 16 additions and 2 deletions

View File

@ -899,7 +899,7 @@ Usually most of this should work out of the box on NixOS.
Vulkan: Vulkan:
- Verification: - Verification:
- If `vulkaninfo` returns information about your GPU, Vulkan is working. https://wiki.archlinux.org/title/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)` - 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` - `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 - Verifying: `vdpauinfo`. https://wiki.archlinux.org/title/Hardware_video_acceleration#Verifying_VDPAU
- `nix-shell -p vdpauinfo --run vdpauinfo` - `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 - OpenCL
- Verification using `clinfo` - Verification using `clinfo`
- `nix-shell -p clinfo --run 'clinfo -l'` - `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` - `nix-shell -p clinfo --run clinfo`
- This output is more verbose. - This output is more verbose.
- `Number of platforms` should be >= 1 - `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: Verify video driver in use:
- `lspci -k | grep -EA3 'VGA|3D|Display'`. Example: `Kernel driver in use: amdgpu` - `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 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: Verification in general:
- Encode a video or play a game and watch AMD GPU usage with `radeontop`. - Encode a video or play a game and watch AMD GPU usage with `radeontop`.

View File

@ -39,6 +39,11 @@ in
}; };
}; };
nixpkgs.config = {
# Supported by most modern AMD GPUs.
rocmSupport = true;
};
environment.variables = { environment.variables = {
# VDPAU does not pick up correct driver. Thus, we need to configure it manually. # 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 # https://wiki.archlinux.org/title/Hardware_video_acceleration#Failed_to_open_VDPAU_backend