Accelerated Xorg on AMDGPU Renoir

I have AMD Ryzen 7 PRO 4750G with Radeon Graphics (Renoir) and I am trying to get accelerated X11 GUI.

Manually recompiled:
graphics/drm-fbsd13-kmod
graphics/mesa-dri
graphics/gpu-firmware-kmod

/usr/local/etc/X11/xorg.conf.d/ is empty

/boot/loader.conf
Code:
hw.amdgpu.exp_hw_support=1

/etc/rc.conf
Code:
kld_list="${kld_list} /boot/modules/amdgpu.ko amdtemp"

After running startx as user X doesn't start:
Code:
Fatal server error:
[    25.767] (EE) no screens found(EE)

If I add small config file /usr/local/etc/X11/xorg.conf.d/amdgpu.conf
Code:
Section "Device"
        Identifier      "Card0"
        Driver          "amdgpu"
EndSection

Then X seems to tries to start but stucks at black screen (which show mouse pointer at center of the scren and one white block/cursor at top left corner)
Code:
% ps aux | grep Xorg
root       1678    0.0  0.2 208372  55396 v1  D    21:41     0:00.07 /usr/local/bin/Xorg :0 -auth /home/johnny/.serverauth.1664
Trying to kill it (as root, logged over ssh) is not sucessful (as expected for process in D state).
Only option is to reboot (or use machine over ssh) - Ctrl-Alt-Fx keys won't change tty.


System information
Code:
% uname -sr
FreeBSD 13.0-BETA2

% kldstat | grep amdgpu
 5    1 0xffffffff83200000   32ed48 amdgpu.ko
10    1 0xffffffff83199000     21e8 amdgpu_renoir_gpu_info_bin.ko
11    1 0xffffffff8319c000     64a8 amdgpu_renoir_sdma_bin.ko
12    1 0xffffffff831a3000    292a8 amdgpu_renoir_asd_bin.ko
13    1 0xffffffff831cd000     7528 amdgpu_renoir_pfp_bin.ko
14    1 0xffffffff831d5000     6528 amdgpu_renoir_me_bin.ko
15    1 0xffffffff831dc000     4528 amdgpu_renoir_ce_bin.ko
16    1 0xffffffff831e1000     b8a0 amdgpu_renoir_rlc_bin.ko
17    1 0xffffffff8352f000    437b8 amdgpu_renoir_mec_bin.ko
18    1 0xffffffff83573000    437b8 amdgpu_renoir_mec2_bin.ko
19    1 0xffffffff835b7000    71d28 amdgpu_renoir_vcn_bin.ko

% pkg info drm-fbsd13-kmod-5.4.92.g20210202 mesa-dri-20.2.3_1 gpu-firmware-kmod-g20201213 xorg-server-1.20.9_3,1 xf86-\*
drm-fbsd13-kmod-5.4.92.g20210202
mesa-dri-20.2.3_1
gpu-firmware-kmod-g20201213
xorg-server-1.20.9_3,1
xf86-input-libinput-0.30.0_1
xf86-video-amdgpu-19.1.0_1

% dmesg | grep -i drm
[drm] amdgpu kernel modesetting enabled.
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] initializing kernel modesetting (RENOIR 0x1002:0x1636 0x1002:0x1636 0xD8).
[drm] register mmio base: 0xFCD00000
[drm] register mmio size: 524288
[drm] add ip block number 0 <soc15_common>
[drm] add ip block number 1 <gmc_v9_0>
[drm] add ip block number 2 <vega10_ih>
[drm] add ip block number 3 <psp>
[drm] add ip block number 4 <smu>
[drm] add ip block number 5 <gfx_v9_0>
[drm] add ip block number 6 <sdma_v4_0>
[drm] add ip block number 7 <vcn_v2_0>
drmn0: successfully loaded firmware image 'amdgpu/renoir_gpu_info.bin'
drmn0: kfd not supported on this ASIC
drmn0: successfully loaded firmware image 'amdgpu/renoir_sdma.bin'
[drm] VCN decode is enabled in VM mode
[drm] VCN encode is enabled in VM mode
[drm] VCN jpeg decode is enabled in VM mode
[drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit
drmn0: VRAM: 512M 0x000000F400000000 - 0x000000F41FFFFFFF (512M used)
drmn0: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF
drmn0: AGP: 267419648M 0x000000F800000000 - 0x0000FFFFFFFFFFFF
[drm] Detected VRAM RAM=512M, BAR=256M
[drm] RAM width 128bits UNKNOWN
[drm] amdgpu: 512M of VRAM memory ready
[drm] amdgpu: 3072M of GTT memory ready.
[drm] GART: num cpu pages 262144, num gpu pages 262144
[drm] PCIE GART of 1024M enabled (table at 0x000000F400900000).
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
drmn0: successfully loaded firmware image 'amdgpu/renoir_asd.bin'
drmn0: successfully loaded firmware image 'amdgpu/renoir_pfp.bin'
drmn0: successfully loaded firmware image 'amdgpu/renoir_me.bin'
drmn0: successfully loaded firmware image 'amdgpu/renoir_ce.bin'
drmn0: successfully loaded firmware image 'amdgpu/renoir_rlc.bin'
drmn0: successfully loaded firmware image 'amdgpu/renoir_mec.bin'
drmn0: successfully loaded firmware image 'amdgpu/renoir_mec2.bin'
[drm] use_doorbell being set to: [true]
drmn0: successfully loaded firmware image 'amdgpu/renoir_vcn.bin'
[drm] Found VCN firmware Version ENC: 1.7 DEC: 4 VEP: 0 Revision: 17
[drm] PSP loading VCN firmware
[drm] reserve 0x400000 from 0xf41f800000 for PSP TMR
[drm] VCN decode and encode initialized successfully(under DPG Mode).
drmn0: ring gfx uses VM inv eng 0 on hub 0
drmn0: ring comp_1.0.0 uses VM inv eng 1 on hub 0
drmn0: ring comp_1.1.0 uses VM inv eng 4 on hub 0
drmn0: ring comp_1.2.0 uses VM inv eng 5 on hub 0
drmn0: ring comp_1.3.0 uses VM inv eng 6 on hub 0
drmn0: ring comp_1.0.1 uses VM inv eng 7 on hub 0
drmn0: ring comp_1.1.1 uses VM inv eng 8 on hub 0
drmn0: ring comp_1.2.1 uses VM inv eng 9 on hub 0
drmn0: ring comp_1.3.1 uses VM inv eng 10 on hub 0
drmn0: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
drmn0: ring sdma0 uses VM inv eng 0 on hub 1
drmn0: ring vcn_dec uses VM inv eng 1 on hub 1
drmn0: ring vcn_enc0 uses VM inv eng 4 on hub 1
drmn0: ring vcn_enc1 uses VM inv eng 5 on hub 1
drmn0: ring vcn_jpeg uses VM inv eng 6 on hub 1
[drm] Initialized amdgpu 3.35.0 20150101 for drmn0 on minor 0

% pciconf -lv
...
vgapci0@pci0:9:0:0:     class=0x030000 rev=0xd8 hdr=0x00 vendor=0x1002 device=0x1636 subvendor=0x1002 subdevice=0x1636
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Renoir'
    class      = display
    subclass   = VGA

Same results if 'efi_max_resolution="720p"' is added to /boot/loader.conf (as suggested in this github comment)
dmesg with 720p:
Code:
VT(efifb): resolution 800x600
dmesg without efi_max_resolution set:
Code:
VT(efifb): resolution 1920x1080

Last week also tried with "5.5-wip" branch for freebsd/drm-kmod on 13.0 and -CURRENT without success but didn't write details.

I can start (non-accelerated) X with:
Code:
% pkg install xf86-video-scfb
% rm /usr/local/etc/X11/xorg.conf.d/amdgpu.conf
% startx

Attached are Xorg.0.log files - one when /usr/local/etc/X11/xorg.conf.d/amdgpu.conf is empty, other one when amdgpu.conf mentioned above is added.
 

Attachments

  • Xorg.no-conf.txt
    5 KB · Views: 227
  • Xorg.with-conf.txt
    4.9 KB · Views: 230
Last edited by a moderator:
try this
it looks like your device id is not in ids files. or the xorg amdgpu driver did not support your vga card. try about tutorial,maybe you can find the answer.
 
try this
it looks like your device id is not in ids files. or the xorg amdgpu driver did not support your vga card. try about tutorial,maybe you can find the answer.

Code:
pciconf -lv | grep -A4 vgapci
vgapci0@pci0:9:0:0:     class=0x030000 rev=0xd8 hdr=0x00 vendor=0x1002 device=0x1636 subvendor=0x1002 subdevice=0x1636
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Renoir'
    class      = display
    subclass   = VGA
device_id is 0x1636, PCI slot is 9:0:0

Code:
grep 1636 /usr/local/share/pciids/pci.ids
        1636  Renoir
                103c 1636  U98Z077.00 Half-size Mini PCIe Card
        1636  Broadwell-U Integrated Graphics
My device_id is in pci.ids files.

The drm-kmod source is https://github.com/unrelentingtech/drm-kmod/commi85d028223bcts/5.5-wip-amd-pr.
With FreeBSD current source before commit 50180d2b.

For current (__FreeBSD__version >= 1300135) to work, some patches are needed.

So, I should checkout commit 85d028223bc, build -CURRENT and then clone https://github.com/unrelentingtech/drm-kmod branch 5.5-wip-amd-pr to ports, build it and load that kernel modules and it should work?
Can I somehow do that on 13.0 branch?
 
you can try freebsd13, maybe 13 has already included it, I use 12.2 now.
but it is not likes amd drivers problem, because the driver has already initialized.
 
Stable/13 works without any problem. (Not work.)

Ports:
Code:
emulators/linux_base-c7
graphics/drm-kmod
graphics/gpu-firmware-kmod
x11-drivers/xf86-video-amdgpu
Code:
graphics/drm-kmod
graphics/gpu-firmware-kmod
x11-drivers/xf86-video-amdgpu

/boot/loader.conf
Code:
kern.vty=vt
#hw.amdgpu.exp_hw_support="1" # no more needed
linux64_load="YES"
Code:
kern.vty=vt
#hw.amdgpu.exp_hw_support="1" # no more needed

/etc/rc.conf
Code:
kld_list="amdgpu"

xorg.conf.d/amdgpu.conf
Code:
Section "Device"
        Identifier "Card0"
        Driver     "amdgpu"
        BusID      "PCI:12:0:0" # pciconf -lv | grep vgapci, vgapci0@pci0:12:0:0
        Option     "DRI" "3"
        Option     "TearFree" "on"             
EndSection
 

Attachments

  • Xorg.0.log.txt
    27.4 KB · Views: 182
What GPUs are you using? Is is also Renoir (AMD 4xxxG APUs)? I tried your steps (on 13.0-BETA4 and 13.0-STABLE) without sucess. Should code from Linux 5.5 (or preferably 5.8) be used for Renoir?

Could you provide output of pciconf -lv | grep -A4 vgapci
Mine is:
Code:
vgapci0@pci0:9:0:0:     class=0x030000 rev=0xd8 hdr=0x00 vendor=0x1002 device=0x1636 subvendor=0x1002 subdevice=0x1636
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Renoir'
    class      = display
    subclass   = VGA
 
pciconf -lv | grep -A4 vgapci
Code:
vgapci0@pci0:12:0:0:    class=0x030000 rev=0xd8 hdr=0x00 vendor=0x1002 device=0x1636 subvendor=0x1002 subdevice=0x1636
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Renoir'
    class      = display
    subclass   = VGA

uname -v
Code:
FreeBSD 13.0-STABLE #0 master-n244751-2b43cd2ea26: Fri Mar  5 04:39:39 CST 2021     root@r7s:/usr/obj/usr/src/amd64.amd64/sys/GENERIC


Update:
I'll check the drm-kmod again. The loaded one is of a local ported version.
 

Attachments

  • dmesg.today.txt
    17.8 KB · Views: 198
Thanks.
I updated to -STABLE:

Code:
make SRCCONF=/dev/null __MAKE_CONF=/dev/null buildworld buildkernel
install & reboot

pkg update -f
pkg update
Your packages are up to date.

pkg delete graphics/drm-kmod graphics/gpu-firmware-kmod x11-drivers/xf86-video-amdgpu
pkg install graphics/drm-kmod graphics/gpu-firmware-kmod x11-drivers/xf86-video-amdgpu

# sysctl kern.vty
kern.vty: vt

# cat /usr/local/etc/X11/xorg.conf.d/amdgpu.conf
Section "Device"
        Identifier "Card0"
        Driver     "amdgpu"
        BusID      "PCI:9:0:0"
        Option     "DRI" "3"
        Option     "TearFree" "on"
EndSection

# grep amdgpu /etc/rc.conf
kld_list="amdgpu"

reboot

# uname -srv
FreeBSD 13.0-STABLE FreeBSD 13.0-STABLE #3 stable13-n244806-fbc8ddde4c66: Mon Mar  8 14:52:12 CET 2021     root@zen-pobro:/usr/obj/usr/src/amd64.amd64/sys/GENERIC

# kldstat | grep amdgpu
 5    1 0xffffffff83800000   31fd70 amdgpu.ko
10    1 0xffffffff83798000     2218 amdgpu_renoir_gpu_info_bin.ko
11    1 0xffffffff8379b000     64d8 amdgpu_renoir_sdma_bin.ko
12    1 0xffffffff837a2000    292d8 amdgpu_renoir_asd_bin.ko
13    1 0xffffffff837cc000     7558 amdgpu_renoir_pfp_bin.ko
14    1 0xffffffff837d4000     6558 amdgpu_renoir_me_bin.ko
15    1 0xffffffff837db000     4558 amdgpu_renoir_ce_bin.ko
16    1 0xffffffff837e0000     b8d0 amdgpu_renoir_rlc_bin.ko
17    1 0xffffffff83b20000    437e8 amdgpu_renoir_mec_bin.ko
18    1 0xffffffff83b64000    437e8 amdgpu_renoir_mec2_bin.ko
19    1 0xffffffff83ba8000    71d58 amdgpu_renoir_vcn_bin.ko

As user:
Code:
% id
uid=1001(johnny) gid=1001(johnny) groups=1001(johnny),0(wheel),44(video)
% startx
<screen frozen until reboot>

Not sure if relevant, but I have noticed some differences in dmesg, such as:
Code:
ATOM BIOS: 113-RENOIR-026
ATOM BIOS: 113-RENOIR-031
 

Attachments

  • Xorg.0.log.txt
    5 KB · Views: 177
  • dmesg.boot.txt
    14.3 KB · Views: 180
  • dmesg.diff.txt
    5.7 KB · Views: 169
Code:
FreeBSD 13.0-STABLE #0 master-n244751-2b43cd2ea26: Fri Mar  5 04:39:39 CST 2021     root@r7s:/usr/obj/usr/src/amd64.amd64/sys/GENERIC

Update:
I'll check the drm-kmod again. The loaded one is of a local ported version.

I built the same -STABLE as yours:
Code:
FreeBSD 13.0-STABLE FreeBSD 13.0-STABLE #12 stable13-n244751-2b43cd2ea26f: Tue Mar  9 21:51:30 CET 2021     root@zen-pobro:/usr/obj/usr/src/amd64.amd64/sys/POBRO
Rebuilt relevant packages and still endup with locked screen when try to start Xorg.
In BIOS/UEFI VRAM is set to 2GB, various VM stuff are disabled and result is the same, last line printed in Xorg.log is as in the file uploaded earlier:
Code:
[   588.534] (II) Module "dri2" already built-in
Trying to build various branches from GregV and official drm-kmod results in compile errors.

I have noticed that you are using newer driver:
Code:
-[drm] Initialized amdgpu 3.36.0 20150101 for drmn0 on minor 0
+[drm] Initialized amdgpu 3.35.0 20150101 for drmn0 on minor 0
According to this it is equivalent of Linux 5.6. In tree drm is equivalent of Linux 5.4.
Could you provide your local ported version of drm-kmod?
 
Cloned your repo to /usr/ports/graphics/drm-kmod-novolaska, built branch backport-stable-13.
Rebooted, try it on FreeBSD 13.0-RC4

Rebuild ports:
graphics/gpu-firmware-kmod

Code:
# kldload amdgpu

# dmesg
[drm] amdgpu kernel modesetting enabled.
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)!
[drm] initializing kernel modesetting (RENOIR 0x1002:0x1636 0x1002:0x1636 0xD8).
[drm] register mmio base: 0xFCB00000
[drm] register mmio size: 524288
[drm] add ip block number 0 <soc15_common>
[drm] add ip block number 1 <gmc_v9_0>
[drm] add ip block number 2 <vega10_ih>
[drm] add ip block number 3 <psp>
[drm] add ip block number 4 <smu>
[drm] add ip block number 5 <gfx_v9_0>
[drm] add ip block number 6 <sdma_v4_0>
[drm] add ip block number 7 <dm>
[drm] add ip block number 8 <vcn_v2_0>
amdgpu/renoir_gpu_info.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_gpu_info.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_gpu_info_bin
ATOM BIOS: 113-RENOIR-033
amdgpu/renoir_sdma.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_sdma.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_sdma_bin
[drm] VCN decode is enabled in VM mode
[drm] VCN encode is enabled in VM mode
[drm] VCN jpeg decode is enabled in VM mode
[drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit
drmn0: VRAM: 512M 0x000000F400000000 - 0x000000F41FFFFFFF (512M used)
drmn0: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF
drmn0: AGP: 267419648M 0x000000F800000000 - 0x0000FFFFFFFFFFFF
Successfully added WC MTRR for [0xd0000000-0xdfffffff]: 0;
[drm] Detected VRAM RAM=512M, BAR=256M
[drm] RAM width 64bits UNKNOWN
[TTM] Zone  kernel: Available graphics memory: 16436432 KiB
[TTM] Zone   dma32: Available graphics memory: 2097152 KiB
[TTM] Initializing pool allocator
[drm] amdgpu: 512M of VRAM memory ready
[drm] amdgpu: 3072M of GTT memory ready.
[drm] GART: num cpu pages 262144, num gpu pages 262144
[drm] PCIE GART of 1024M enabled (table at 0x000000F400900000).
amdgpu/renoir_asd.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_asd.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_asd_bin
amdgpu/renoir_pfp.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_pfp.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_pfp_bin
amdgpu/renoir_me.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_me.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_me_bin
amdgpu/renoir_ce.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_ce.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_ce_bin
amdgpu/renoir_rlc.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_rlc.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_rlc_bin
amdgpu/renoir_mec.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_mec.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_mec_bin
amdgpu/renoir_mec2.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_mec2.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_mec2_bin
[drm] use_doorbell being set to: [true]
amdgpu/renoir_vcn.bin: could not load firmware image, error 2
drmn0: fail (0) to get firmware image with name: amdgpu/renoir_vcn.bin
drmn0: successfully loaded firmware image with mapped name: amdgpu_renoir_vcn_bin
[drm] Found VCN firmware Version ENC: 1.7 DEC: 4 VEP: 0 Revision: 17
[drm] PSP loading VCN firmware
sos fw version = 0x110065.
[drm] reserve 0x400000 from 0xf41f800000 for PSP TMR
amdgpu: [powerplay] smu driver if version = 0x0000000a, smu fw if version = 0x0000000e, smu fw version = 0x00374e00 (55.78.0)
amdgpu: [powerplay] SMU driver if version not matched
amdgpu: [powerplay] dpm has been disabled
amdgpu: [powerplay] SMU is initialized successfully!
[drm] Display Core initialized with v3.2.56!
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-2
[drm]   - kern.vt.fb.default_mode
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] VCN decode and encode initialized successfully(under DPG Mode).
[drm] Cannot find any crtc or sizes
drmn0: ring gfx uses VM inv eng 0 on hub 0
drmn0: ring comp_1.0.0 uses VM inv eng 1 on hub 0
drmn0: ring comp_1.1.0 uses VM inv eng 4 on hub 0
drmn0: ring comp_1.2.0 uses VM inv eng 5 on hub 0
drmn0: ring comp_1.3.0 uses VM inv eng 6 on hub 0
drmn0: ring comp_1.0.1 uses VM inv eng 7 on hub 0
drmn0: ring comp_1.1.1 uses VM inv eng 8 on hub 0
drmn0: ring comp_1.2.1 uses VM inv eng 9 on hub 0
drmn0: ring comp_1.3.1 uses VM inv eng 10 on hub 0
drmn0: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
drmn0: ring sdma0 uses VM inv eng 0 on hub 1
drmn0: ring vcn_dec uses VM inv eng 1 on hub 1
drmn0: ring vcn_enc0 uses VM inv eng 4 on hub 1
drmn0: ring vcn_enc1 uses VM inv eng 5 on hub 1
drmn0: ring vcn_jpeg uses VM inv eng 6 on hub 1
[drm] Initialized amdgpu 3.36.0 20150101 for drmn0 on minor 0

# ls -lh /boot/modules/amdgpu_renoir_*
-r-xr-xr-x  1 root  wheel   188K Mar 31 20:20 /boot/modules/amdgpu_renoir_asd_bin.ko
-r-xr-xr-x  1 root  wheel    21K Mar 31 20:20 /boot/modules/amdgpu_renoir_ce_bin.ko
-r-xr-xr-x  1 root  wheel    68K Mar 31 20:20 /boot/modules/amdgpu_renoir_dmcub_bin.ko
-r-xr-xr-x  1 root  wheel    12K Mar 31 20:20 /boot/modules/amdgpu_renoir_gpu_info_bin.ko
-r-xr-xr-x  1 root  wheel    29K Mar 31 20:20 /boot/modules/amdgpu_renoir_me_bin.ko
-r-xr-xr-x  1 root  wheel   274K Mar 31 20:20 /boot/modules/amdgpu_renoir_mec_bin.ko
-r-xr-xr-x  1 root  wheel   274K Mar 31 20:20 /boot/modules/amdgpu_renoir_mec2_bin.ko
-r-xr-xr-x  1 root  wheel    33K Mar 31 20:20 /boot/modules/amdgpu_renoir_pfp_bin.ko
-r-xr-xr-x  1 root  wheel    50K Mar 31 20:20 /boot/modules/amdgpu_renoir_rlc_bin.ko
-r-xr-xr-x  1 root  wheel    29K Mar 31 20:20 /boot/modules/amdgpu_renoir_sdma_bin.ko
-r-xr-xr-x  1 root  wheel    45K Mar 31 20:20 /boot/modules/amdgpu_renoir_ta_bin.ko
-r-xr-xr-x  1 root  wheel   459K Mar 31 20:20 /boot/modules/amdgpu_renoir_vcn_bin.ko

amdgpu.conf
Code:
Section "Device"
        Identifier      "Card0"
        Driver           "amdgpu"
        BusID           "PCI:6:0:0"
        Option          "DRI"   "3"
        Option          "TearFree"              "true"
EndSection

Then screen blanks (I was on physical ttyv0 console) even before starting Xorg.
Same results with and without efi_max_resolution="720p" in loader.conf
Blindy typing startx() in console won't unblank screen.


When Xorg is started it seems stuck in D state (unable to kill it with -9)
Code:
ps aux | grep Xorg
root       1653    0.0  0.2 208376  55376 v0  D    20:09    0:00.07 /usr/local/bin/Xorg :0 -auth /home/johnny/.serverauth.1639

Xorg.0.log attached
 

Attachments

  • Xorg-with-conf.log.txt
    4.9 KB · Views: 186
FreeBSD r7s 13.0-RC5-p1 FreeBSD 13.0-RC5-p1 #4 releng-n244730-273977acb0a: Fri Apr 9 20:23:50 CST 2021

ports/gpu-firmware-kmod, distinfo:
Code:
TIMESTAMP = 1616130029
SHA256 (freebsd-drm-kmod-firmware-g20210224-d15ea6e_GH0.tar.gz) = 93db8caa4423f1553aaf8f7ae2e874425548890054028b44ed696e5ef73aef86
SIZE (freebsd-drm-kmod-firmware-g20210224-d15ea6e_GH0.tar.gz) = 24466018
 

Attachments

  • Xorg.0.log.txt
    26.7 KB · Views: 166
  • dmesg.txt
    7.5 KB · Views: 168
Finally get my workstation to work with amdgpu.ko

TL;DR: Don't put
Code:
kern.vt.fb.default_mode=...
in /boot/loader.conf

As stated earlier you need at least DRM 5.5 for Renoir.
Currently it won't compile on 13.0-RELEASE so you'll need 13.0-STABLE src and running system.

DRM 5.5 is not yet merged into ports tree, you need to get it and compile manually.
(assuming that you are running 13-STABLE and /usr/src has checkouted origin/stable/13 branch)
Code:
cd /usr/ports/graphics
mkdir /usr/ports/graphics/drm-kmod-git
cd /usr/ports/graphics/drm-kmod-git
git clone https://github.com/freebsd/drm-kmod .
git checkout -b 5.5-stable origin/5.5-stable
make && make install

To successfully load built module you need to be running FreeBSD 13-STABLE.

My versions and config files:
Code:
git -C /usr/src log -1 | head -1
commit 69d2ba675a6d567b86a022022ba3fcc64ed4c1f6 (HEAD -> refs/heads/stable13, refs/remotes/origin/stable/13)

git -C /usr/ports/graphics/drm-kmod-git log -1 | head -1
commit 93009bacca9117d102e574596e565f6337ed83b7 (HEAD -> refs/heads/5.5-stable, tag: refs/tags/drm_v5.5.19_2, refs/remotes/origin/5.5-stable)

pkg info mesa-dri mesa-libs gpu-firmware-kmod xorg-server-1.20.11_3,1 xf86-video\*
mesa-dri-21.1.5
mesa-libs-21.1.5_2
gpu-firmware-kmod-g20210330
xorg-server-1.20.11_3,1
xf86-video-amdgpu-19.1.0_2
xf86-video-scfb-0.0.5_2

cat /usr/local/etc/X11/xorg.conf.d/amdgpu.conf
Section "OutputClass"
        Identifier "Card0"
        Driver "amdgpu"
EndSection

# grep amdgpu /etc/rc.conf
kld_list="{kld_list} amdtemp /boot/modules/amdgpu.ko"

If you get black screen at this stage check for "kern.vt.fb.default_mode" in /boot/loader.conf.

In my case it will start Xorg with 640x480 resolution but you can fix it with something like:
Code:
xrandr --output HDMI-A-0 --mode 1920x1080
You can put it in your ~/.xinitrc or something similar for GUI login manager.

I still can't use my 2nd monitor connected to DisplayPort to integrated AMDGPU (xrandr recognized it but doesn't work). It doesn't work under Linux 5.10 either so I guess I have to wait some months/years before it works but this is good enough for now :beer:
 
DRM 5.5 is not yet merged into ports tree, you need to get it and compile manually.
graphics/drm-devel-kmod

You should be able to install it on a recent 13-STABLE
Code:
.if ${OPSYS} == FreeBSD && (${OSVERSION} < 1300513 || \
	(${OSVERSION} < 1400024 && ${OSVERSION} >= 1400000))
IGNORE=		not supported on older CURRENT/STABLE, no kernel support
.endif
 
Finally get my workstation to work with amdgpu.ko

As stated earlier you need at least DRM 5.5 for Renoir.
Currently it won't compile on 13.0-RELEASE so you'll need 13.0-STABLE src and running system.

DRM 5.5 is not yet merged into ports tree, you need to get it and compile manually.
(assuming that you are running 13-STABLE and /usr/src has checkouted origin/stable/13 branch)
...
Hi, have you updated since then? Is it still working?
 
Back
Top