kdm starts before nvidia driver is fully loaded

Bug #585930 reported by Antonio Barbuzzi on 2010-05-26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
kdebase-workspace (Ubuntu)

Bug Description

Binary package hint: kdm

After the boot, kdm tries to start before nvidia driver is fully loaded.
Looking in kern.log, nvidia module start to load, but it takes about 2 seconds to finish.
Meantime, kdm start and complains about a missing Nvidia kernel module.
After restarting X, everything works well, with the nvidia module properly working.

Hereafter kdm and kern log extracted and time sorted:

kern.log: NVIDIA: could not open the device file /dev/nvidiactl (No such device or address).
kern.log: 09:27:26 nvidia_bl: MacBookPro 5,4 detected
kern.log: 09:27:26 nvidia_bl: Nvidia graphics adapter 10de:0863 (106b:00ba) detected
kern.log: 09:27:26 nvidia: module license 'NVIDIA' taints kernel.

kdm.log: (EE) 09:27:27 NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the
kdm.log: (EE) 09:27:27 NVIDIA(0): system's kernel log for additional error messages and
kdm.log: (EE) 09:27:27 NVIDIA(0): consult the NVIDIA README for details.
kdm.log: (EE) NVIDIA(0): *** Aborting ***

kern.log: 09:27:28 nvidia 0000:00:03.5: PCI INT B -> Link[LPMU] -> GSI 21 (level, low) -> IRQ 21
kern.log: 09:27:28 nvidia: probe of 0000:00:03.5 failed with error -1
kern.log: 09:27:28 nvidia 0000:03:00.0: PCI INT A -> Link[LGPU] -> GSI 20 (level, low) -> IRQ 20
kern.log: 09:27:28 nvidia 0000:03:00.0: setting latency timer to 64

My nvidia module version is the lastest, 195.36.15. I suspect that the problems is related with upstart,
since it doesn't verify that the needed driver is fully loaded.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: kdm 4:4.4.2-0ubuntu14
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic
Uname: Linux 2.6.32-22-generic x86_64
NonfreeKernelModules: wl nvidia
Architecture: amd64
Date: Wed May 26 17:29:45 2010
EcryptfsInUse: Yes
 PATH=(custom, user)
SourcePackage: kdebase-workspace

Antonio Barbuzzi (antoniob82) wrote :

i have the same race-condition with gdm.
I'm still curious, whether the nvidia module initialization is triggered by kdm itself and then taking too long?
anyhow some sleep and retry in kdm/gdm's init script would do a great job !?

perhaps helpful:

editing /etc/init/gdm.conf and /etc/init/kdm.conf


start on (filesystem
          and started dbus
+ # and graphics-device-added /dev/nvidiactl PRIMARY_DEVICE_FOR_DISPLAY=1
+ # and graphics-device-added nvidia
+ and started module-init-tools
          and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or stopped udevtrigger))
one of the +-marked lines should help...

It worked for me with editing /etc/init/gdm.conf and /etc/init/kdm.conf and adding

and stopped module-init-tools

loking like this:

start on (filesystem
          and started dbus
          and stopped module-init-tools
          and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or stopped udevtrigger))

Antonio Barbuzzi (antoniob82) wrote :

I've tried your modification, but the problem still remains. I'm not sure about the cause, do you have any hint on how to debug the problem?
I'm testing if a 'sleep 2' before starting kdm works, I'll keep you update

Antonio Barbuzzi (antoniob82) wrote :

- adding a 2 seconds sleep before starting kdm, seems to work perfectly!
- adding stopped module-init-tools to /etc/init/kdm doesn't work;

it works for me any more too -- why ever it did once...

see also:

perhaps also something like this will help to get the sleep as short or long as really needed: ?

    export XORGCONFIG

    until ( lsmod | grep '^nvidia ' >/dev/null ); do sleep 1; done
    exec gdm-binary $CONFIG_FILE

somehow the until loops fails. Falling back to sleep 2...

i extract some log lines from /var/log/syslog -- i think showing the main problem, that gdm fails about 2 secs **before** the nvidia module is loaded.
Aug 31 21:43:22 sandra-nb kernel: [ 2.863035] EXT4-fs (sda3): mounted filesystem with ordered data mode
Aug 31 21:43:22 sandra-nb kernel: [ 18.001148] udev: starting version 151
Aug 31 21:43:22 sandra-nb kernel: [ 18.010245] Adding 2000052k swap on /dev/sda6. Priority:-1 extents:1 across:2000052k
Aug 31 21:43:22 sandra-nb kernel: [ 18.109035] vga16fb: initializing
Aug 31 21:43:22 sandra-nb kernel: [ 18.109040] vga16fb: mapped to 0xffff8800000a0000
Aug 31 21:43:22 sandra-nb kernel: [ 18.109106] fb0: VGA16 VGA frame buffer device
Aug 31 21:43:22 sandra-nb kernel: [ 18.113579] lp: driver loaded but no devices found
Aug 31 21:43:22 sandra-nb kernel: [ 18.632373] nvidia: module license 'NVIDIA' taints kernel.
Aug 31 21:43:22 sandra-nb init: gdm main process (875) terminated with status 1
Aug 31 21:43:24 sandra-nb kernel: [ 23.472888] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 195.36.24 Thu Apr 22 19:10:14 PDT 2010

helpful link:

Rolf Bensch (rolfbensch) wrote :

This is a duplicate of bug #459639.

Robert, your comment #9 shows the main problem. vga16 and nvidia use the same frame buffer device /dev/fb0 during boot up (see: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/459639/comments/52).

With this the start conditions in kdm.conf for the graphics device doesn't work if nvidia kernel driver isn't loaded or is still loading.

This problem does not only affect nvidia kernel drivers. I think this is an essential problem of startup.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kdebase-workspace (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers