I was experiencing kernel freeze first, and xorg freeze later, on a new PC, AMD Ryzen 9 5900HX cpu, Matisse GPU, "green_sardine" firmware,
This is how it was fixed.
Description: As of June 2022, on latest AMD CPUs (AMD Ryzen 7, 8, 9) AMD graphic drivers will not work yet, manual patching needs to be applied.
On a test machine, using AMD Ryzen 9 5900HX with Radeon Graphics, I was able to have a perfectly healthy desktop using the following procedure, I believe the same would work with 5700x and 5800x families.
Packages will hopefully be available by August/September, until then, one needs to use ports.
The following is on a machine without source or ports.
1. Make sure to track 'latest' repository
2. Install git
3. Make sure FreeBSD source is available
4. Make sure ports are available
5. Build and install latest amd firmware
Make sure to drop into sh (not csh), then
6. Build and install latest drm-kmod
The latest firmware has a bug on our gpu class: Cannot allocate memory on green_sardine
It was fixed 2 weeks ago, see how to apply manually.
PR aboutDisable HDCP on green_sardine and renoir
Check that patch is already there, If not, apply manually to file
(2022-06-10: PR #172 was merged. No more need to patch drm-kmod)
7. Build and install xf86-video-amdgpu
Make sure it is updated at least to 22.0.0. If not, apply patch from here: https://reviews.freebsd.org/D35269
Then,
(Edit 2022-06-19: No need to patch. Drivers are now at least v.22.0.0)
8. Install xorg and window manager of choice
No need for any additional conf file. It should all work auto-magically. I personally like KDE but I prefer to start it manually. So I did this:
Then I can start with:
9. Fix stuttering
I found it on this mailing list message, as linked from this reddit comment.
10. Enjoy an excellent (IMHO) desktop experience
Many thanks to grahamperrin for pointing to the right way in many other threads, and also to SirDice for his generous assistance to so many beginners over the years. Thank you.
----
Edit 2022-08-30: Now only two ports need to be compiled.
Assuming one has install FreeBSD 13.1 with source and ports, do this from sh (not csh), root:
Make sure to add your desktop user to video group.
Code:
pciconf -lv | grep -i vga
vgapci0@pci0:4:0:0: class=0x030000 rev=0xc4 hdr=0x00 vendor=0x1002 device=0x1638 subvendor=0x1002 subdevice=0x0123
subclass = VGA
This is how it was fixed.
Description: As of June 2022, on latest AMD CPUs (AMD Ryzen 7, 8, 9) AMD graphic drivers will not work yet, manual patching needs to be applied.
On a test machine, using AMD Ryzen 9 5900HX with Radeon Graphics, I was able to have a perfectly healthy desktop using the following procedure, I believe the same would work with 5700x and 5800x families.
Packages will hopefully be available by August/September, until then, one needs to use ports.
The following is on a machine without source or ports.
1. Make sure to track 'latest' repository
2. Install git
pkg install -y git
3. Make sure FreeBSD source is available
git clone -b releng/13.1 https://git.freebsd.org/src.git /usr/src
4. Make sure ports are available
cd /usr/ports
portsnap fetch extract
5. Build and install latest amd firmware
cd /usr/ports/graphics/gpu-firmware-amd-kmod/
Make sure to drop into sh (not csh), then
FLAVOR=green_sardine make install clean
6. Build and install latest drm-kmod
cd /usr/ports/graphics/drm-510-kmod/
PR about
psp_v12_0.c
make install clean
(2022-06-10: PR #172 was merged. No more need to patch drm-kmod)
7. Build and install xf86-video-amdgpu
cd /usr/ports/x11-drivers/xf86-video-amdgpu
make extract
Make sure it is updated at least to 22.0.0. If not, apply patch from here: https://reviews.freebsd.org/D35269
Then,
make install clean
(Edit 2022-06-19: No need to patch. Drivers are now at least v.22.0.0)
8. Install xorg and window manager of choice
No need for any additional conf file. It should all work auto-magically. I personally like KDE but I prefer to start it manually. So I did this:
echo "exec startplasma-x11" >> ~/.xinitrc
Then I can start with:
startx
9. Fix stuttering
sysctl kern.sched.steal_thresh=1
I found it on this mailing list message, as linked from this reddit comment.
10. Enjoy an excellent (IMHO) desktop experience
Many thanks to grahamperrin for pointing to the right way in many other threads, and also to SirDice for his generous assistance to so many beginners over the years. Thank you.
----
Edit 2022-08-30: Now only two ports need to be compiled.
Assuming one has install FreeBSD 13.1 with source and ports, do this from sh (not csh), root:
Code:
cd /usr/ports
portsnap fetch extract
cd /usr/ports/graphics/gpu-firmware-amd-kmod/
FLAVOR=green_sardine make install clean
cd /usr/ports/graphics/drm-510-kmod/
make install clean
sysrc kld_list+="amdgpu"
pkg install -y xf86-video-amdgpu
# KDE
pkg install -y xorg kde5
echo "exec startplasma-x11" >> ~/.xinitrc/
Make sure to add your desktop user to video group.
Last edited: