Solved After update to FreeBSD 12.0 drm module fails to load

After updating my desktop system from 11.2-RELEASE -> 12.0-RELEASE the Radeon KMS module is failing to load at system boot. My GPU is part of the Cayman series and I prevously had the graphics/drm-kmod package installed and working with 11.2-RELEASE.

pciconf output:
Code:
vgapci0@pci0:10:0:0:    class=0x030000 card=0x24601462 chip=0x67191002 rev=0x00 hdr=0x00
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Cayman PRO [Radeon HD 6950]'
    class      = display
    subclass   = VGA
hdac0@pci0:10:0:1:    class=0x040300 card=0xaa801462 chip=0xaa801002 rev=0x00 hdr=0x00
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Cayman/Antilles HDMI Audio [Radeon HD 6930/6950/6970/6990]'
    class      = multimedia
    subclass   = HDA

I still have kld_list entry in my /etc/rc.conf

Code:
kld_list="/boot/modules/radeonkms.ko"

During boot and in dmesg I see the following error

Code:
[drm] radeon 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 (CAYMAN 0x1002:0x6719 0x1462:0x2460 0x00).
[drm] register mmio base: 0xFE920000
[drm] register mmio size: 131072
[drm:radeon_device_init] Unable to find PCI I/O BAR
[drm:radeon_atombios_init] Unable to find PCI I/O BAR; using MMIO for ATOM IIO
ATOM BIOS: 113
drmn0: VRAM: 2048M 0x0000000000000000 - 0x000000007FFFFFFF (2048M used)
drmn0: GTT: 1024M 0x0000000080000000 - 0x00000000BFFFFFFF
[drm] Detected VRAM RAM=2048M, BAR=256M
[drm] RAM width 256bits DDR
[TTM] Zone  kernel: Available graphics memory: 16727320 kiB
[TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
[drm] radeon: 2048M of VRAM memory ready
[drm] radeon: 1024M of GTT memory ready.
[drm] Loading CAYMAN Microcode
radeon/CAYMAN_pfp.bin: could not load firmware image, error 2
radeon/CAYMAN_pfp.bin: could not load firmware image, error 2
KLD radeon_CAYMAN_pfp_bin.ko: depends on kernel - not available or version mismatch
linker_load_file: /boot/modules/radeon_CAYMAN_pfp_bin.ko - unsupported file type
drmn0: failed to load firmware image radeon_CAYMAN_pfp_bin
ni_cp: Failed to load firmware "radeon/CAYMAN_pfp.bin"
[drm:cayman_init] Failed to load firmware!
drmn0: Fatal error during GPU init
[drm] radeon: finishing device.
[TTM] Finalizing pool allocator
[TTM] Zone  kernel: Used memory at exit: 0 kiB
[TTM] Zone   dma32: Used memory at exit: 0 kiB
[drm] radeon: ttm finalized

While Xorg is currently working, my screen resolution and graphics performance is not where it was before the upgrade. Running pkg upgrade states that there is nothing to update, so I have the latest version of the graphics/drm-kmod and graphics/xf86-video-ati installed for 12.0-RELEASE. It does appear that the drm-stable-kmod package was replaced by drm-next-kmod during the upgrade process (my understanding following https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231884 this is the expected behavior). What I don't know is if this problem/regression should be added to that ticket or if the radeon firmware has yet to be rebuilt for 12.0-RELEASE?
 
KLD radeon_CAYMAN_pfp_bin.ko: depends on kernel - not available or version mismatch
“version mismatch” - Before finishing upgrade to 12.0-RELEASE, before the final reboot + freebsd-update install step, there was a message instructing to update/upgrade ports/pkg first. On my system pkg upgrade reinstalled all packages. If you haven’t reinstalled at this point all packages, this could explain the version mismatch error, current system seeing installed packages for 11.2-RELEASE . Try reinstalling all packages.
 
Yep, after a major version upgrade you must reinstall all packages.
 
Sorry I didn't state it explicitly but I did update all packages with the following:

pkg-static install -f pkg
pkg update
pkg upgrade
freebsd-update install
reboot


Which is why the drm-stable-kmod that was installed when I was running 11.2-RELEASE got replaced with drm-next-kmod.
 
A pkg upgrade does not suffice, it only updates out of date packages, not everything. So you must use pkg upgrade -f
 
You should use "pkg upgrade -f" instead. This way all packages get reinstalled.
I think the problem is not in the drm port but the firmware port which didn't get reinstalled.

EDIT: damn SirDice beat me to it... :D
 
I am rerunning pkg upgrade with the "-f" argument now, but it didn't pull anything from the package mirrors. It is just reinstalling all my packages from pkg's cache. When I ran pkg upgrade during my upgrade process it did seem fetch and reinstall/update all my installed package as it fetched and installed 687 items from the repos.

Flushing pkg's cache (simply ran sudo rm -rf /var/cache/pkg/* then re-ran pkg upgrade -f I get the following output

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (690 candidates): 100%
Processing candidates (690 candidates): 100%
The following 687 package(s) will be affected (of 0 checked):
... (rest of output trimmed)


So it does seem that pkg is not upgrading/reinstalling some of the installed packages, but xf86-video-ati-18.1.0,1, drm-next-kmod-4.11.g20181027_1, and drm-kmod-g20180930 are listed among the 687 packages it will upgrade/reinstall.

Not sure if it matters but I do have pkg configured to use pkg+http://pkg.FreeBSD.org/${ABI}/latest rather than quarterly
 
It is just reinstalling all my packages from pkg's cache.
Clear your cache: pkg clean -a

So it does seem that pkg is not upgrading/reinstalling some of the installed packages, but xf86-video-ati-18.1.0,1, drm-next-kmod-4.11.g20181027_1, and drm-kmod-g20180930 are listed among the 687 packages it will upgrade/reinstall.
Let it work its magic. Sometimes it will do a second pass when it realizes things are conflicting or need some extra steps/dependencies.
 
Following up: after deleting everything from pkg's cache I also had to run the following:
Code:
rm /var/db/pkg/repo-*.sqlite
pkg bootstrap -f

Before I could run pkg upgrade -f again.
 
Clear your cache: pkg clean -a


Let it work its magic. Sometimes it will do a second pass when it realizes things are conflicting or need some extra steps/dependencies.

I'll try that once this pass of pkg upgrade -f finishes
 
Following up: after deleting everything from pkg's cache I also had to run the following:
Code:
rm /var/db/pkg/repo-*.sqlite
pkg bootstrap -f

Before I could run pkg upgrade -f again.

Running those seems to have helped, the drm module was able to be loaded at boot
 
Back
Top