amdgpu causes kernel panic on load with Radeon 860M iGPU

I installed FreeBSD 15.0-RELEASE-p2 on a Lenovo Ideapad Slim 5 laptop, with a AMD Ryzen AI 7 350 CPU and Radeon 860M iGPU. When running kldload amdgpu I get a kernel panic like this

Code:
iic0: <I2C generic I/O> on iicbus0
iic1: <I2C generic I/O> on iicbus1
iic2: <I2C generic I/O> on iicbus2
<6>[drm] amdgpu kernel modesetting enabled.
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
<6>[drm] initializing kernel modesetting (IP DISCOVERY 0x1002:0x1114 0x17AA:0x3804 0xC2).
<6>[drm] register mmio base: 0x80400000
<6>[drm] register mmio size: 524288
drmn0: Fatal error during GPU init
drmn0: amdgpu: finishing device.


Fatal trap 12: page fault while in kernel mode
cpuid = 9; apic id = 09
fault virtual address   = 0x18
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff80f2d414
stack pointer           = 0x28:0xfffffe013ea927e0
frame pointer           = 0x28:0xfffffe013ea92800
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 4907 (kldload)
rdi: 0000000000000000 rsi: 0000000000000000 rdx: 0000000000000000
rcx: 0000000000000000  r8: fffffffffffffff0  r9: fffffffffffffff0
rax: 0000000000000001 rbx: fffff80021103780 rbp: fffffe013ea92800
r10: 00000000000f4240 r11: 0000000000000000 r12: fffff8000163c100
r13: fffff80001b4ca00 r14: 0000000000000000 r15: fffffe0157122000
trap number             = 12
panic: page fault
cpuid = 9
time = 1769887486
KDB: stack backtrace:
#0 0xffffffff80bbe1ed at kdb_backtrace+0x5d
#1 0xffffffff80b71576 at vpanic+0x136
#2 0xffffffff80b71433 at panic+0x43
#3 0xffffffff81079f69 at trap_pfault+0x3c9
#4 0xffffffff8104ffe8 at calltrap+0x8
#5 0xffffffff839114fc at unregister_fictitious_range+0xc
#6 0xffffffff84017227 at amdgpu_device_fini_hw+0x117
#7 0xffffffff84037024 at amdgpu_driver_load_kms+0x84
#8 0xffffffff840268cf at amdgpu_pci_probe+0x29f
#9 0xffffffff80dfc23c at linux_pci_attach_device+0x5ac
#10 0xffffffff80bad2ed at device_attach+0x43d
#11 0xffffffff80baf043 at bus_generic_driver_added+0x73
#12 0xffffffff80baa8c9 at devclass_driver_added+0x29
#13 0xffffffff80baa85e at devclass_add_driver+0x11e
#14 0xffffffff80dfd29c at _linux_pci_register_driver+0xcc
#15 0xffffffff84026623 at amdgpu_evh+0x73
#16 0xffffffff80b4b575 at module_register_init+0x85
#17 0xffffffff80b3c0df at linker_load_module+0xc0f

I've tried the driver with pkg versions of drm-515-kmod, drm-61-kmod, drm-66-kmod, and drm-latest-kmod (6.9) and also the ports versions of drm-61-kmod, drm-66-kmod, and drm-latest-kmod. Fwget didn't find any gpu firmware I didn't already have.

I suspect I'm simply missing a piece of firmware needed, but I have no idea what it is. Thanks in advance
 
If you have access to a recent linux livecd, try to check which firmware files are loaded there. I'm guessing the firmware needed for your graphics card was added/updated in the last year.
 
If you have access to a recent linux livecd, try to check which firmware files are loaded there. I'm guessing the firmware needed for your graphics card was added/updated in the last year.
I did that looking at dmesg | grep amdgpu on a manjaro live cd and all of them seemed to already have been installed on my freebsd system. The issue still remains.
 
Kierteiyu , if you want to try a newer package with updated files.

Checkout, https://github.com/freebsd/freebsd-ports/tree/main/graphics/gpu-firmware-amd-kmod and replace the attached files. You can then build with:

# cd /usr/ports/graphics/gpu-firmware-amd-kmod/
# for FLV in $(make -V FLAVORS); do make package FLAVOR=${FLV}; done

And install with:

# for dir in work-*; do pkg install -y -f $dir/pkg/*.pkg; done

PS: Or use poudiere.

Otherwise, the drm 6.10 PR was approved last week. I'm guessing it will reach at least STABLE soonish and you can try again.
 

Attachments

The DRM 6.10 kmod requires a newer kernel (FreeBSD-CURRENT). I tried the development version of FreeBSD 15, but it's not supported there yet.

Probably the only thing you can do is try building the tagged drm-610_1-kmod against FreeBSD-CURRENT or wait until it gets a release version.
 
drm-kmod currently 515/61/66 (from linux kernel lts)?
based on https://github.com/freebsd/drm-kmod/ tags there are 6.(7,8,9,10), so not lts?

i haven't had any luck finding the exact firmware bin (with linux) but MIGHT be gpu-firmware-amd-kmod-gc-11-5-2-20250808.pkg

gmc_v11_0.c could be that code, but yet 11.5.2 are missing, so will wait for 6.11/6.12lts

i still think its weird it uses non lts

edit
ubuntu 24.04.2 6.8: amdgpu: fatal error during GPU init
edeavouros endeavour 6.10: amdgpu: fatal error during GPU init
ubuntu 24.04.3 6.11: amdgpu works
 
Try updating the BIOS software. I had similar issues with the AI 7 350 on Fedora, constant freezes - fixed once the BIOS was updated (for my Omnibook, I had to install windows to do this - promptly removed once done).
 
I upgraded to FreeBSD 15.1 release, and I tried the pkg version of drm-kmod, and tried compiling drm-612-kmod from ports. All of these produced a kernel panic upon loading amdgpu. Does anyone know if it is possible to get this GPU to run on FreeBSD 15.1?
 
I upgraded to FreeBSD 15.1 release, and I tried the pkg version of drm-kmod, and tried compiling drm-612-kmod from ports. All of these produced a kernel panic upon loading amdgpu. Does anyone know if it is possible to get this GPU to run on FreeBSD 15.1?
Have you tried OpenBSD? (out of curiosity, whether the GPU works there)
 
freebsd 15.1 + build drm-612-kmod + gpu-firmware is fine now

Code:
# dmesg | grep drm
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] initializing kernel modesetting (IP DISCOVERY 0x1002:0x1114 0x17AA:0x3804 0xC2).
[drm] register mmio base: 0x80400000
[drm] register mmio size: 524288
[drm] add ip block number 0 <soc21_common>
[drm] add ip block number 1 <gmc_v11_0>
[drm] add ip block number 2 <ih_v6_1>
[drm] add ip block number 3 <psp>
[drm] add ip block number 4 <smu>
[drm] add ip block number 5 <dm>
[drm] add ip block number 6 <gfx_v11_0>
[drm] add ip block number 7 <sdma_v6_0>
[drm] add ip block number 8 <vcn_v4_0_5>
[drm] add ip block number 9 <jpeg_v4_0_5>
[drm] add ip block number 10 <mes_v11_0>
[drm] add ip block number 11 <vpe_v6_1>
drmn0: Fetched VBIOS from VFCT
drmn0: successfully loaded firmware image 'amdgpu/psp_14_0_4_toc.bin'
drmn0: successfully loaded firmware image 'amdgpu/psp_14_0_4_ta.bin'
drmn0: successfully loaded firmware image 'amdgpu/dcn_3_5_dmcub.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_pfp.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_me.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_rlc.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_mec.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_imu.bin'
drmn0: successfully loaded firmware image 'amdgpu/sdma_6_1_2.bin'
drmn0: successfully loaded firmware image 'amdgpu/vcn_4_0_5.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_mes_2.bin'
drmn0: successfully loaded firmware image 'amdgpu/gc_11_5_2_mes1.bin'
drmn0: VPE: collaborate mode falsedrmn0: Trusted Memory Zone (TMZ) feature disabled as experimental (default)
drmn0: PCIE atomic ops is not supported
[drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit
drmn0: VRAM: 512M 0x0000008000000000 - 0x000000801FFFFFFF (512M used)
drmn0: GART: 512M 0x00007FFF00000000 - 0x00007FFF1FFFFFFF
[drm] Detected VRAM RAM=512M, BAR=512M
[drm] RAM width 128bits DDR5
[drm] amdgpu: 512M of VRAM memory ready
[drm] amdgpu: 15998M of GTT memory ready.
[drm] GART: num cpu pages 131072, num gpu pages 131072
[drm] PCIE GART of 512M enabled (table at 0x0000008000900000).
[drm] Loading DMUB firmware via PSP: version=0x09004700
[drm] Found VCN firmware Version ENC: 1.24 DEC: 9 VEP: 0 Revision: 34
drmn0: successfully loaded firmware image 'amdgpu/vpe_6_1_3.bin'
drmn0: reserve 0x1100000 from 0x801c000000 for PSP TMR
drmn0: RAS: optional ras ta ucode is not available
drmn0: RAP: optional rap ta ucode is not available
drmn0: SECUREDISPLAY: securedisplay ta ucode is not available
drmn0: SMU is initialized successfully!
[drm] Seamless boot condition check passed
[drm] Display Core v3.2.301 initialized on DCN 3.5
[drm] DP-HDMI FRL PCON supported
[drm] DMUB hardware initialized: version=0x09004700
lkpi_iic0: <LinuxKPI I2C> on drmn0
[drm] PSR support 1, DC PSR ver 0, sink PSR ver 1 DPCD caps 0x3a su_y_granularity 4
lkpi_iic1: <LinuxKPI I2C> on drmn0
lkpi_iic2: <LinuxKPI I2C> on drmn0
lkpi_iic3: <LinuxKPI I2C> on drmn0
lkpi_iic4: <LinuxKPI I2C> on drmn0
lkpi_iic5: <LinuxKPI I2C> on drmn0
lkpi_iic6: <LinuxKPI I2C> on drmn0
lkpi_iic7: <LinuxKPI I2C> on drmn0
lkpi_iic8: <LinuxKPI I2C> on drmn0
drmn0: SE 1, SH per SE 2, CU per SH 4, active_cu_number 8
drmn0: ring gfx_0.0.0 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 6 on hub 0
drmn0: ring comp_1.3.0 uses VM inv eng 7 on hub 0
drmn0: ring comp_1.0.1 uses VM inv eng 8 on hub 0
drmn0: ring comp_1.1.1 uses VM inv eng 9 on hub 0
drmn0: ring comp_1.2.1 uses VM inv eng 10 on hub 0
drmn0: ring comp_1.3.1 uses VM inv eng 11 on hub 0
drmn0: ring sdma0 uses VM inv eng 12 on hub 0
drmn0: ring vcn_unified_0 uses VM inv eng 0 on hub 8
drmn0: ring jpeg_dec_0 uses VM inv eng 1 on hub 8
drmn0: ring mes_kiq_3.1.0 uses VM inv eng 13 on hub 0
drmn0: ring vpe uses VM inv eng 4 on hub 8
[drm] ring gfx_1.1.1 was added
[drm] ring compute_1.2.2 was added
[drm] ring sdma_1.3.3 was added
[drm] ring gfx_1.1.1 ib test pass
[drm] ring compute_1.2.2 ib test pass
[drm] ring sdma_1.3.3 ib test pass
vgapci0: child drmn0 requested pci_get_powerstate
drmn0: Runtime PM not available
lkpi_iic9: <LinuxKPI I2C> on drm1
lkpi_iic10: <LinuxKPI I2C> on drm3
lkpi_iic11: <LinuxKPI I2C> on drm4
lkpi_iic12: <LinuxKPI I2C> on drm5
lkpi_iic13: <LinuxKPI I2C> on drm6
lkpi_iic14: <LinuxKPI I2C> on drm7
lkpi_iic15: <LinuxKPI I2C> on drm8
lkpi_iic16: <LinuxKPI I2C> on drm9
[drm] Initialized amdgpu 3.61.0 for drmn0 on minor 0
VT: Replacing driver "efifb" with new "drmfb".
[drm] pre_validate_dsc:1629 MST_DSC dsc precompute is not needed
name=drmn0 id=amdgpudrmfb flags=0x0 stride=7680

just a few issues

lid doesn't work yet
sleep nope
brightness +/- not working (like many hotkeys dont work) (can be used with sysctl hw.amdgpu.backlight: -1, or compat.linuxkpi.amdgpu_backlight: -1

i replaced mediatek with ax210
 
Back
Top