Radeon Video: Difference between revisions

From Alpine Linux
m (→‎Firmware: Vega GPUs require `linux-firmware-amdgpu` as well. This also contradicts Gentoo Wiki linked near by that describe `amdgpu` as being for "for Vega GPUs and Raven Ridge GPUs")
 
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
The following instructions are for modern AMD GPU chipsets covered by the radeon driver.
{{TOC right}}


== Setup Xorg/udev ==
The following instructions are for modern AMD GPU chipsets covered by the <code>radeon</code> and <code>amdgpu</code> drivers.


# Run the [[Alpine setup scripts#setup-xorg-base|setup-xorg-base]] script.
== Firmware ==
# Install the Xorg AMD video drivers: {{Cmd|# apk add xf86-video-ati}}
 
# For newer devices, use: {{Cmd|# apk add xf86-video-amdgpu}}
For [https://en.wikipedia.org/wiki/List%20of%20AMD%20graphics%20processing%20units Vega and later], the {{Pkg|linux-firmware-amdgpu}} package is required. Otherwise, the {{Pkg|linux-firmware-radeon}} should be used.
# 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.
 
See [https://wiki.gentoo.org/wiki/AMDGPU the relevant section on the Gentoo Wiki] for a more granular list of product names and microarchitecture names.


== Kernel Modesetting (KMS) ==
== Kernel Modesetting (KMS) ==


To enable KMS at boot:
To enable [[KMS]] at boot:
# Add the <code>radeon</code> and <code>fbcon</code> modules to {{Path|/etc/modules}}: {{Cmd|$ echo radeon >> /etc/modules<br />$ echo fbcon >> /etc/modules}}
 
# 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}}
# Install <code>mkinitfs</code>: {{Cmd|apk add mkinitfs}}
# Install <code>mkinitfs</code>: {{Cmd|apk add mkinitfs}}
# 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"}}
# 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"}}
Line 17: Line 19:
# Reboot to test the configuration.
# Reboot to test the configuration.


== Troubleshooting ==
== Wayland ==
=== Fixing MESA-LOADER errors===
 
{{Obsolete|Alpine no longer ships with the ''linux-hardened'' kernel}}
Install the following packages as needed:
 
* {{Pkg|mesa-dri-gallium}}: '''necessary''' Mesa drivers.
* {{Pkg|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:


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.
* <code>export MESA_LOADER_DRIVER_OVERRIDE=r300</code>: for AMD's Radeon R300, R400, and R500 GPUs.
* <code>export MESA_LOADER_DRIVER_OVERRIDE=r600</code>: for AMD's Radeon R600 GPUs up to Northern Islands. Officially supported by AMD.
* <code>export MESA_LOADER_DRIVER_OVERRIDE=radeonsi</code>: for AMD's Southern Island GPUs and later. Officially supported by AMD.


See https://bugs.alpinelinux.org/issues/7265
For VA-API:
* <code>export LIBVA_DRIVER_NAME=r600</code>
* <code>export LIBVA_DRIVER_NAME=radeonsi</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.
== Xorg ==


=== Fixing a frozen X11 when invoking startx ===
Install either the Free Software driver {{Pkg|xf86-video-ati}} or the proprietary amdgpu firmware {{Pkg|linux-firmware-amdgpu}}.


You may need to set the AccelMethod to exa not glamor which is the default for the driver.
<code>modprobe fbcon</code> might be needed to avoid black screen when leaving Xorg.


{{cat|/etc/X11/xorg.conf|
== See also ==
  Section "Device"
        Option      "AccelMethod"        "exa"
Identifier  "Card0"
Driver      "radeon"
BusID      "PCI:1:0:0"
  EndSection}}


* [https://wiki.archlinux.org/title/AMDGPU AMDGPU - ArchWiki]
* [https://wiki.archlinux.org/title/ATI ATI - ArchWiki]


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

Latest revision as of 13:14, 8 October 2023

The following instructions are for modern AMD GPU chipsets covered by the radeon and amdgpu drivers.

Firmware

For Vega and later, the linux-firmware-amdgpu package is required. Otherwise, the linux-firmware-radeon should be used.

See the relevant section on the Gentoo Wiki for a more granular list of product names and microarchitecture names.

Kernel Modesetting (KMS)

To enable KMS at boot:

  1. Add the radeon or amdgpu and fbcon modules to /etc/modules:

    $ echo radeon >> /etc/modules
    $ echo fbcon >> /etc/modules

    or

    $ echo amdgpu >> /etc/modules
    $ echo fbcon >> /etc/modules

  2. Install mkinitfs:

    apk add mkinitfs

  3. Enable the kms feature in the mkinitfs configuration by adding it to the features variable, e.g.,

    Contents of /etc/mkinitfs/mkinitfs.conf

    features="keymap cryptsetup kms ata base ide scsi usb virtio ext4"
  4. Run mkinitfs.
  5. Reboot to test the configuration.

Wayland

Install the following packages as needed:

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.

See also