How To: Install AMD Radeon RX560 (Polaris 11/Baffin) GPU support on LMDE2 Betsy (Debian 8 Jessie)

Questions about hardware and drivers
Forum rules
Before you post please read how to get help
Post Reply
cm1
Level 1
Level 1
Posts: 34
Joined: Fri Mar 17, 2017 6:08 pm

How To: Install AMD Radeon RX560 (Polaris 11/Baffin) GPU support on LMDE2 Betsy (Debian 8 Jessie)

Post by cm1 » Mon Apr 02, 2018 4:16 pm

My AMD Radeon RX560 card appears to be working well so far on LMDE2 with all open-source drivers. Here's a high-level look into what I did:

1. Installed & fully updated LMDE2 while connected to integrated graphics;
2. Added jessie-backports repository;
3. Installed AMD firmware, Mesa (3D) & X.org-amdgpu (2D) driver from jessie-backports, and other dependencies;
4. Manually updated AMD firmware to latest;
5. Compiled & installed Kernel 4.17 from source with RX560 support;
6. Installed other Mesa 13 components from jessie-backports;
7. Compiled & installed xserver-xorg-video-amdgpu 1.3 from source;
8. Added hardware video acceleration support packages.

==
Details:

1. Installed LMDE2 & installed all updates while connected with integrated graphics; rough test of current frame rate:
vblank_mode=0 glxgears

2. Added "jessie-backports main contrib non-free" repository;

3. Installed the following as sudo/su/root for the kernel rebuild process & installed latest available video firmware, Mesa, & X.org drivers from jessie-backports:
apt install bison/oldstable
apt install flex/oldstable
apt install libssl-dev/oldstable
apt install libncurses5-dev/oldstable
apt install kernel-package/oldstable
apt install gcc-4.9-plugin-dev/oldstable
apt install git/oldstable
apt install libelf-dev/oldstable
apt install firmware-amd-graphics/jessie-backports
apt install mesa-vulkan-drivers/jessie-backports
apt install xserver-xorg-video-amdgpu/jessie-backports

4. Manually pulled the latest AMD firmware binaries from git & installed over the old 20161130 version:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
cp -v -u linux-firmware/amdgpu/* /lib/firmware/amdgpu
cp -v -u linux-firmware/radeon/* /lib/firmware/radeon

5. Pulled the latest stable kernel & signature, verify signature:
wget https://cdn.kernel.org/pub/linux/kernel ... .17.tar.xz
wget https://cdn.kernel.org/pub/linux/kernel ... 7.tar.sign
unxz linux-4.17.tar.xz
gpg --verify linux-4.17.tar.sign
gpg --keyserver hkp://keys.gnupg.net --recv-keys <RSA key ID>
gpg --verify linux-4.17.tar.sign
tar xvf linux-4.17.tar
cd linux-4.17

6. Copy current kernel's configuration as defaults:
cp -v /boot/config-$(uname -r) .config

7. Configured kernel options per: https://wiki.gentoo.org/wiki/AMDGPU & https://wiki.archlinux.org/index.php/AMDGPU:
make menuconfig

Options chosen:
Processor type and features > MTRR (Memory Type Range Register) support = Y
Processor type and features > AMD Secure Memory Encryption (SME) support = N
Device Drivers > Graphics support > Direct Rendering Manager = M
Device Drivers > Graphics support > Direct Rendering Manager > Enable legacy fbdev support for your modesetting driver = Y
Device Drivers > Graphics support > ATI Radeon = N
Device Drivers > Graphics support > AMD GPU = M
Device Drivers > Graphics support > AMD GPU > Enable amdgpu support for SI parts = N
Device Drivers > Graphics support > AMD GPU > Enable amdgpu support for CIK parts = N
Device Drivers > Graphics support > AMD GPU > ACP (Audio CoProcessor) Configuration > Enable AMD Audio CoProcessor IP support = Y
Device Drivers > Graphics support > AMD GPU > Display Engine Configuration > AMD DC = Y
Device Drivers > Graphics support > AMD GPU > Display Engine Configuration > DC support for Polaris ... = Y
Device Drivers > Graphics support > AMD GPU > Display Engine Configuration > AMD FBC ... = Y
Device Drivers > Graphics support > AMD GPU > Display Engine Configuration > DCN 1.0 Raven Family = N
Device Drivers > Graphics support > HSA kernel driver for AMD GPU devices = M
Device Drivers > Sound card support = M
Device Drivers > Sound card support > Advanced Linux Sound Architecture = M
Device Drivers > Sound card support > Advanced Linux Sound Architecture > PCI sound devices = Y
Device Drivers > Sound card support > Advanced Linux Sound Architecture > PCI sound devices > HD-Audio > HD Audio PCI = M
Device Drivers > Sound card support > Advanced Linux Sound Architecture > PCI sound devices > Support initilization patch loading for HD audio = Y
Device Drivers > Sound card support > Advanced Linux Sound Architecture > PCI sound devices > (audio codecs) = Y
Device Drivers > Sound card support > Advanced Linux Sound Architecture > PCI sound devices > Build HDMI/Displayport HD-audio codec support = M
Device Drivers > Sound card support > Advanced Linux Sound Architecture > Pre-allocated buffer size for HD-audio driver = 2048
Device Drivers > Generic Driver Options > Userspace firmware loading support = Y
Device Drivers > Generic Driver Options > Include in-kernel firmware blobs in kernel binary
String = amdgpu/polaris11_ce.bin amdgpu/polaris11_k_smc.bin amdgpu/polaris11_mc.bin amdgpu/polaris11_me.bin amdgpu/polaris11_mec2.bin amdgpu/polaris11_mec.bin amdgpu/polaris11_pfp.bin amdgpu/polaris11_rlc.bin amdgpu/polaris11_sdma1.bin amdgpu/polaris11_sdma.bin amdgpu/polaris11_smc.bin amdgpu/polaris11_smc_sk.bin amdgpu/polaris11_uvd.bin amdgpu/polaris11_vce.bin
Device Drivers > Generic Driver Options > (/lib/firmware) Firmware blobs root directory

8. Clean the source tree & reset kernel package
make clean

9. Disable debug info
scripts/config --disable DEBUG_INFO

10. Compile kernel (-j value = #cores), e.g. for quad-core processor:
make -j4 deb-pkg

11. Install:
cd ..
dpkg -i linux-headers-4.17.0_4.17.0-1_amd64.deb
dpkg -i linux-libc-dev_4.17.0-1_amd64.deb
dpkg -i linux-image-4.17.0_4.17.0-1_amd64.deb

12. Install Mesa 13 from jessie-backports & reboot:
apt install libwayland-egl1-mesa/jessie-backports
apt-get -t jessie-backports install libglapi-mesa
apt install libgl1-mesa-dri/jessie-backports

13. Move video cable from integrated graphics to the RX560 card & boot. Test kernel driver, Mesa, and amdgpu version:
lshw -c video | grep driver
(should show "driver=amdgpu")

glxinfo | grep Open
(should show Mesa 13.0.6)

cat /var/log/Xorg.0.log | grep -A 2 amdgpu_drv.so
(should show version 1.2)

14. Rough test of 3D framerate:
vblank_mode=0 glxgears

15. Upgrade xserver-xorg-video-amdgpu to 1.3. Download amdgpu 1.3 source & extract:
wget https://www.x.org/releases/individual/d ... .0.tar.bz2
tar jxf xf86-video-amdgpu-1.3.0.tar.bz2

16. Install dependencies; compile from source & create amdgpu 1.3 .deb package & install:
apt install libdrm-dev/jessie-backports
apt install libgbm-dev/jessie-backports
apt install x11proto-core-dev/oldstable
apt install x11proto-fonts-dev/oldstable
apt install x11proto-xf86dri-dev/oldstable
apt install xserver-xorg-dev/oldstable
apt install libgl1-mesa-dev/jessie-backports
cd xf86-video-amdgpu-1.3.0
./configure
make -j4
make install

17. Backup original (1.2) amdgpu_drv.so file & install version 1.3 that was just built & reboot:
mv /usr/lib/xorg/modules/drivers/amdgpu_drv.so /usr/lib/xorg/modules/drivers/amdgpu_drv.so.bak.12
cp /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so /usr/lib/xorg/modules/drivers

18. Install hardware (VA-API & VDPAU) video acceleration packages (see https://wiki.archlinux.org/index.php/Ha ... celeration):
apt install vainfo/jessie-backports
apt install mesa-va-drivers/jessie-backports
apt install mesa-vdpau-drivers/jessie-backports
apt-get install vdpauinfo

19. Added the following to both /etc/X11/xorg.conf & /usr/share/X11/xorg.conf.d/10-amdgpu.conf:

Code: Select all

Section "Device"
	Identifier "AMDgpu"
	Driver "amdgpu"
	Option "AccelMethod" "glamor"
	Option "DRI" "3"
EndSection

Section "OutputClass"
	Identifier "AMDgpu"
	MatchDriver "amdgpu"
	Driver "amdgpu"
EndSection
20. Add the following to the GRUB_CMDLINE_LINUX_DEFAULT= line in /etc/default/grub & reboot:

Code: Select all

amdgpu.modeset=1 amdgpu.dc=1
shutdown -r now

21. Verify amdgpu version:
cat /var/log/Xorg.0.log | grep -A 2 amdgpu_drv.so
(should show version 1.3.0)

22. Verify VA-API:
vainfo

23. Verify VDPAU:
vdpauinfo

24. Verify Direct Rendering is enabled:
glxinfo | grep rendering

25. Rough test of 3D framerate:
vblank_mode=0 glxgears

==

Afterwards:
Last edited by cm1 on Sun Apr 22, 2018 12:34 pm, edited 3 times in total.

Post Reply

Return to “Hardware Support”