Solved Xorg stopped working after pkg upgrade...

I am running FreeBSD 13.2p0 on a Lenovo ThinkPad W520 with an i7-2760QM CPU @ 2.40GHz, 16GB of RAM, and the following video cards (I think it is one of those optimus setups, but I'm not sure)

Code:
vgapci1@pci0:0:2:0:     class=0x030000 rev=0x09 hdr=0x00 vendor=0x8086 device=0x0126 subvendor=0x17aa subdevice=0x21d1
    vendor     = 'Intel Corporation'
    device     = '2nd Generation Core Processor Family Integrated Graphics Controller'
    class      = display
    subclass   = VGA
   
vgapci0@pci0:1:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x0dfa subvendor=0x17aa subdevice=0x21d1
    vendor     = 'NVIDIA Corporation'
    device     = 'GF108GLM [Quadro 1000M]'
    class      = display
    subclass   = VGA

As I said, I am running 13.2p0, and am on the "latest" repo. Everything was running fine. Last night, I ran a
Code:
bectl create
and created a BeforeUpgrade BE, then did the update. When the system came back up, I got no gui/Xorg. I did have to install libxklavier in the new BE after the upgrade, but everything else was version bumps.

Code:
[storm@danube ~]$ grep EE /var/log/Xorg.0.log
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  5656.018] (EE) Failed to load module "intel" (module does not exist, 0)
[  5656.020] (EE) Failed to load module "scfb" (module does not exist, 0)
[  5656.062] (EE) 
[  5656.062] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all fram
ebuffer devices
[  5656.062] (EE) 
[  5656.062] (EE) 
[  5656.062] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional in
formation.
[  5656.062] (EE)
[  5656.080] (EE) Server terminated with error (1). Closing log file.

If I boot back into the previous BE, it works fine. I get X and my KDE session. I do see that xorg-server got a bump from 21.1.8_1,1 to 21.1.8_2,1. Is there something in that update (that maybe got deprecated/removed) that could have affected this rather old laptop? I did the same upgrade at the same time on my desktop machine, which is an i7-6850k with 32GB RAM and an nVidia RTX3060Ti, and it is working perfectly, even post-upgrade.

Any thought/ideas?

Thanks,
--vr
 
The logs indicate an issue with loading drm modules. Try checking if the modules were loaded upon boot. If they aren't loaded, load them then invoke startx to trigger your display manager or window session. If they are loaded, I'd try updating them first then repeat the second step. Specific builds of drm correspond to different versions of base; I'd probably guess that what's been borked. If you start twm though, the issue most likely isn't X.org.
 
If you are using i915kms you may need to explicitly upgrade drm-kmod and then kldunload i915kms && kldload i915kms before starting x.
 
If you are using i915kms you may need to explicitly upgrade drm-kmod and then kldunload i915kms && kldload i915kms before starting x.

Which driver were you using before the upgrade?
I had both the nvidia.ko and the i915kms drivers loaded...Because lately I have noticed that watching video in the browser (youtube or twitch) will drive my laptop to it's knees...
 
  • Like
Reactions: mer
What did you upgrade exactly: only packages, or also the base system?
Just the packages. I did the 13.2 upgrade on 4/13/2023...Now could this be due to the 3-month-grace-period between 13.2's release and 13.1's retirement, similar to the problem with the vboxdrv.ko not working after a point-release upgrade? I'm guessing not, since it seemed to be working after the freebsd-upgrade to 13.2...
 
Check your permissions, they might change after an upgrade:

<username> groups

Xorg user should be in the `video` group. `wheel` and `operator` are most often handy too.

# pw groupmod <username> -G <group_name>
 
Check your permissions, they might change after an upgrade:

<username> groups

Xorg user should be in the `video` group. `wheel` and `operator` are most often handy too.

# pw groupmod <username> -G <group_name>
I my user was in video and wheel groups, but not operator, but I have since added it.

And since Xorg.0.log was complaining that it couldn't find the intel X driver, even though it was not installed on the working (earlier) BE, I installed xf86-video-intel (which also installed libXvMC). That got rid of the missing intel driver error, but is still giving me

Code:
[   637.531] (EE) open /dev/dri/card0: No such file or directory

I found a thread with a guy getting the same error on a FBSD 12.0 box. The recommendation was to uninstall the drm-fbsd12.0-kmod and make install clean from ports. Tried uninstalling and reinstalling drm-kmod, and didn't work.

I have also rechecked my package list, and the only differences between before and after are version bumps. No packages were added or removed.
 
I had both the nvidia.ko and the i915kms drivers loaded...Because lately I have noticed that watching video in the browser (youtube or twitch) will drive my laptop to it's knees...
Yeah, I think that's par for the course for the Quadro 1000M. I have the same card. Works better using Chromium, but particularly on FreeBSD using Youtube on Firefox it will boil or segmentation fault on simple 3D applications.

Your issue does sound like a kernel module issue. I'm not overly sure that the Quadro 1000M works in an Optimus-type configuration, but I could be wrong.
 
Yeah, I think that's par for the course for the Quadro 1000M. I have the same card. Works better using Chromium, but particularly on FreeBSD using Youtube on Firefox it will boil or segmentation fault on simple 3D applications.

Your issue does sound like a kernel module issue. I'm not overly sure that the Quadro 1000M works in an Optimus-type configuration, but I could be wrong.
Probably not, since the W520s are, what, 12 years old?
 
Okay, quick follow-up. I got sidetracked with other things, and am just getting back around to looking in to this. I also thought that if it was a a package that was broken in the repos. I did another upgrade, and got the same behavior. However I am wondering if it may be something lower in the stack than the X server. These are the steps I took:

Code:
# bectl create BeforeUpgrade-${TODAY}
# pkg update
# pkg upgrade
<600 plus packages upgraded successfully>
Log out of X.

Instead of kicking me back to the PCDM login screen, I end up on VT1 and cannot start X. Now something else that happens is that once it kicks me out into the VT, my mouse pointer flickers on screen, if I hit the caps lock the green light on the key flickers in time with it (instead of being on solid), and when I try to type, I will get about 60% of the characters I type, and the shift key sometimes works and sometimes doesn't. I am still looking. Unfortunately, I am not sure where to start looking at the lower level stuff. I have checked the logs (Xorg.0.log and Xorg.1.log, etc) and am also doing a comparison of dmesg between the good boot and the bad boot.

The dmesg for the working boot environment is at https://controlc.com/315515d5, and the diff between the working and broken one is at
The Xorg.0.log for the working BE is at https://controlc.com/01f8e233 and the diff between the work and broken is at https://controlc.com/5aae1def

Does anyone see anything that I am overlooking?

Thanks again,
--vr
 
Does anyone see anything that I am overlooking?

In my experience, no X mostly is caused by
  1. missing permissions for the user in the wheel or video group;
  2. not installed module for your graphical card, or;
  3. wrong/old/missing lines in config files on boot.
Some things to look further in:

Code:
>  (II) LoadModule: "intel"
>  (WW) Warning, couldn't open module intel
>  (EE) Failed to load module "intel"

Is there something wrong with pointing to your graphical card?

Don't know if you do regular update/upgrade, but the name of the module to be installed could have changed and/or calling the module from your /boot/loader.conf or /ect/rc.conf might need something different.

Do you have this line in your /etc/rc.conf:

kld_list="${kld_list} i915kms"

The previous line from some time ago was `kld_list="/boot/modules/i915kms.ko"`, but that doesn't work anymore or only in a different setup.

Further:

Code:
<  (II) UnloadModule: "vesa"
<  (II) Unloading vesa

Mixing VESA and Intel modules for your display can cause trouble. If you have an Intel card use that and don't install/use/call VESA.
 
Okay, I figured out the problem. Back in the mists of time, I set the laptop to use the integrated card (intel). At some point, the OS optimus detection got re-enabled, which confused the laptop and also forced optimus to be selected each boot.

I ended up going into BIOS, and in Config -> Display, setting Graphics Device -> Integrated and OS Detection for Optimus -> Disabled

Thanks for all of the great suggestions, as they prodded me in the right direction.
--vr
 
Back
Top