GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing wiki.gentoo.org — AMDGPU - Gentoo wiki
Jump to: content
AMDGPUFrom Gentoo Wiki
AMDGPU is the open source graphics drivers for AMD Radeon and other GPUs. Older Radeon cards are supported by the radeon driver. InstallationSetting up a system to use AMDGPU requires identifying the proper card, installing the corresponding firmware, configuring the kernel, and installing the X11 driver. PrerequisitesHardware detectionTo choose the right driver, first detect the graphics card. Use lspci for this task: root #lspci | grep -i VGACheck the output for one of the product names listed in the table below. Feature supportVideo cores supported by the AMDGPU driver feature OpenGL 4.6 and OpenGL ES 3.2. The VIDEO_CARDS variable must be set to
FirmwareIt is necessary to install the proper firmware (or microcode) for the card. Firmware files are provided by sys-kernel/linux-firmware. There are two main approaches to loading firmware:
USE flags for sys-kernel/linux-firmware Linux firmware files
Data provided by the Gentoo Package Database
·
Last update: 2026-10-30 12:14
More information about USE flags
If using the savedconfig USE flag, make sure all necessary files for the hardware is in the configuration file. If in doubt, disable savedconfig until you know what you need. root #emerge --ask sys-kernel/linux-firmwareThe firmware files installed this way will be incorporated into the kernel. Note
Navi10 cards (RX 5700, RX 5700XT [FE]) require at least version 20190923 of sys-kernel/linux-firmware. Kernel Note
The easiest way of installation is to choose "AMD GPU" as a module (M) and to not have it included in an initramfs. This will load the driver a little later once udev becomes active and the firmware will never need to be manually managed in this case. Otherwise carefully read the Incorporating firmware section below. Set the following kernel options for the graphic chipsets mentioned above: KERNEL Configuring the kernel for AMD graphics (Linux kernels 4.15 and newer)
Processor type and features --->
[*] MTRR (Memory Type Range Register) support Search for <code>CONFIG_MTRR</code> to find this item.
Memory Management options --->
[*] Memory hotplug Search for <code>CONFIG_MEMORY_HOTPLUG</code> to find this item. --->
[*] Allow for memory hot remove Search for <code>CONFIG_MEMORY_HOTREMOVE</code> to find this item.
[*] Device memory (pmem, HMM, etc...) hotplug support Search for <code>CONFIG_ZONE_DEVICE</code> to find this item.
[*] Unaddressable device memory (GPU memory, ...) Search for <code>CONFIG_DEVICE_PRIVATE</code> to find this item.
Device Drivers --->
[*] PCI support Search for <code>CONFIG_PCI</code> to find this item. --->
[*] PCIE Express Port Bus support Search for <code>CONFIG_PCIEPORTBUS</code> to find this item. --->
[*] PCIE Express Hotplug driver Search for <code>CONFIG_HOTPLUG_PCI_PCIE</code> to find this item.
Graphics support --->
<*/M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) Search for <code>CONFIG_DRM</code> to find this item. --->
Supported DRM clients --->
[*] Enable legacy fbdev support for your modesetting driver Search for <code>CONFIG_DRM_FBDEV_EMULATION</code> to find this item.
< > ATI Radeon Search for <code>CONFIG_DRM_RADEON</code> to find this item.
<M/*> AMD GPU Search for <code>CONFIG_DRM_AMDGPU</code> to find this item.
[ /*] Enable amdgpu support for SI parts Search for <code>CONFIG_DRM_AMDGPU_SI</code> to find this item.
(only needed for Southern Islands GPUs with the amdgpu driver)
[ /*] Enable amdgpu support for CIK parts Search for <code>CONFIG_DRM_AMDGPU_CIK</code> to find this item.
(only needed for Sea Islands GPUs with the amdgpu driver)
ACP (Audio CoProcessor) Configuration --->
[*] Enable AMD Audio CoProcessor IP support Search for <code>CONFIG_DRM_AMD_ACP</code> to find this item.
(only needed for APUs)
Display Engine Configuration --->
[*] AMD DC - Enable new display engine Search for <code>CONFIG_DRM_AMD_DC</code> to find this item.
[ /*] AMD DC support for Southern Islands ASICs Search for <code>CONFIG_DRM_AMD_DC_SI</code> to find this item.
[*] HSA kernel driver for AMD GPU devices Search for <code>CONFIG_HSA_AMD</code> to find this item.
[*] Enable HMM-based shared virtual memory manager Search for <code>CONFIG_HSA_AMD_SVM</code> to find this item.
<*/M> Sound card support Search for <code>CONFIG_SOUND</code> to find this item. --->
<*/M> Advanced Linux Sound Architecture Search for <code>CONFIG_SND</code> to find this item. --->
[*] PCI sound devices Search for <code>CONFIG_SND_PCI</code> to find this item. --->
HD-Audio --->
<*> HD Audio PCI Search for <code>CONFIG_SND_HDA_INTEL</code> to find this item.
[ /*] Support initialization patch loading for HD-audio Search for <code>CONFIG_SND_HDA_PATCH_LOADER</code> to find this item.
[ /*] Use the device identifier field for controls Search for <code>CONFIG_CONFIG_SND_HDA_CTL_DEV_ID</code> to find this item.
(2048) Pre-allocated buffer size for HD-audio driver Search for <code>CONFIG_SND_HDA_PREALLOC_SIZE</code> to find this item.
<*> Build whatever audio codec your soundcard needs codec support
<*/M> HD-audio HDMI codec support Search for <code>CONFIG_SND_HDA_CODEC_HDMI</code> to find this item.
Note
Some older graphics cards are supported by both the amdgpu and the radeon kernel module. When using AMDGPU, it is recommended to unset the ATI Radeon option so that the radeon module is not built, or alternatively, to blacklist the radeon module (after rebooting check with lsmod | grep radeon to see if the blacklisting worked). The two modules are not meant to be loaded simultaneously, unless for specific systems that require it, e.g. for multiseat configurations. The options from the Sound card support menu need only to be set if the card supports HDMI or DisplayPort audio and its use is desired. On newer kernels where Enable AMD Audio CoProcessor IP support appears, that should also be set. AMDGPU with Display Core was first implemented for VEGA10 (GCN5.0) and RAVEN (with DCN 1.0) GPUs/APUs. Kernels before version 4.17 have (experimental) DC support for older cards (GCN1.1 and newer) via command line option amdgpu.dc=1, which may work better than the older radeon kernel module. Likewise, if DC needs to be disabled for any particular reason, option amdgpu.dc=0 can be used on the kernel command line. See the radeon article for more details about using HDMI/DisplayPort audio. Incorporating firmwareThe firmware package installed in an earlier section provides files in /lib/firmware/amdgpu (for Volcanic Islands and newer cards) and/or /lib/firmware/radeon (for Southern Islands and Sea Islands cards). AMDGPU must be able to access the correct firmware files when it is loaded. Important
If the amdgpu module is compiled as a loadable kernel module (i.e. AMDGPU in the kernel configuration is set to M), the firmware files need to be accessible at the time it is loaded. In particular, if the module is loaded from an initrd/initramfs, the kernel will initialize it during early boot, just like when the module is built into the kernel directly (i.e. AMDGPU in the kernel configuration is set to *). For the firmware files to be accessible at this stage they need to be either included in the initrd/initramfs (which needs to be loaded by the bootloader, e.g. GRUB) or included directly in the kernel image.KERNEL Including firmware in the kernel (4.18 and later)
Device Drivers --->
Generic Driver Options --->
Firmware loader --->
[*] Firmware loading facility Search for <code>CONFIG_FW_LOADER</code> to find this item.
(amdgpu/<YOUR-MODEL>.bin or radeon/<YOUR-MODEL>.bin) External firmware blobs to build into the kernel binary Search for <code>CONFIG_EXTRA_FIRMWARE</code> to find this item.
(/lib/firmware) Firware blobs root directory Search for <code>CONFIG_EXTRA_FIRMWARE_DIR</code> to find this item.
Note
With Dracut it is easily possible to add files to the image. Likewise, with the now unmaintained genkernel (since sys-kernel/genkernel > 4.0) it is also possible to include specified firmware files in an initramfs. Important
Kernel 4.19.9[17] (Dec. 2018) requires a different (older) set of firmware files than listed here in order to boot successfully. For all current kernels it is recommended to always make sure that sys-kernel/linux-firmware is updated. In the case that the firmware needs to be included in the kernel or in an initramfs, and if using the savedconfig USE flag for sys-kernel/linux-firmware, make sure that the savedconfig configuration file is updated with a changed set of firmware files as well (like the change in 2018 mentioned above). Incorporate all the newly added files to the kernel configuration file in the firmware line, then rebuild and install the new kernel image. Otherwise boot will likely fail with a blank screen and firmware load errors thrown to the kernel log. It is important you include all the firmware blobs that are needed by the driver. The required blobs can either be determined by a discovery approach or, if you know your card model, using the table in the next section. Discovering which firmware blobs are neededIn the case you are unsure which blobs are needed, a trial and error method often leads to success. In a multi-step process a basic bootable system may suffice to get the required information: missing firmware is indicated by an amdgpu error in dmesg, which helps to identify the required firmware files. Note
This method will, without any firmware files, very likely result in a blank screen since the AMDGPU driver doesn't work properly without firmware. A very basic method to still get the required information is to type in the blind and save the dmesg output into a file, which can be analyzed when rebooting without the AMDGPU driver in use. A better choice might be to intermittently include all the firmware as in amdgpu/* since dmesg will, tied to CONFIG_GENTOO_PRINT_FIRMWARE_INFO=y being set in the kernel .config, show which firmware was loaded, or to force the use of another framebuffer driver (like vesafb or efifb).root #dmesg -t | grep amdgpu | grep firmwareamdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_sdma.bin failed with error -2 [drm:sdma_v4_0_early_init] *ERROR* sdma_v4_0: Failed to load firmware "amdgpu/green_sardine_sdma.bin" amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_asd.bin failed with error -2 root #dmesg -t | grep amdgpu | grep firmware Loading firmware: amdgpu/green_sardine_sdma.bin Loading firmware: amdgpu/green_sardine_asd.bin Loading firmware: amdgpu/green_sardine_ta.bin Loading firmware: amdgpu/green_sardine_pfp.bin Loading firmware: amdgpu/green_sardine_me.bin Loading firmware: amdgpu/green_sardine_ce.bin Loading firmware: amdgpu/green_sardine_rlc.bin Loading firmware: amdgpu/green_sardine_mec.bin Loading firmware: amdgpu/green_sardine_dmcub.bin Loading firmware: amdgpu/green_sardine_vcn.bin Important
The following will only work when sys-kernel/linux-firmware is installed and the required (but in the example above missing) firmware is actually available. For very new graphics cards the firmware may be included in the unstable package, which can be installed using ~ in ACCEPT_KEYWORDS, e.g. ~amd64 like in ACCEPT_KEYWORDS="~amd64" emerge --ask sys-kernel/linux-firmware or by adding it to /etc/portage/package.accept_keywords.The way the AMDGPU firmware files are named, all files starting with the GPU model code name are the right firmware blobs to include. In the above example the code name is "Green Sardine", thus this command looking for user $ls /lib/firmware/amdgpu/green_sardine*.bin | sed 's/\/lib\/firmware\///' | echo $(cat) amdgpu/green_sardine_asd.bin amdgpu/green_sardine_ce.bin amdgpu/green_sardine_dmcub.bin amdgpu/green_sardine_me.bin amdgpu/green_sardine_mec2.bin amdgpu/green_sardine_mec.bin amdgpu/green_sardine_pfp.bin amdgpu/green_sardine_rlc.bin amdgpu/green_sardine_sdma.bin amdgpu/green_sardine_ta.bin amdgpu/green_sardine_vcn.bin Note
If using genkernel, refer to the Firmware loading section there. If using Dracut, refer to the Adding files to the image section. Firmware blobs for a known card modelIf you know what card model you have then this section will tell you which blobs you need.
user $echo amdgpu/tonga_{ce,k_smc,mc,me,mec2,mec,pfp,rlc,sdma1,sdma,smc,uvd,vce}.binamdgpu/tonga_ce.bin amdgpu/tonga_k_smc.bin amdgpu/tonga_mc.bin amdgpu/tonga_me.bin amdgpu/tonga_mec2.bin amdgpu/tonga_mec.bin amdgpu/tonga_pfp.bin amdgpu/tonga_rlc.bin amdgpu/tonga_sdma1.bin amdgpu/tonga_sdma.bin amdgpu/tonga_smc.bin amdgpu/tonga_uvd.bin amdgpu/tonga_vce.bin Then After expanding the firmware file names from the following table and copying them into the kernel configuration, save the configuration, then compile and install the new kernel and modules.
X11 driverEmergePortage uses the VIDEO_CARDS USE_EXPAND variable for enabling support for various graphics cards in packages. Setting VIDEO_CARDS to FILE /etc/portage/package.use/00video*/* VIDEO_CARDS: -* amdgpu radeonsi Note
All AMD video cards supported by amdgpu require video_cards_radeonsi to enable OpenGL support provided by media-libs/mesa.root #emerge --ask --deep --changed-use @worldThe system should now be prepared to use amdgpu after the next reboot. Power management Note
This section only covers the newer AMDGPU Dynamic Power Management (DPM) methods (beginning from Radeon HD 2000 series / r600). Older dynpm and profile methods can be found on the radeon wiki page. Dynamic Power Management (DPM) is a technique that allows for the driver to dynamically adjust the core clock frequency, memory clock frequency, and voltage levels based on the current GPU demand. Since kernel 3.13, DPM is enabled by default for a majority of AMD hardware.[18] AMDGPU supports PowerPlay profiles. These profiles replaced the Important
The following sections assume that card0 is the GPU users want to adjust. Identify the correct card number listed in /sys/class/drm/ and modify the commands accordingly. To check if the system is using PowerPlay, review the contents of the devices's sysfs directory: user $ls /sys/class/drm/card0/device/pp_*Any files returned with the Warning
The 'files' in /sys/class/drm/card0/device/ expose low-level graphics APIs. Changing their contents requires specific command operations and may irrevocably damage system hardware.[19] Enabling DPM and PowerPlay featuresDPMThe following kernel parameter can be used to explicitly enable (1) or disable (0) DPM. The default is -1 (auto)[20]. CODE Enable DPM amdgpu.dpm=1 PowerPlay feature mask Note
Enabling DPM also appears to enable PowerPlay, if it is supported, as the kernel parameter amdgpu.powerplay has not been documented since kernel 4.5[21].The PowerPlay feature mask kernel parameter overrides display features of the GPU. It is required to unlock access to adjust clocks and voltages in sysfs. The mask consists of 32 bits, currently there are 20 features implemented[22]. The default is the current set of stable display features[23]. CODE kernel:root/drivers/gpu/drm/amd/include/amd_shared.h * @PP_SCLK_DPM_MASK: Dynamic adjustment of the system (graphics) clock. * @PP_MCLK_DPM_MASK: Dynamic adjustment of the memory clock. * @PP_PCIE_DPM_MASK: Dynamic adjustment of PCIE clocks and lanes. * @PP_SCLK_DEEP_SLEEP_MASK: System (graphics) clock deep sleep. * @PP_POWER_CONTAINMENT_MASK: Power containment. * @PP_UVD_HANDSHAKE_MASK: Unified video decoder handshake. * @PP_SMC_VOLTAGE_CONTROL_MASK: Dynamic voltage control. * @PP_VBI_TIME_SUPPORT_MASK: Vertical blank interval support. * @PP_ULV_MASK: Ultra low voltage. * @PP_ENABLE_GFX_CG_THRU_SMU: SMU control of GFX engine clockgating. * @PP_CLOCK_STRETCH_MASK: Clock stretching. * @PP_OD_FUZZY_FAN_CONTROL_MASK: Overdrive fuzzy fan control. * @PP_SOCCLK_DPM_MASK: Dynamic adjustment of the SoC clock. * @PP_DCEFCLK_DPM_MASK: Dynamic adjustment of the Display Controller Engine Fabric clock. * @PP_OVERDRIVE_MASK: Over- and under-clocking support. * @PP_GFXOFF_MASK: Dynamic graphics engine power control. * @PP_ACG_MASK: Adaptive clock generator. * @PP_STUTTER_MODE: Stutter mode. * @PP_AVFS_MASK: Adaptive voltage and frequency scaling. * @PP_GFX_DCS_MASK: GFX Async DCS. Determine the current system mask: user $printf 'amdgpu.ppfeaturemask=0x%x\n' "$(($(cat /sys/module/amdgpu/parameters/ppfeaturemask)))"
amdgpu.ppfeaturemask=0x0007bfff Features may be changed by setting the kernel parameter at boot. CODE Set PowerPlay mask amdgpu.ppfeaturemask=0x0007bfff Note
Setting all 32 bits ( 0xffffffff) is not recommended as this will enable potentially unstable features by default. Warning
Enabling or disabling features without understanding their intent may lead to hardware damage or data loss. Note
On recent kernels like v6.14 (or those that contain commit b472b8d829c1), the CPU will be tainted as being out-of-spec if overdrive is enabled. Configuration Warning
Some of these instructions interface directly with the hardware and have the potential to irreversibly damage the device. Proofread the commands before executing. AMDGPU handles configuration of the hardware through exposed APIs, using sysfs files located in /sys/class/drm/card0/device/. The files contained within this directory will depend on the specific hardware and features that are enabled. Some of the files can be safely read by the user using Adjusting the clock rates and voltages (under/over clocking) is accomplished through the DPM and PowerPlay APIs. The full documentation can be found at kernel.org and should be reviewed before proceeding. Viewing current metricsThe amdgpu driver provides a sysfs API for retrieving current gpu metrics data through the It can be parsed using a script such as amdgpu_metrics.py Update feature maskBefore any parameters can be adjusted, the correct feature mask must be set with a kernel parameter. Generally, setting the PP_OVERDRIVE_MASK bit Determine the new system mask. user $printf 'amdgpu.ppfeaturemask=0x%x\n' "$(($(cat /sys/module/amdgpu/parameters/ppfeaturemask) | 0x4000))"
amdgpu.ppfeaturemask=0x0007ffff Update kernel parameter. CODE kernel parameter: PowerPlay feature mask amdgpu.ppfeaturemask=0x0007ffff Performance profilesThe amdgpu driver provides a sysfs API for adjusting certain power related parameters. The file The performance profile must be set to manual to enable modification of power profiles, clock speeds, and voltages. To change the current profile: root #echo 'manual' > /sys/class/drm/card0/device/power_dpm_force_performance_level Note
These changes do not persist after a reboot. Power statesThe amdgpu driver provides a sysfs API for adjusting the heuristics related to switching between power levels in a power state. The file To view the supported profiles look at the contents of the Note
The output of this command will vary depending on the specific hardware and kernel drivers. user $cat /sys/class/drm/card0/device/pp_power_profile_mode PROFILE_INDEX(NAME) CLOCK_TYPE(NAME) FPS MinFreqType MinActiveFreqType MinActiveFreq BoosterFreqType BoosterFreq PD_Data_limit_c PD_Data_error_coeff PD_Data_error_rate_coeff
0 BOOTUP_DEFAULT :
0( GFXCLK) 0 5 1 0 4 800 4587520 -65536 0
1( SOCCLK) 0 5 1 0 1 0 3276800 -6553 -6553
2( MEMLK) 0 5 1 0 4 800 327680 -65536 0
1 3D_FULL_SCREEN :
0( GFXCLK) 0 5 1 0 4 650 4587520 -3276 -65536
1( SOCCLK) 0 5 1 0 1 0 655360 -6553 -6553
2( MEMLK) 0 5 4 850 4 800 327680 -65536 0
2 POWER_SAVING :
0( GFXCLK) 0 5 1 0 3 0 5898240 -65536 0
1( SOCCLK) 0 5 1 0 1 0 3407872 -6553 -6553
2( MEMLK) 0 5 1 0 3 0 1966080 -65536 0
3 VIDEO*:
0( GFXCLK) 0 5 1 0 4 500 4587520 -65536 0
1( SOCCLK) 0 5 1 0 1 0 3473408 -6553 -6553
2( MEMLK) 0 5 1 0 4 500 1966080 -65536 0
4 VR :
0( GFXCLK) 0 5 4 1000 1 0 3932160 0 0
1( SOCCLK) 0 5 1 0 1 0 655360 -6553 -6553
2( MEMLK) 0 5 1 0 4 800 327680 -65536 0
5 COMPUTE :
0( GFXCLK) 0 5 4 1000 1 0 3932160 0 0
1( SOCCLK) 0 5 1 0 1 0 655360 -6553 -6553
2( MEMLK) 0 5 4 850 3 0 327680 -65536 -32768
6 CUSTOM :
0( GFXCLK) 0 5 1 0 4 800 4587520 -65536 0
1( SOCCLK) 0 5 1 0 1 0 3276800 -6553 -6553
2( MEMLK) 0 5 1 0 4 800 327680 -65536 0
To update the power profile, first change the performance mode to manual. root #echo 'manual' > /sys/class/drm/card0/device/power_dpm_force_performance_levelThen update root #echo '3' > /sys/class/drm/card0/device/pp_power_profile_modeThe power profiles can be modified by sending commands to the For example, to change the root #echo '6 0 0 5 1 0 4 500 4587520 -65536 0' > /sys/class/drm/card0/device/pp_power_profile_mode Note
These changes do not persist after a reboot. Power levelsThe amdgpu driver provides a sysfs API for adjusting what power levels are enabled for a given power state. The files
Reading back the files will show the available power levels within the power state and the clock information for those levels. user $cat /sys/class/drm/card0/device/pp_dpm_sclk0: 500Mhz 1: 700Mhz * 2: 2765Mhz user $cat /sys/class/drm/card0/device/pp_dpm_mclk0: 96Mhz * 1: 541Mhz 2: 675Mhz 3: 1094Mhz Clock speed and voltageThe amdgpu driver provides a sysfs API for adjusting the clocks and voltages in each power level within a power state. The Determine the current values. user $cat /sys/class/drm/card0/device/pp_od_clk_voltageOD_SCLK: 0: 700Mhz 1: 2744Mhz OD_MCLK: 0: 97Mhz 1: 1094MHz OD_VDDGFX_OFFSET: 0mV OD_RANGE: SCLK: 500Mhz 3150Mhz MCLK: 674Mhz 1200Mhz Note
The actual memory controller clock rates are shown here, not the effective clock of the DRAMs. To update the clock speeds and voltages, first change the performance mode to manual. root #echo 'manual' > /sys/class/drm/card0/device/power_dpm_force_performance_levelThen write a string to the file for each adjustment. Follow the syntax given in the kernel documentation. root #echo 's 1 2410' > /sys/class/drm/card0/device/pp_od_clk_voltageroot #echo 'm 1 1024' > /sys/class/drm/card0/device/pp_od_clk_voltageOnce finished, commit your changes. root #echo 'c' > /sys/class/drm/card0/device/pp_od_clk_voltageuser $cat /sys/class/drm/card0/device/pp_od_clk_voltageOD_SCLK: 0: 700Mhz 1: 2410Mhz OD_MCLK: 0: 97Mhz 1: 1024MHz OD_VDDGFX_OFFSET: 0mV OD_RANGE: SCLK: 500Mhz 3150Mhz MCLK: 674Mhz 1200Mhz These changes can be reverted. root #echo 'r' > /sys/class/drm/card0/device/pp_od_clk_voltage Note
These changes do not persist after a reboot. TroubleshootingDebug toolsx11-apps/mesa-progsIt might be helpful to install the package x11-apps/mesa-progs, which provides the glxgears and glxinfo utilities.
sys-apps/amdgpu_topThe AMD/Radeon usage viewer app-misc/radeontop is no longer developed and incompatible with newer GPU's. sys-apps/amdgpu_top is a replacement and has a TUI and GUI interface. Identifying which graphics card is in useFirst make sure that the kernel was compiled with the following settings: KERNEL Activate VGA Arbitration and Laptop Hybrid Graphics
Device Drivers --->
Graphics support --->
[*] VGA Arbitration Search for <code>CONFIG_VGA_ARB</code> to find this item.
[*] Laptop Hybrid Graphics - GPU switching support Search for <code>CONFIG_VGA_SWITCHEROO</code> to find this item.
Check, if the discrete graphics card was recognized: user $lspci -k[...]
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Mars [Radeon HD 8670A/8670M/8750M]
Subsystem: Lenovo Mars [Radeon HD 8670A/8670M/8750M]
Kernel driver in use: radeon
[...]
After that. Make sure that the path /sys/kernel/debug/ was mounted successfully: root #findmnt debugfsTARGET SOURCE FSTYPE OPTIONS /sys/kernel/debug debugfs debugfs rw,nosuid,nodev,noexec,relatime Then, check, if the driver vga_switcheroo was loaded successfully and can output values: root #cat /sys/kernel/debug/vgaswitcheroo/switch0:DIS: :DynOff:0000:01:00.0 1:IGD:+:Pwr:0000:00:02.0 This output has the following structure[24]:
The status can be manipulated using the following command: root #echo "<some_parameter>" > /sys/kernel/debug/vgaswitcheroo/switchReplace
By using the environment variable user $DRI_PRIME=1 glxgearsThis opens an X window with rotating gears. Let it run in the background and check, root #cat /sys/kernel/debug/vgaswitcheroo/switch0:DIS: :DynPwr:0000:01:00.0 1:IGD:+:Pwr:0000:00:02.0 Note
This time the status of the discrete graphics card switched to DynPwr, which means, that it is active and running. Another indicator is to check the temperature sensors. This requires sys-apps/lm-sensors: user $sensors[...] radeon-pci-0100 Adapter: PCI adapter temp1: +42.0°C (crit = +120.0°C, hyst = +90.0°C) [...] Note
When vga_switcheroo displays the status DynOff, sensors will display the temperature as N/A or as something else, which may not make sense; for example: -128°C.To use the discrete graphics card globally, one can set the environment variable in the /etc/environment file: FILE /etc/environmentDRI_PRIME=1 One might export it in the ~/.bashrc file as an alternative: FILE /home/larry/.bashrcexport DRI_PRIME=1 Or individually in front of the command, like above using glxgears: user $DRI_PRIME=1 /usr/bin/chromium
user $DRI_PRIME=1 /usr/bin/vlc
Prime SynchronizationThe x11-drivers/xf86-video-amdgpu driver does not support Prime Synchronization. This might cause tearing on monitors connected to the integrated GPU if the AMD GPU is set as the primary GPU. One possible workaround is to use the modesetting driver instead, to do this remove FILE /etc/X11/xorg.conf.d/force-modesetting.confSection "Device" Identifier "modesetting" Driver "modesetting" EndSection Another possible workaround is to set the integrated GPU as the primary GPU. This will not enable Prime Synchronization. However, tearing will be prevented nonetheless through AMD's TearFree. In this case it will be necessary to use the Fallback driverIf having no other machine to browse web pages for solutions, the vesa or fbdev drivers can be used to start X without 3d and 2d acceleration. FILE /etc/portage/package.use/00video*/* VIDEO_CARDS: ... vesa fbdev root #emerge --ask --update --newuse --deep @worldKernelOlder kernelsOlder kernels that do not support the amdgpu driver will not provide the AMDGPU option. For VEGA and newer chips there is no video output without DC (Display Code), which was first included in vanilla Kernel 4.15. In both cases a fairly recent kernel can provide the required drivers. For very new AMD graphics cards and APUs trying a not yet stable kernel package (denoted by a ~, see KEYWORDS) may provide the required kernel-sources. AMD Secure Memory EncryptionIf amdgpu fails to load or the screen stays frozen, it might be an incompatibility of the amdgpu module with AMD Secure Memory Encryption (SME). SME can be temporarily disabled on the kernel command line (using GRUB, or in /etc/default/grub or as part of GRUB_CMDLINE_LINUX) by adding mem_encrypt=off. If this fixes the issue, a permanent solution is to configure the kernel accordingly. KERNEL
Processor type and features --->
[*] AMD Secure Memory Encryption (SME) support Search for <code>CONFIG_AMD_MEM_ENCRYPT</code> to find this item.
[ ] Activate AMD Secure Memory Encryption (SME) by default Search for <code>CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT</code> to find this item.
AMD_MEM_ENCRYPT may remain enabled, but either AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT must remain unset or the kernel command line option mem_encrypt=off must be used in order to turn Memory Encryption off. Likewise, with mem_encrypt=on SME can be activated for unaffected systems on the kernel command line or more permanently using GRUB_CMDLINE_LINUX in /etc/default/grub for GRUB. AMDGPU/RadeonSI drivers do not workIf the graphics card is not supported by including FILE /etc/portage/package.use/00video*/* VIDEO_CARDS: -* amdgpu radeonsi radeon After the values have been set update the system so the changes take effect: root #emerge --ask --changed-use --deep @worldFull-screen windows perform poorlyThe installed version of sys-devel/llvm may be too old. Try emerging an unstable/testing version. GPU Name shows up as idThe installed version of x11-libs/libdrm may be too old. Try emerging an unstable/testing version. This might also improve performance. Xrandr doesn't see HDMI port with hybrid systemOn hybrid system with AMD iGPU and dGPU xrandr can show only eDP port, but not HDMI: user $xrandrScreen 0: minimum 320 x 200, current 1920 x 2160, maximum 16384 x 16384 eDP connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 382mm x 215mm 1920x1080 144.03*+ 60.01 1680x1050 144.03 1280x1024 144.03 1440x900 144.03 1280x800 144.03 1280x720 144.03 1024x768 144.03 800x600 144.03 640x480 144.03 Whereas Xorg log shows that port was detected and EDID of the monitor decoded without issues: user $cat /var/log/Xorg.0.log[...] [ 8.282] (II) AMDGPU(G0): Output HDMI-A-1-0 has no monitor section [ 8.294] (II) AMDGPU(G0): EDID for output HDMI-A-1-0 [ 8.295] (II) AMDGPU(G0): Manufacturer: DEL Model: a11e Serial#: 843731010 [...] [ 8.295] (II) AMDGPU(G0): Supported established timings: [ 8.295] (II) AMDGPU(G0): 720x400@70Hz [...] [ 8.295] (II) AMDGPU(G0): EDID (in hex): [ 8.295] (II) AMDGPU(G0): 00ffffffffffff0010ac1ea142504a32 [ 8.295] (II) AMDGPU(G0): 0c1f010380351e78ea05f5a557529c27 [...] [ 8.296] (II) AMDGPU(G0): Printing probed modes for output HDMI-A-1-0 [ 8.296] (II) AMDGPU(G0): Modeline "1920x1080"x60.0 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync (67.5 kHz eP) [...] If it doesn't then it is different issue. And it should be addressed first. Xrandr would have 2 providers since there are 2 GPUs: user $xrandr --listprovidersProviders: number : 2 Provider 0: id: 0x54 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:07:00.0 Provider 1: id: 0x84 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 5 outputs: 1 associated providers: 1 name:Radeon RX 5500M @ pci:0000:03:00.0 And we need to link source with output: user $xrandr --setprovideroutputsource provider sourceIn provided example it would be this: user $xrandr --setprovideroutputsource 1 0After this xrandr shows HDMI and can manipulate layout properly: user $xrandrScreen 0: minimum 320 x 200, current 1920 x 2160, maximum 16384 x 16384 eDP connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 382mm x 215mm 1920x1080 144.03*+ 60.01 [...] HDMI-A-1-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm 1920x1080 60.00*+ 50.00 59.94 [...] Screen TearingOne method to prevent screen tearing on Xorg is to enable the TearFree option in X11 like so: FILE /usr/share/X11/xorg.conf.d/10-amdgpu.confSection "OutputClass" Identifier "AMDgpu" MatchDriver "amdgpu" Driver "amdgpu" Option "TearFree" "true" EndSection Flickering and white screens Note
This issue has already been reported in the Gentoo forums: https://forums.gentoo.org/viewtopic-t-1160883.html The suggested fix at upstream level is to set the sg_display module parameter like this:
As an alternative apply the following patch to the kernel source code: https://patchwork.freedesktop.org/patch/519023 Seems to concern Linux kernels >= 6.1.4. Frequent and Sporadic CrashesSome users may be experiencing frequent and seemingly random graphics card crashes while using the AMDGPU drivers. Checking the kernel log may show many different errors, some common ones involving This may be caused by an unintentional overclocking of the hardware, either by the AMDGPU driver or the device firmware. The following steps will show how to check the current system configuration and state. If discrepancies are found, reference the Power management section above for details on how to modify these values. Note
This is a specific example discovered by one user. The examples below assume the GPU is CARD0 and the output is specific to a Radeon™ RX 6650 XT EAGLE 8G. Note
This only applies to hardware that has Dynamic Power Management (DPM) enabled. DPM is turned on by default for most modern AMDGPUs. Begin by looking up the graphics card specifications, using a database such as the TechPowerUp GPU Database or the manufacturer's specifications.
In this example:
user $cd /sys/class/drm/card0/device/View the defined core and memory clock rates listed in the user $cat pp_dpm_sclk0: 500Mhz 1: 700Mhz * 2: 2765Mhz user $cat pp_dpm_mclk0: 96Mhz * 1: 541Mhz 2: 675Mhz 3: 1094Mhz Verify the engine clock Verify the DRAM memory clock This device uses GDDR6 (G6), which is dual channel Double Data Rate (DDR) memory[27][28][29].
user $cat pp_od_clk_voltageOD_SCLK: 0: 700Mhz 1: 2744Mhz OD_MCLK: 0: 97Mhz 1: 1094MHz OD_VDDGFX_OFFSET: 0mV OD_RANGE: SCLK: 500Mhz 3150Mhz MCLK: 674Mhz 1200Mhz The overdrive (boost) engine SCLK range is set to allow values between 500 and 3150 MHz for the engine clock. With discrete steps at 700 MHz and 2744 MHz. The overdrive (boost) memory MCLK range is set to allow values between 674 MHz and 1200 MHz for the actual memory clock (1348 MHz and 2400 MHz effective). With discrete steps at 97 MHz and 1094 MHz. Note
The relationship between OD_SCLK, OD_MCLK, and OD_RANGE is not well documented. The values presented above were as-found on the system in question. Combining all of this information together and comparing the reported and specified values shows a discrepancy for clock rates, with some well above the recommended values. Adjusting these limits (under-clocking the defaults) has resulted in zero crashes, and improved thermal and FPS performance.
Missing cursor on RDNA3 GPUsHardware cursor doesn't work on new GPUs. To make cursor visible you should add software cursor option into 20-amdgpu.conf. FILE /etc/X11/xorg.conf.d/20-amdgpu.confSection "Device" Identifier "AMD" Driver "amdgpu" Option "SWCursor" "True" EndSection Note that in X11 sessions this option may also fix high CPU usage when moving the cursor in some situations (cf these Gentoo/Arch forum posts). ToolsSome tools to monitor and configure the GPU are available (not limited to AMD.) These two are GUI tools: See also
External resources
References
Retrieved from "https://wiki.gentoo.org/index.php?title=AMDGPU&oldid=1459025"
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |