This is an old revision of the document!


AMD GPUs kernel-modesetting support

This page is dedicated to the project bringing kernel support for the AMD GPUs. It will allow the use of newer xf86-video-ati drivers and AMD GPUs.

This project started in January 2013. Initial radeon code comes from Linux 3.8-rc3 and a previous porting effort by Alexander Kabaev. Initial TTM port is provided by Konstantin Belousov.

With the help of John Baldwin, a Video BIOS mapping bug should be fixed soon.

I continued the work on suspend/resume. The code in HEAD panics during suspend: pci_save_state() is given drmn's device_t instead of vgapci's one. This function is already called anyway in the generic bus code. The solution is to remove it, or call it with the proper device.

After that, my test computer can suspend/resume (with debug.acpi.suspend_bounce=1): backlight is always powered on, but 2/3 of the time, the GPU is not properly reset and it locks up. There're some commits in Linux 3.9 which change the way the GPU is reset, I'll test them.

I also started a new branch on GitHub: https://github.com/dumbbell/freebsd/tree/kms-MnM-support

This branch has support for:

  • “minor”, the basis to work with multiple cards (render vs. display cards)
  • setmaster/dropmaster, which allows to run multiple X servers concurrently.

Caution: this branch was made before the libc++/iconv major changes.

In the process of working on minor/master, many bits in the drm2 code were synchronized with Linux 3.8. We're now much closer but there's still a long way to go.

Component Linux version
TTM ff7c60c (between 3.8 and 3.9)
Radeon 3.8
Feature RS690 RV630 Evergreen (HD5000) Pitcairn (HD7000)
kldload DONE DONE DONE DONE
kldunload DONE DONE DONE DONE
X.Org DONE DONE DONE DONE
XRandR Not tested Not tested DONE DONE
XVideo Not tested DONE DONE FAIL: mplayer is unable to use it
OpenGL WIP: glxgears works, WebGL demos fail DONE DONE Only software render
VDPAU (3D) Not tested Not tested FAIL: vdpauinfo hangs in umtxn Not tested
VDPAU (UVD) Not tested Not tested Not tested Not tested
OpenCL Not tested Not tested Not tested Not tested
Power mgmt. Not tested Not tested Not tested Not tested
VGA connector Not tested Not tested Not tested Not tested
DVI connector Not tested DONE Not tested DONE
HDMI connector Not tested Not tested DONE Not tested
HDMI audio Not tested Not tested FAIL: No sound, applications write data too fast Not tested
DP connector Not tested Not tested Not tested Not tested
Suspend/resume Not tested Not tested Not tested Not tested

Notes:

  • VDPAU (UVD): Try with mplayer -vo vdpau -vc ffh264vdpau,ffvc1vdpau $file

The code is in HEAD as of r254885.

If you want to test the driver, you should know that:

  • The console is unusable, once radeonkms is loaded. So Ctrl+Atl-Fx doesn't work and ending the X session let the computer with an unusable computer (only remote access is working).
  • Multiple video cards which share the same output ports are not supported.
  1. Set dumpdev in /boot/loader.conf:
dumpdev="/dev/$swap_device" # Replace with your swap device here.
  1. Set dumpdev in /etc/rc.conf:
ddb_enable="YES"
dumpdev="AUTO"
  1. The following sysctl is required in /etc/sysctl.conf to have coredumps while using X.Org:
debug.debugger_on_panic=0

Update your kernel as usual and reboot before proceeding with next steps.

You must put add the following flags in your /etc/make.conf:

WITH_NEW_XORG="YES"
WITH_GALLIUM="YES"

If this is the first time you set WITH_NEW_XORG, be sure to update your ports.

About WITH_GALLIUM, the support is very very early and the Gallium drivers may not work for you. Please do not report about failure with them at this time.

  1. If you have x11-drivers/xf86-video-ati already installed, remove it.
  2. Checkout the in-development xf86-video-ati port in a directory of your choice, and install it like a normal port:
svn co https://trillian.chruetertee.ch/svn/ports/trunk/x11-drivers/xf86-video-ati

cd xf86-video-ati
sudo make install clean
  1. If you have graphics/libGL and graphics/dri already instaled, remove them; you may have to force their deletion.
  2. Checkout the in-development Mesa ports in a directory of your choice, and install as usual:
svn co https://trillian.chruetertee.ch/svn/ports/trunk/graphics

cd graphics/libGL
sudo make install clean

cd ../dri
sudo make install clean

As mentionned above, Gallium drivers installed by graphics/dri are a work-in-progress. Please do not report problems about them for now.

Now you're ready to test! You can start your X11 session as usual.

You don't need to load the radeonkms kernel module at boot time, nor manually: it'll be loaded automatically during X startup.

If you encounter problems with either the kernel driver or the in-development ports, please send a mail to freebsd-x11@FreeBSD.org and join:

  • the output of dmesg
  • the output of pciconf -lvbce
  • the output of devinfo -vr
  • the output of pkg info
  • your Xorg.log if the problem is at X.Org startup or during your X session
  • any port build/install errors if relevant
  • core.$n.txt (in /var/crash) if you have a kernel panic
  • any details you see fit

If everything is working for you, you may report on the same mailing (this helps us know which hardware/software configuration are believed to work) and join:

  • the output of dmesg
  • the output of pciconf -lvbce
  • the output of pkg info
  • your X.lorg
  • any details you see fit

Thank you very much in advance for any reports! Those are very valuable.

For more details, contact Jean-Sébastien Pédron.

  • amd_gpu.1379015972.txt.gz
  • Last modified: 2013/09/12 19:59
  • by JeanSébastienPédron