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.
Status
Current status (2013-07-23)
Konstantin approved the patch fixing the TTM buffer objects unmapping. I'll commit it to 10-CURRENT soon.
As said in the previous status update, there's a regression after merging last HEAD: when an X11 application or the X.Org server exits, it triggers a “vm_page_dirty: page is invalid!” panic almost each time. After some bisect, it turns out that it's related to r252646. Neel Natu is helping me resolving the problem.
Also a good news to end this week-end: OpenArena is working! After glxgears(1), this is the first serious OpenGL application to work :) The patch, not committed yet, needs more testing.
Here's OpenArena's output, using Eric Anholt's demo:
ioq3+oa 1.36_SVN1910+0.8.8 freebsd-amd64 Jul 21 2013 ... GL_VENDOR: X.Org GL_RENDERER: Gallium 0.4 on AMD JUNIPER GL_VERSION: 2.1 Mesa 9.2.0-devel ... Demo file: demos/anholt.dm_68 ... 840 frames 8.5 seconds 99.4 fps 3.0/10.1/39.0/4.5 ms ----- Client Shutdown (Client quit) -----
In sync with Linux...
| Component | Linux version |
|---|---|
| TTM | ff7c60c |
| Radeon | 3.8-rc3 |
Features
| Feature | RS690 | RV630 | Evergreen (HD5000) | Pitcairn (HD7000) |
| kldload | DONE | DONE | DONE | DONE |
| kldunload | DONE | DONE | DONE | Not tested |
| X.Org | DONE | DONE | DONE | WIP: drmn0: error: still active bo inside vm when shutting down X |
| XRandR | Not tested | Not tested | DONE | Not tested |
| XVideo | Not tested | DONE | DONE | FAIL: mplayer is unable to use it |
| OpenGL | WIP: glxgears works, WebGL demos fail | DONE | DONE | Not tested |
| 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
Code repository and patches
The code, branched from 10-CURRENT, is available on GitHub in the kms-radeon branch:
https://github.com/dumbbell/freebsd
J.R. Oldroyd prepared a patch for 9-STABLE. Note that this patch is not in sync with the Git branch above.
How to test
The driver in its current state isn't ready for end-user, not even close. Many issues are already known and I can't provide user support.
If you still want to test the driver, you should know that:
- the branch is based on 10-CURRENT so it's obviously not production ready
- 3D acceleration is unusable at this time, so OpenGL-based applications such as some modern desktop environments won't work
- multiple video cards which share the same output ports are not supported
Setup kernel coredumps
You must have a swap device at least as large as the installed physical memory.
- Set dumpdev in
/boot/loader.conf:
dumpdev="/dev/$swap_device" # Replace with your swap device here.
- Set dumpdev in
/etc/rc.conf:
ddb_enable="YES" dumpdev="AUTO"
- The following sysctl is required in
/etc/sysctl.confto have coredumps while using X.Org:
debug.debugger_on_panic=0
Update kernel
- Clone the
kms-radeonbranch:
git clone -b kms-radeon https://github.com/dumbbell/freebsd.git
- Build the kernel as usual:
make buildkernel make installkernel
A new module, radeonkms is installed along with multiple AMD firmwares.
Install new X.Org driver
- You must reinstall
graphics/libdrmwith theKMSoption checked:
cd /usr/ports/graphics/libdrm make config # Check KMS make all deinstall reinstall clean
- You need to checkout the FreeBSD X11 team development ports tree. See X11 team wiki page for instructions on how to checkout their repository.
- If you have xf86-video-ati already installed, remove it.
- You must install the
x11-drivers/xf86-vide-ati-kmsport from the X11 team repository:
cd /path-to-x11-dev-repo/x11-drivers/xf86-video-ati-kms make install clean
Start X.Org
Now you're ready to test! You can start your X11 session as usual.
Remember that 3D is not supported at this time, therefore some window managers and desktop environments will just hang. See the table in the status section above, summing up what was tested.
Contact
For more details, contact Jean-Sébastien Pédron.