Radeon Video: Difference between revisions

From Alpine Linux
(wayland update)
Line 1: Line 1:
{{TOC right}}
{{TOC right}}


The following instructions are for modern AMD GPU chipsets covered by the radeon driver.
== Wayland ==


== Setup Xorg/udev ==
Install the following packages as needed:


# Run the <code>[[Alpine setup scripts#setup-xorg-base|setup-xorg-base]]</code> script.
* <code>mesa-dri-gallium</code>: '''necessary''' Mesa drivers.
# For Radeon compat GPUs, install the Xorg AMD video drivers: {{Cmd|# apk add xf86-video-ati}}
* <code>mesa-va-gallium</code>: VA-API drivers, for hardware accelerated video encoding and decoding
# For newer, AMDGPU compat devices, use: {{Cmd|# apk add xf86-video-amdgpu}}
# If using xf86-video-amdgpu, install the AMD firmware files if they are not already installed: {{Cmd|# apk add linux-firmware-amdgpu}}
# Do not install linux-firmware-amdgpu if using xf86-video-ati, as it will remove the firmware you actually need.
# Enable [[#Kernel Modesetting (KMS)]]. Specifically, the <code>fbcon</code> module is necessary, or leaving Xorg (via <code>Ctrl+Alt+F1</code> or quitting) will result in a black screen until the machine is power cycled. If you have already launch Xorg and don't want to experience this effect, you can <code>modprobe fbcon</code> while Xorg is running.


== Kernel Modesetting (KMS) ==
If driver auto-selection does not work, e.g. no mouse cursor under Sway, manual driver selection might be needed:


To enable [[KMS]] at boot:
* <code>export MESA_LOADER_DRIVER_OVERRIDE=r300</code>: for AMD's Radeon R300, R400, and R500 GPUs.
# Add the <code>radeon</code> or <code>amdgpu</code> and <code>fbcon</code> modules to {{Path|/etc/modules}}: {{Cmd|$ echo radeon >> /etc/modules<br />$ echo fbcon >> /etc/modules}} or {{Cmd|$ echo amdgpu >> /etc/modules<br />$ echo fbcon >> /etc/modules}}
* <code>export MESA_LOADER_DRIVER_OVERRIDE=r600</code>: for AMD's Radeon R600 GPUs up to Northern Islands. Officially supported by AMD.
# Install <code>mkinitfs</code>: {{Cmd|apk add mkinitfs}}
* <code>export MESA_LOADER_DRIVER_OVERRIDE=radeonsi</code>: for AMD's Southern Island GPUs and later. Officially supported by AMD.
# Enable the <code>kms</code> feature in the <code>mkinitfs</code> configuration by adding it to the <var>features</var> variable, e.g., {{cat|/etc/mkinitfs/mkinitfs.conf|features{{=}}"keymap cryptsetup kms ata base ide scsi usb virtio ext4"}}
# Run <code>mkinitfs</code>.
# Reboot to test the configuration.


== Troubleshooting ==
For VA-API:
=== Fixing MESA-LOADER errors===
* <code>export LIBVA_DRIVER_NAME=r600</code>
{{Obsolete|Alpine no longer ships with the ''linux-hardened'' kernel}}
* <code>export LIBVA_DRIVER_NAME=radeonsi</code>


The ''linux-hardened'' kernel package places restrictions on sysfs and will prevent the MESA-LOADER from working as a normal user even if added to the video group.
== Xorg ==


See https://bugs.alpinelinux.org/issues/7265
Install either the Free Software driver <code>xf86-video-ati</code> or the proprietary amdgpu firmware <code>linux-firmware-amdgpu</code>.


Either switch to the ''linux-vanilla'' package or apply the '''grsec_sysfs_restrict=0''' kernel parameter to allow normal users to access hardware acceleration on the desktop.
<code>modprobe fbcon</code> might be needed to avoid black screen when leaving Xorg.
 
=== Fixing a frozen X11 when invoking startx ===
 
You may need to set the AccelMethod to exa not glamor which is the default for the driver.
 
{{cat|/etc/X11/xorg.conf|
  Section "Device"
        Option      "AccelMethod"        "exa"
Identifier  "Card0"
Driver      "radeon"
BusID      "PCI:1:0:0"
  EndSection}}
= =
* [https://wiki.archlinux.org/index.php/ATI archlinux.org / ATI]
* [https://wiki.archlinux.org/index.php/Xorg archlinux.org / Xorg]


[[Category:Drivers]]
[[Category:Drivers]]

Revision as of 05:18, 22 July 2022

Wayland

Install the following packages as needed:

  • mesa-dri-gallium: necessary Mesa drivers.
  • mesa-va-gallium: VA-API drivers, for hardware accelerated video encoding and decoding

If driver auto-selection does not work, e.g. no mouse cursor under Sway, manual driver selection might be needed:

  • export MESA_LOADER_DRIVER_OVERRIDE=r300: for AMD's Radeon R300, R400, and R500 GPUs.
  • export MESA_LOADER_DRIVER_OVERRIDE=r600: for AMD's Radeon R600 GPUs up to Northern Islands. Officially supported by AMD.
  • export MESA_LOADER_DRIVER_OVERRIDE=radeonsi: for AMD's Southern Island GPUs and later. Officially supported by AMD.

For VA-API:

  • export LIBVA_DRIVER_NAME=r600
  • export LIBVA_DRIVER_NAME=radeonsi

Xorg

Install either the Free Software driver xf86-video-ati or the proprietary amdgpu firmware linux-firmware-amdgpu.

modprobe fbcon might be needed to avoid black screen when leaving Xorg.