docs: graphic driver

This commit is contained in:
Daniel Langbein 2024-01-12 22:24:03 +01:00
parent afc9e3ac33
commit 48e0fcb6ba
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
2 changed files with 50 additions and 0 deletions

View File

@ -414,6 +414,56 @@ nix-shell -p appimage-run
appimage-run ~/Downloads/ubports-installer_0.10.0_linux_x86_64.AppImage appimage-run ~/Downloads/ubports-installer_0.10.0_linux_x86_64.AppImage
``` ```
## Graphic drivers
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
OpenGL:
- Verification: https://wiki.archlinux.org/title/OpenGL#Verification
- `eglinfo -B` should not return `eglInitialize failed`
- `eglgears_x11` and `eglgears_wayland` -> ![eglgears.png](assets/doc/eglgears.png)
Video acceleration:
- VA-API
- Verifying: `vainfo` -> E.g. `Driver version: Mesa Gallium driver 23.1.9 for AMD Radeon Graphics`. https://wiki.archlinux.org/title/Hardware_video_acceleration#Verifying_VA-API
- Driver comparison chart. https://wiki.archlinux.org/title/Hardware_video_acceleration#VA-API_drivers
- With `libva-mesa-driver` on "Radeon RX 7900 and higher/newer" a codec for encoding AV1 8 and 10 bit is available.
- VDPAU
- Video Decode and Presentation API for Unix (VDPAU).
- Verifying: `vdpauinfo`. https://wiki.archlinux.org/title/Hardware_video_acceleration#Verifying_VDPAU
Configuration example for an AMD GPU:
```nix
hardware.opengl = {
enable = true;
# Whether to enable accelerated OpenGL rendering through the Direct Rendering Interface (DRI).
# The Direct Rendering Infrastructure (DRI) is the framework comprising the modern Linux graphics [...]. The main use of DRI is to provide hardware acceleration for the Mesa implementation of OpenGL.
driSupport = true;
extraPackages = [
# AMD Open Source Driver For Vulkan
pkgs.amdvlk
# Encoding/decoding acceleration
#
# VDPAU driver with OpenGL/VAAPI backend
pkgs.libvdpau-va-gl
# VDPAU driver for the VAAPI library
pkgs.vaapiVdpau
# OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms.
#
# OpenCL ICD definition for AMD GPUs using the ROCm stack.
pkgs.rocm-opencl-icd
# OpenCL runtime for AMD GPUs, part of the ROCm stack.
pkgs.rocm-opencl-runtime
];
};
```
## Additional resources ## Additional resources
* Simple NixOS flake template for NixOS with HomeManager. https://github.com/Misterio77/nix-starter-configs#readme * Simple NixOS flake template for NixOS with HomeManager. https://github.com/Misterio77/nix-starter-configs#readme

BIN
assets/doc/eglgears.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB