amd vega and radeon series vga card driver for FreeBSD 12.1 and 12.2 tutorial for beginner[update 2020-12-16]

I just install the drm-kmod package and xf86-video-amdgpu. I add the appropriate entry to /etc/rc.conf. I do no other configuration and the system just works. This is a desktop PC though, not a laptop. I only have an RX570 so can't speak to any other models or laptops as I do not use a laptop with FreeBSD.
 
I do not intend to run a laptop either. I am asking because I might be interested in buying a Desktop AMD GPU with vega in the furture.
 
Be aware that the drm-v5.0-fbsd12.1 branch is not supported, and not guaranteed to work. There were a couple of regressions with the 5.0 branch, which is why both drm-current-kmod (for current) and drm-fbsd12.0-kmod (for FreeBSD 12.x) are stuck with Linux 4.16 code. If you need newer drivers, it is probably best to run FreeBSD current and use drm-devel-kmod.
 
I do not intend to run a laptop either. I am asking because I might be interested in buying a Desktop AMD GPU with vega in the furture.
I've purchased a B550 motherboard and am awaiting a Ryzen 7 Pro 4750G ordered from China. I'll let you know how vega works out when it arrives.
 
I've purchased a B550 motherboard and am awaiting a Ryzen 7 Pro 4750G ordered from China. I'll let you know how vega works out when it arrives.

I believe this should be supported when using a recent FreeBSD CURRENT ant the lastest drm-kmod and gpu-firmware-kmod updates.
 
I am an AMD 3000G user. I installed FreeBSD 13-CURRENT and drm-current-kmod, xf86-video-amdgpu to use X window.
I've received the cpu and assembled the box. I installed FreeBSD 12.1-RELEASE which went very well. I encountered an issue in that the memstick from which I installed wasn't recognized as bootable when plugged into any USB 3.0 port but was recognized from a USB 2.0 port from which I completed the installation. I've been reading about bectl and boot environments and intend to try out Xorg with xf86-video-amdgpu when I'm confident that I can roll back to a RELEASE version without error. As of today I'm quite pleased with this cpu even without taking advantage of the gpu cores.
 
This solution work in 12.2 ... but need correct errors (simple) compiling.
Can you give some more details? I need this driver for my video card on my desktop (I don't want to run -CURRENT and the 4.16 drivers do not work). I'm running into a compile error, but as I am not that experienced with debugging compilation errors, really don't know what to do next.
 
Can you give some more details? I need this driver for my video card on my desktop (I don't want to run -CURRENT and the 4.16 drivers do not work). I'm running into a compile error, but as I am not that experienced with debugging compilation errors, really don't know what to do next
You need to correct the source code for the errors that the compiler produces - comment out the calls and function declarations in .h .cpp files. Which ones are visible during compilation. Unfortunately, I didn't make a patch.
 
You need to correct the source code for the errors that the compiler produces - comment out the calls and function declarations in .h .cpp files. Which ones are visible during compilation. Unfortunately, I didn't make a patch.
Yeah, that's getting pretty far outside of my current skill level. I've never managed to make it much past "Hello World" in any C programming tutorials. But I have made great strides in learning POSIX shell scripting, so there's hope for me yet!
 
Yeah, that's getting pretty far outside of my current skill level. I've never managed to make it much past "Hello World" in any C programming tutorials. But I have made great strides in learning POSIX shell scripting, so there's hope for me yet!
Ок.
1. Download FreeBSD source. (if not have this...)
svn checkout http://svn.freebsd.org/base/releng/12.2/ /usr/src
2. Go first page this theme and make instructions... (if not make...) without download and make drv... kms-drm-drm-v5.0-fbsd12.1.zip
m.b. need install pkg install linux-c7-7.8.2003 and m.b. need download firmware https://github.com/FreeBSDDesktop/kms-firmware/archive/master.zip)
3. get from attache kms-drm-drm-v5.0-fbsd12.1_modify.tar.xz (my modify).
4. unpack and make and make install this.
5. kldload amdgpu
if you run command kldstat must see few amdgpu_*.ko (firmware :))
6. reboot ... and load X and DE :)
 
Hello, it's normal that I don't support brightness management ?

I use FreeBSD 13.0-BETA3
CPU: Info: 8-Core model: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx bits: 64 type: MCP L2 cache: N/A
Speed: 2096 MHz min/max: 1400/2100 MHz Core speeds (MHz): No speed data found for 8 cores.
Graphics: Message: No Device data found.
Display: server: X.Org 1.20.9 driver: amdgpu,ati unloaded: modesetting,vesa resolution: 1920x1080~60Hz
OpenGL: renderer: AMD Radeon Vega 8 Graphics (RAVEN DRM 3.35.0 13.0-BETA3 LLVM 10.0.1) v: 4.6 Mesa 20.2.3

Without xf86-video-ati xorg switched to modesetting.

Have a nice day
 
Hello, it's normal that I don't support brightness management ?

I use FreeBSD 13.0-BETA3



Without xf86-video-ati xorg switched to modesetting.

Have a nice day
it's normal in freebsd 12.2, maybe the driver did not support it. it cant change brightness with shortcut key even if I load acpi_video driver. I use other method change brightness in freebsd 12.2
 
it's normal in freebsd 12.2, maybe the driver did not support it. it cant change brightness with shortcut key even if I load acpi_video driver. I use other method change brightness in freebsd 12.2
I am on FreeBSD 13.0 but I would like to have the method.
 
Hi, thanks to Raffeale I managed to get my Enlightenment session to work with OpenGL + Tearfree rendering.

BUT! There was a couple things wrong with the Device entry in the suggested Xorg conf file. The DRI option expects an integer, the boolean "True" will be rejected. The integer should be either 2 or 3, referring to DRI2 or DRI3, the later being the default. I found that 3 did not work, but 2 does. Also, the MigrationHeuristic option is not supported, perhaps it's depracated, or amdgpu does not use it.

With no Xorg hint file, Enlightenment would work with no GPU accelerattion (Software instead of OpenGL). But it would leave me with a black screen and just the cursor once rendering engine was set to OpenGL and Tearfree was turned on in Settings->Look->Compositor->Rendering.

I have a Radeon RX 550 (4GT LP OC with 4GB GDDR5), by MSI.
I'm running FreeBSD 12.2-RELEASE.

EDIT: the 12.2-RELEASE drm-kmod packages do work when X is started on boot. This may be just on some monitors (like mine) whereby the correct monitor timings is being set by amdgpu. The kmod-v5.0 works better in this regard. See my post #50 below.

The drm-kmod in 12.2 was not good enough and the screen would go blank on boot, not even console was working. So I downloaded the drm-v5.0-fbsd12.1 tree from Github, used unzip to extract it, cd into the source directory and ran make. When it failed with errors, I removed the functions from source file mentioned in compiler error message (all were .h files I think) and ran make again. After successful build, remove existing drm-kmod packages with pkg remove drm-fbsd12.0-kmod, then run make install clean.

Then add a Xorg hint file:

Code:
$EDITOR /usr/local/etc/X11/xorg.conf.d/10-amdgpu.conf

Code:
Section "Device"
    Identifier "Radeon RX 550"
    VendorName "AMD/ATI"
    Driver "amdgpu"
    BusID "PCI:1:0:0"

    Option "TearFree" "On"
    Option "DRI" "2"
    Option "AccelMethod" "exa"
EndSection

And of course add kld_list="/boot/modules/amdgpu.ko" to /etc/rc.conf.

Enlightenment works well, I can play Youtube at 1080p also works well, I can play a 4K mpeg4 video in SMPlayer which works really well (no noticeable tearing). Why are we moving to Wayland again.... (scratches head). And of course 4K video playback was why I bought this card in the first place. So now I can replace my Ubuntu 18.04 installation on my Mediacentre PC (KODI) with FreeBSD on my home file server / router. So two always running systems in my living room down to one. Sweet!

Huge thanks to all the FreeBSD devs that have worked so hard on the graphics stack (drm/kmod etc.) over the last few years. Living the dream!
 
Hi, thanks to Raffeale I managed to get my Enlightenment session to work with OpenGL + Tearfree rendering.

BUT! There was a couple things wrong with the Device entry in the suggested Xorg conf file. The DRI option expects an integer, the boolean "True" will be rejected. The integer should be either 2 or 3, referring to DRI2 or DRI3, the later being the default. I found that 3 did not work, but 2 does. Also, the MigrationHeuristic option is not supported, perhaps it's depracated, or amdgpu does not use it.

With no Xorg hint file, Enlightenment would work with no GPU accelerattion (Software instead of OpenGL). But it would leave me with a black screen and just the cursor once rendering engine was set to OpenGL and Tearfree was turned on in Settings->Look->Compositor->Rendering.

I have a Radeon RX 550 (4GT LP OC with 4GB GDDR5), by MSI.
I'm running FreeBSD 12.2-RELEASE.

The drm-kmod in 12.2 was not good enough and the screen would go blank on boot, not even console was working. So I downloaded the drm-v5.0-fbsd12.1 tree from Github, used unzip to extract it, cd into the source directory and ran make. When it failed with errors, I removed the functions from source file mentioned in compiler error message (all were .h files I think) and ran make again. After successful build, remove existing drm-kmod packages with pkg remove drm-fbsd12.0-kmod, then run make install clean.

Then add a Xorg hint file:

Code:
$EDITOR /usr/local/etc/X11/xorg.conf.d/10-amdgpu.conf

Code:
Section "Device"
    Identifier "Radeon RX 550"
    VendorName "AMD/ATI"
    Driver "amdgpu"
    BusID "PCI:1:0:0"

    Option "TearFree" "On"
    Option "DRI" "2"
    Option "AccelMethod" "exa"
EndSection

And of course add kld_list="/boot/modules/amdgpu.ko" to /etc/rc.conf.

Enlightenment works well, I can play Youtube at 1080p also works well, I can play a 4K mpeg4 video in SMPlayer which works really well (no noticeable tearing). Why are we moving to Wayland again.... (scratches head). And of course 4K video playback was why I bought this card in the first place. So now I can replace my Ubuntu 18.04 installation on my Mediacentre PC (KODI) with FreeBSD on my home file server / router. So two always running systems in my living room down to one. Sweet!

Huge thanks to all the FreeBSD devs that have worked so hard on the graphics stack (drm/kmod etc.) over the last few years. Living the dream!
My card is by Asus, but it's also a Radeon RX 550 4GB. I got everything working just fine (no messing around with xorg.conf. Just followed instructions on this page, nothing else, boom, works! I would advise against mixing new github code into the system without a good way to go back if you mess up. There's a reason we have a ports system.



Wayland actually works for me, too - just waiting on the SDDM project to finish publishing the software on their end of things.
 
My card is by Asus, but it's also a Radeon RX 550 4GB. I got everything working just fine (no messing around with xorg.conf. Just followed instructions on this page, nothing else, boom, works! I would advise against mixing new github code into the system without a good way to go back if you mess up. There's a reason we have a ports system.

What version of FreeBSD did you use. I tried those instructions and I got a black screen on boot. Nothing to do with Xorg, it was before I installed xorg. I'm on 12.2-RELEASE and booting via BIOS (CSM). The output of dmesg (only accessible via ssh) showed errors from drm about not being able to find some amdgpu resources. The corresponding modules were loaded as per kldstat. Only thing that got it working was swapping kmod 4.16 for kmod 5.0. That's the only thing that changed. I'd like to know what you did differently.
 
What version of FreeBSD did you use. I tried those instructions and I got a black screen on boot. Nothing to do with Xorg, it was before I installed xorg. I'm on 12.2-RELEASE and booting via BIOS (CSM). The output of dmesg (only accessible via ssh) showed errors from drm about not being able to find some amdgpu resources. The corresponding modules were loaded as per kldstat. Only thing that got it working was swapping kmod 4.16 for kmod 5.0. That's the only thing that changed. I'd like to know what you did differently.
I think I started using those instructions on FreeBSD 11... I would first install everything I want (Xorg, drm-kmod, and KDE), and only afterwards I would go around setting stuff up and modifying the config files as per instructions in the FreeBSD handbook. That worked wonders, even with pre-compiled packages. And I did not go to github for fresh tarballs that were not properly patched for the ports system.

FWIW, I'm on 13-RELEASE right now, and using ports downloaded with portsnap. It's working even better, because .ko files are now loaded much more cleanly than earlier.
 
I think I started using those instructions on FreeBSD 11... I would first install everything I want (Xorg, drm-kmod, and KDE), and only afterwards I would go around setting stuff up and modifying the config files as per instructions in the FreeBSD handbook. That worked wonders, even with pre-compiled packages. And I did not go to github for fresh tarballs that were not properly patched for the ports system.

FWIW, I'm on 13-RELEASE right now, and using ports downloaded with portsnap. It's working even better, because .ko files are now loaded much more cleanly than earlier.

I have no doubt that 13-RELEASE is working well from packages or ports, the stack is much more up to date. I've seen a few posts from various users on other threads here that our generation of Radeon cards are working on 12.2-RELEASE without using the git tree version of kmod. I used packages from quarterly, latest and built from ports, none of them worked. I kept getting a black screen, in fact the monitor would say no signal or something similar, but I could ssh in.

Did you try on 12.2-RELEASE specifically? That git tree was created for 12.1-RELEASE because a bug was introduced in 12.1 that effects the kmod-4.16. Also, are you using BIOS (legacy boot) or UEFI?

I will try again with the pkg version, now that I have SDDM enabled. Maybe I will diff the output of dmesg and post here.
 
I have no doubt that 13-RELEASE is working well from packages or ports, the stack is much more up to date. I've seen a few posts from various users on other threads here that our generation of Radeon cards are working on 12.2-RELEASE without using the git tree version of kmod. I used packages from quarterly, latest and built from ports, none of them worked. I kept getting a black screen, in fact the monitor would say no signal or something similar, but I could ssh in.

Did you try on 12.2-RELEASE specifically? That git tree was created for 12.1-RELEASE because a bug was introduced in 12.1 that effects the kmod-4.16. Also, are you using BIOS (legacy boot) or UEFI?

I will try again with the pkg version, now that I have SDDM enabled. Maybe I will diff the output of dmesg and post here.
I don't think I tried 12.2-RELEASE specifically... or 12.1, for that matter. I tend to go for .0-RELEASE... and I use UEFI. My rig is completely aftermarket parts, so maybe my SSD's did not get 'contaminated' by a manufacturer who sells pre-assembled PCs.

Black screens can result from not seating the GPU into the motherboard properly, as well as not having the power supply tightly seated into the plugs. There's a few physical places to check.
 
I don't think I tried 12.2-RELEASE specifically... or 12.1, for that matter. I tend to go for .0-RELEASE... and I use UEFI. My rig is completely aftermarket parts, so maybe my SSD's did not get 'contaminated' by a manufacturer who sells pre-assembled PCs.

Black screens can result from not seating the GPU into the motherboard properly, as well as not having the power supply tightly seated into the plugs. There's a few physical places to check.

Definetely not physical issue.

Strangely, and promisingly, it now works with the packages from the 12.2-RELEASE repo. But I didn't do anything silly before, I was careful and tried and checked over my steps many times. I'm guessing it's either some files were left behind from the git tree (kmod-5) make install (there is no make uninstall/deinstall), or the Xorg/SDDM does something to make it work. I can even switch to the other TTYs, so the console is working fine.

I am actually just doing some testing, this is not my production install yet. And I did a zfs snapshot -r zroot@fresh-install just after I updated the base to p8. So I can revert to that snapshot and try again, see where it goes right. Will report back with my findings, this is interesting...
 
Definetely not physical issue.

Strangely, and promisingly, it now works with the packages from the 12.2-RELEASE repo. But I didn't do anything silly before, I was careful and tried and checked over my steps many times. I'm guessing it's either some files were left behind from the git tree (kmod-5) make install (there is no make uninstall/deinstall), or the Xorg/SDDM does something to make it work. I can even switch to the other TTYs, so the console is working fine.

I am actually just doing some testing, this is not my production install yet. And I did a zfs snapshot -r zroot@fresh-install just after I updated the base to p8. So I can revert to that snapshot and try again, see where it goes right. Will report back with my findings, this is interesting...
Good for you. :) In my case, I was doing things as a fresh install, so that I don't have a mess from a previous install to deal with.
 
OK, all is clear now. The drm-kmod in ports/pkg in 12.2-RELEASE is working now. But only after I actually enable SDDM and therefore X starts by itself.

Without X being started, I get no output on my monitor. The problem becomes clear after reading the message from my Dell monitor (below).

The current Input timing is not supported by the monitor display. Please change your input timing to 2560x1440, 60Hz or any other monitor listed timing as per the monitor specifications.

So the kmod-v4.16 has problems setting the correct timings for my monitor in console mode (vt). But the git tree kmod-v5.0-fbsd12.1 fixes it. Because I was trying to get amdgpu working before I setup X and a WM/DE I did not notice that it actually works. So if I was using startx from a TTY, I would have a problem, because only after X starts can I see anything on my screen. For my use case, I will always have SDDM start up at boot, so it is OK. And actually I will be using my TV in production, so it may not have that timing issue anyway. I assume 13-RELEASE and beyond will just work fine in any case.

Thanks astyle for leading me to investigate further.
 
Back
Top