X.Org occasionally crashing

Hello. I'm using FreeBSD 14.1-RELEASE(amd64) with AMD HD6450 graphics on X11(with fvwm). Occasionally, my X server crashes with the following message printed on tty:
[drm ERROR :btc_dpm_set_power_state] rv770_restrict_performance_levels_before_switch failed

This usually happens when I try enabling fullscreen for a video on Firefox/VLC. Is there a solution to this problem? I never got this on 13.2-RELEASE which I used for more than a year before upgrading to 14.1 recently.

Thanks!
 
What drm-kmod are you using?
pkg info | grep drm
Code:
[T5810-FreeBSD] ~ > pkg info | grep drm
drm-515-kmod-5.15.160          DRM drivers modules
drm-kmod-20220907_3            Metaport of DRM modules for the linuxkpi-based KMS components
gpu-firmware-kmod-20240401,1   Firmware modules for the drm-kmod drivers
libdrm-2.4.122,1               Direct Rendering Manager library and headers
[T5810-FreeBSD] ~ >
Is drm-kmod-20220907_3 normal..?
 
Ok. This kmod was compiled under 14.0 and you are on 14.1.
Try: # pkg upgrade -f drm-515-kmod
Then, run again: pkg info drm-515-kmod |grep FreeBSD_version
 
Ok. This kmod was compiled under 14.0 and you are on 14.1.
Try: # pkg upgrade -f drm-515-kmod
Then, run again: pkg info drm-515-kmod |grep FreeBSD_version
This is weird. I did both and I still have the same version.
Code:
[T5810-FreeBSD] ~ > sudo pkg upgrade -f drm-515-kmod
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        drm-515-kmod-5.15.160

Number of packages to be reinstalled: 1

Proceed with this action? [y/N]: y
[1/1] Reinstalling drm-515-kmod-5.15.160...
[1/1] Extracting drm-515-kmod-5.15.160: 100%
[T5810-FreeBSD] ~ > pkg info drm-515-kmod |grep FreeBSD_version
        FreeBSD_version: 1400097
[T5810-FreeBSD] ~ >
 
Try building graphics/drm-61-kmod yourself from source on your 14.1-RELEASE: 4.5. Using the Ports Collection.
When 14.0-RELEASE will have reached EOL (September 30, 2024) that package specifically build for 14.1-RELEASE will become available.

As your graphics card is from 2011 as it seems, and thus rather old, building graphics/drm-515-kmod might also work.



Assuming you did upgrade all your packages after finishing the OS upgrade to 14.1-RELEASE, I suspect that you didn't get the package from graphics/drm-61-kmod because it seems that that particular package has been "withdrawn" temporarily. At the moment it is only available for FreeBSD 15 (aka -CURRENT) on amd64 .

This kmod was compiled under 14.0 and you are on 14.1.
Currently there are no remote packages build specifically for 14.1-RELEASE available because 14.0-RELEASE has not reached EOL yet. I suspect by pkg upgrade -f drm-515-kmod your version of the package will not change: pkg info drm-515-kmod| grep version.

For the meta package graphics/drm-kmod there is a build time dependency* as noise explained here

Note that this "build specifically for 14.1-RELEASE" is only of a concern for a very small number of packages that rely not only (or not at all) on the 14.x ABI**, but on the KAPI (Kernel API). The graphics kernel modules in packages like graphics/drm-61-kmod are a prime example of that.

___
* should you try to build the whole meta package graphics/drm-kmod from source yourself, then you should get graphics/drm-61-kmod. However, without specific measures this means also that all firmware packages will be build from source on your machine: that could take some considerable amount of time.

** ABI is stable for all versions of a stable branch, for example the stable/14 branch and thus all 14.x-RELEASE versions
 
Thanks for the reply.
Try building graphics/drm-61-kmod yourself from source on your 14.1-RELEASE: 4.5. Using the Ports Collection.
I just tried installing drm-61-kmod from 2024Q3 (removed drm-kmod and drm-515-kmod, then portmaster graphics/drm-kmod which also pulls drm-61-kmod), installed and there are many weird glitches. On tty there's some weird artifact (green line on left and blurry text) on one of my monitors (i have two) and startx doesn't work.
from dmesg(similar lines are repeated about 10 times):
Code:
trying to bind memory to uninitialized GART !
[drm ERROR :radeon_ttm_backend_bind] failed to bind 1 pages at 0x00000000
[drm ERROR :radeon_gem_object_create] Failed to allocate GEM object (4096, 2, 4096, -22)
trying to bind memory to uninitialized GART !
[drm ERROR :radeon_ttm_backend_bind] failed to bind 1 pages at 0x00000000
[drm ERROR :radeon_gem_object_create] Failed to allocate GEM object (4096, 2, 4096, -22)
trying to bind memory to uninitialized GART !
[drm ERROR :radeon_ttm_backend_bind] failed to bind 6 pages at 0x00000000
[drm ERROR :radeon_gem_object_create] Failed to allocate GEM object (24576, 2, 4096, -22)
trying to bind memory to uninitialized GART !
[drm ERROR :radeon_ttm_backend_bind] failed to bind 6 pages at 0x00000000
[drm ERROR :radeon_gem_object_create] Failed to allocate GEM object (24576, 2, 4096, -22)
trying to bind memory to uninitialized GART !
[drm ERROR :radeon_ttm_backend_bind] failed to bind 256 pages at 0x00000000
[drm ERROR :radeon_gem_object_create] Failed to allocate GEM object (1048576, 2, 4096, -22)
trying to bind memory to uninitialized GART !
[drm ERROR :radeon_ttm_backend_bind] failed to bind 256 pages at 0x00000000
[drm ERROR :radeon_gem_object_create] Failed to allocate GEM object (1048576, 2, 4096, -22)
trying to bind memory to uninitialized GART !
id 20853 (Xorg), jid 0, uid 0: exited on signal 6 (no core dump - bad address)
from Xorg.0.log:
Code:
[    59.542] (EE) Segmentation fault at address 0xb0
[    59.542] (EE)
Fatal server error:
[    59.542] (EE) Caught signal 11 (Segmentation fault). Server aborting
[    59.542] (EE)
[    59.542] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[    59.542] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    59.542] (EE)
[    59.542] (II) AIGLX: Suspending AIGLX clients for VT switch
[    59.542] (EE) Server terminated with error (1). Closing log file.

So I removed drm-kmod and drm-61-kmod again and installed drm-515-kmod using portmaster graphics/drm-515-kmod, and I have the same X server crashing when going fullscreen issue.
Code:
[T5810-FreeBSD] ~ > pkg info drm-515-kmod | grep FreeBSD_version
        FreeBSD_version: 1401000
 
I removed drm-515-kmod and reinstalled drm-61-kmod, this time I have a bit different symptoms. I have no weird artifacts on tty, and X doesn't crash but X shows weirdly (only mouse visible, bit distorted screen and can't see menu or window). I had to switch with Alt-F1 to tty and Ctrl-C to kill it. ttyv0 was being spammed.
This is Xorg.0.log right now - https://termbin.com/ti7z
This is dmesg (similar message keeps repeating even after X killed) - https://termbin.com/dtiy

I have radeonkms fusefs on kld_list.

I'll try rebooting a few more times to see if I can get the same glitch again.
 
… 14.1-RELEASE, … the package from graphics/drm-61-kmod because it seems that that particular package has been "withdrawn" temporarily. …

1723898816690.pngNot withdrawn, it's intentionally ignored at this time.
 
dmesg

I'll try rebooting a few more times to see if I can get the same glitch again.

drmn0: GPU lockup (current fence id 0x0000000000000000 last fence id 0x0000000000000018 on ring 3)

In my experience from a few months ago (when I last used AMD graphics): when you get the long series of that type of message, recovery is unlikely.

drm-kmod issue 239 may be of interest.

If you find it necessary to force off the computer: you might make interruptions less harsh by configuring FreeBSD to shut down, not sleep, in response to the power button.

Dell Precision T5810, yes?
 
If you find it necessary to force off the computer: you might make interruptions less harsh by configuring FreeBSD to shut down, not sleep, in response to the power button.

Dell Precision T5810, yes?
Pressing power button already turns off the machine for me, is this supposed to be different? Even while that log is being spammed I have no trouble returning to tty and running sudo poweroff.
And yeah this is a Dell Precision T5810.
 
After not being able to reproduce that glitch 4 times I removed drm-61-kmod again and installed drm-515-kmod(from ports). This time surprisingly I had zero X crashes even after 5 reboots and 20 video fullscreen attempt in firefox.. (in these cases I got the same error in dmesg too, but AFTER properly exiting Xorg and not crashing it)

So in attempt to reproduce the earlier problem I removed 515 again and installed 61. This time right after reboot I get the exact same tty screen glitch and X not starting. Here are the full logs from it:
dmesg - https://termbin.com/0thh
Xorg.0.log - https://termbin.com/zcf8 (i have two 1920x1080@60hz btw)

Sorry I'm writing this on my phone so can't attach the logs now, I'll add them to this post later. -> Done

Edit: Rebooted again and same symptoms as https://forums.freebsd.org/threads/x-org-occasionally-crashing.94612/post-668026 , I don't understand how this only shows different issue on first boot after installing kmod..
 

Attachments

This is Xorg.0.log right now - https://termbin.com/ti7z
contains:
Code:
[   145.697] (EE) Failed to load module "ati" (module does not exist, 0)
[   145.697] (II) LoadModule: "modesetting"
That looks like for your Xorg config file you have a non-existant "ati" driver specified (get rid of that reference) and Xorg's default modesetting driver /usr/local/lib/xorg/modules/drivers/modesetting_drv.so is being loaded. This doesn't seem to work well with your HD 6450.

Your AMD HD 6450 is supported by radeon(4). Try, as stated there and also, per 5.4.3. Video Cards, creating a /usr/local/etc/X11/xorg.conf.d/20-radeon.conf with:
Code:
Section "Device"
    Identifier "Card0"
    Driver     "radeon"
EndSection
and remove any Section "Device" that has a reference to "ati" in a conf file there abouts.

Driver "radeon" references /usr/local/lib/xorg/modules/drivers/radeon_drv.so and is contained in package/port x11-drivers/xf86-video-ati/

Post your dmesg and Xorg log.
 
Oh my. I'm not sure what I've been using so far... Turns out I didn't have radeon_drv.so at all. Was I using an unaccelerated modesetting driver until now?

I had no Xorg configuration entries at all, and after adding it wouldn't start citing missing driver so I had to portmaster x11-drivers/xf86-video-ati.

For now everything's working as expected. I'll try checking a bit more to make sure it doesn't happen again and mark as solved.
Thanks!
 
… Your AMD HD 6450 is supported by radeon(4). Try, as stated there and also, per 5.4.3. Video Cards, creating a /usr/local/etc/X11/xorg.conf.d/20-radeon.conf …

Does x11-drivers/xf86-video-ati negate the need for manual configuration? Files include:

share/X11/xorg.conf.d/10-radeon.conf

The package is present in the BSD Hardware Database:
  • HW probe of MSI B75A-G43 Desktop Computer (MS-7758) #645c73853e
  • HW probe of Intel DP965LT AAD41694-210 Desktop Computer #90e9ba9d77
 
Was I using an unaccelerated modesetting driver until now?
Since the move to kernel modesetting, this is fine to use the modesetting driver (it is also accelerated). The usermode graphics drivers for Xorg have mostly been phased out. However in the case of amdgpu, radeon drivers they do provide some extra features, such as TearFree.

The unaccellerated ones are generally vesa (for BIOS) and scfb (for UEFI). These also tend to get warm (no power management) and also usually screw up suspend / resume unless your BIOS has been programmed "perfectly" by legendary gods and is 100% compliant.

But Xorg should "do the right thing" without config (but as you have noticed, sometimes the digital world isn't quite perfect!). Not sure if you have already done this, but usually it can help to kldload the GPU modesetting driver (these are named differently to Xorg drivers!) before starting X. That way you can help isolate which part of the stack is unhappy.
 
Does x11-drivers/xf86-video-ati negate the need for manual configuration? Files include:

share/X11/xorg.conf.d/10-radeon.conf
Either will work. In my experience the Driver "radeon" is what matters; further, xorg.conf(5):
Code:
DESCRIPTION
       Xorg uses a configuration file called xorg.conf and files ending    in the
       suffix .conf from the directory xorg.conf.d for its initial setup.
So, practically speaking, any interfering/conflicting conf file can easily be rendered harmless, for example by moving it to a local subdir, say ./tmp
 
I was keep using my system with drm-61-kmod after solving(?) the problem, and now it reoccurred.. I don't see anything weird in the logs, but X crashed again after attempting video fullscreen on firefox.
 

Attachments

Back
Top