Enable AMDGPU Linux Driver in Debian Ubuntu mint

To enable amdgpu we have to set special kernel boot parameters.  The easiest way is to make it permanent and apply to all kernels (no messing around with grub.cfg) so we'll edit those defaults in /etc/default/grub by changing the GRUB_CMDLINE_LINUX_DEFAULT parameter.  After that don't forget to run "update-grub" to apply it (otherwise amdgpu will never be enabled).

The opensource driver for AMD is really quite impressive these days, as we show it works with very old radeon SI/CIK cards and even well with newer Vega iGPU/APU.

Using an AMD APU/iGPU is a great option to save power and space, especially over portable options like Intel NUC or Intel laptops that don't have a dedicated Nvidia GPU.  However, I would say that the AMD driver's from AMD are horrible, there are all kinds of issues almost like the old ATI days in getting them consistently working.  But once again, the built-in kernel support for AMDGPU in at least kernel 4.15 is excellent and provides excellent performance out of the box.

First check with lshw to see if amdgpu is being used

If the driver is already amdgpu, you don't need to do anything else to enable it.

lshw -c video|grep driver
WARNING: you should run this program as super-user.
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
       configuration: driver=amdgpu latency=0
 

Before checking this, most newer distros such as Ubuntu 18+ or Mint 19+ AKA Debian Buster with at least 4.15 kernel seem to support amdgpu just fine without extra options.

Some different distros and older kernels may still need some probing.

Requirements

No clue really as it really depends. But for example this does not work on older 4.4 kernels.  I tested this on a newer kernel such as 4.15 and it worked fine.  So if you follow this and it doesn't work, try updating to the latest possible kernel for your distro.

1. Edit /etc/default/grub

vi /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.cik_support=1 amdgpu.si_support=1 radeon.si_support=0 radeon.cik_support=0"

sudo update-grub

2. Remove any old radeon.conf files otherwise Xorg will not start

sudo mv /usr/share/X11/xorg.conf.d/20-radeon.conf ~/

3. Now put in an amdgpu conf file

sudo vi /usr/share/X11/xorg.conf.d/10-amdgpu.conf


Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
EndSection

Section "Device"
    Identifier "Card0"
    Driver "amdgpu"
    Option "TearFree" "on"
    Option "DRI3" "1"
EndSection

4. Now reboot and cross your fingers!

and check to see if amdgpu is enabled

Notice one card is using amdgpu because it supports it (Kabini based SI Radeon HD 8330E) but the other card (Radeon E6460) is using radeon.  This is because that card isn't supported by the amdgpu driver.

sudo lshw -c video


  *-display              
       description: VGA compatible controller
       product: Kabini [Radeon HD 8330E]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 1
       bus info: pci@0000:00:01.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=amdgpu latency=0
       resources: irq:37 memory:e0000000-efffffff memory:f0000000-f07fffff ioport:3000(size=256) memory:f0a00000-f0a3ffff memory:c0000-dffff
  *-display
       description: VGA compatible controller
       product: Seymour [Radeon E6460]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:43 memory:d0000000-dfffffff memory:f0900000-f091ffff ioport:2000(size=256) memory:f0940000-f095ffff

Key Requirement To High Performance with iGPU/APU

Have enough RAM if you have an iGPU/APU CPU and have dual channel RAM (eg. 2 sticks of RAM and not just 1).  Eg. Vega etc...

Add more RAM, as a test I tried with 8GB of RAM and then added 16GB RAM. A simple benchmark like glxgears yielded a 12% improvement right away.  FPS in various 3D games and applications were about 50% higher.  This is because, I believe the GPU is able to dedicate more RAM for VRAM, which in turn results in higher performance.

Even 2D performance becomes significantly better, so I'd say that you should have a minimum of 16GB of RAM for better GPU performance, or at least dual channel as this is likely the main factor the actual faster performance.

Other Performance Tuning Tweaks

These tweaks still seem applicable to even Raven Ridge iGPUs eg. Vega 11 and other Vega GPUs.

You can set the dpm performance level to push the memory and GPU frequency to the highest levels (maximum performance).  I find this is much more desirable than auto on any video card where you get some 2D lag at some points while the GPU ramps up performance.

By default the performance of the card is set to 'auto' if you want high performance or max performance do this:

echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level

Check clockspeed and other info:

cat /sys/kernel/debug/dri/0/amdgpu_pm_info
Clock Gating Flags Mask: 0x0
    Graphics Medium Grain Clock Gating: Off
    Graphics Medium Grain memory Light Sleep: Off
    Graphics Coarse Grain Clock Gating: Off
    Graphics Coarse Grain memory Light Sleep: Off
    Graphics Coarse Grain Tree Shader Clock Gating: Off
    Graphics Coarse Grain Tree Shader Light Sleep: Off
    Graphics Command Processor Light Sleep: Off
    Graphics Run List Controller Light Sleep: Off
    Graphics 3D Coarse Grain Clock Gating: Off
    Graphics 3D Coarse Grain memory Light Sleep: Off
    Memory Controller Light Sleep: Off
    Memory Controller Medium Grain Clock Gating: Off
    System Direct Memory Access Light Sleep: Off
    System Direct Memory Access Medium Grain Clock Gating: Off
    Bus Interface Medium Grain Clock Gating: Off
    Bus Interface Light Sleep: Off
    Unified Video Decoder Medium Grain Clock Gating: Off
    Video Compression Engine Medium Grain Clock Gating: Off
    Host Data Path Light Sleep: Off
    Host Data Path Medium Grain Clock Gating: Off
    Digital Right Management Medium Grain Clock Gating: Off
    Digital Right Management Light Sleep: Off
    Rom Medium Grain Clock Gating: Off
    Data Fabric Medium Grain Clock Gating: Off

uvd    disabled
vce    disabled
power level 4    sclk: 49656 vddc: 3800

Check how much VRAM you have with amdgpu

glxinfo |grep -i memory

In this example it says we have 1G of video memory Dedicated with a total amount of 4G being possible.


    Video memory: 1024MB
    Unified memory: no
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 709 MB, largest block: 709 MB
    VBO free aux. memory - total: 3051 MB, largest block: 3051 MB
    Texture free memory - total: 709 MB, largest block: 709 MB
    Texture free aux. memory - total: 3051 MB, largest block: 3051 MB
    Renderbuffer free memory - total: 709 MB, largest block: 709 MB
    Renderbuffer free aux. memory - total: 3051 MB, largest block: 3051 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 1024 MB
    Total available memory: 4096 MB
 


Tags:

enable, amdgpu, linux, grub_cmdline_linux_default, quot, splash, cik_support, si_support, radeon, dpm,

Latest Articles

  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist