Skip to contentSkip to conversation

udev vs nvidia

DISCUSSION Daniel Drake 3 participants 5 messages Feb 16, 2004 – Feb 26, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

Since switching to udev, I have had problems when starting X relating to nvidia drivers. I know this is a tricky situation, with the nvidia drivers being closed-source, nobody really knows how they work. If it seems likely that this problem is not udev-related, then please tell me, and I will go to nvidia instead.

I'm not sure if this is even anything to do with udev. The only reason I suspect udev might be involved, is because of the existance of /dev nodes seems to play a part.

I am running nvidia drivers version 5336 with Martin Schlemmer's patch applied to make them export info into sysfs.
If I manually "modprobe nvidia", then I can see that the /dev/nvidia0 and /dev/nvidiactl nodes are created. So at this stage it seems to be loaded.

Ignoring the above situation, on a normal bootup, the nvidia module is not loaded at the point where I "startx":

# ls /dev/nvidia*
no such file or directory
# startx
XFree86 Version 4.3.0
Release Date: 27 February 2003
[snip]
(=) Using config file: "/etc/X11/XF86Config"
Using vt 7
(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module!
(EE) NVIDIA(0):  *** Aborting ***
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

If I mknod the /dev/nvidia* nodes first, then X is able to start as normal. Also, strangely, if I "modprobe nvidia", and then "startx" then X starts as normal.

I believe that this problem comes around because the /dev nodes are not created quickly enough.

# modprobe nvidia && ls -l /dev/nv*
ls: /dev/nv*: No such file or directory
# rmmod nvidia
# modprobe nvidia && sleep 2 && ls -l /dev/nv*
crw-rw-rw-    1 root     video    195,   0 Feb 16 19:47 /dev/nvidia0
crw-rw-rw-    1 root     video    195, 255 Feb 16 19:47 /dev/nvidiactl

My theory is that X loads the "nvidia" module, and then immediately tries to initialize the display and whatever else. But as the nvidia* nodes arent in place, it dies.

I am running udev017 on linux 2.6.3-rc2-mm1

Any ideas?

cheers,

Daniel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 6 lines · claude

Is :

alias char-major-195* nvidia

present in your /etc/modules.conf ?

Yes, well, almost. Here's the relevant parts:

### modules-update: start processing /etc/modules.d/nvidia # Nvidia drivers support
alias char-major-195 nvidia
alias /dev/nvidiactl char-major-195

# Old nvidia support ...
alias char-major-195 NVdriver
alias /dev/nvidiactl char-major-195

Is the * on char-major-195* important here?

thanks.

Daniel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Daniel Drake
Quoted 2 lines · Daniel Drake

Hi,

Hi,

Quoted 19 lines

Since switching to udev, I have had problems when starting X relating to nvidia drivers. I know this is a tricky situation, with the nvidia drivers being closed-source, nobody really knows how they work. If it seems likely that this problem is not udev-related, then please tell me, and I will go to nvidia instead.

I'm not sure if this is even anything to do with udev. The only reason I suspect udev might be involved, is because of the existance of /dev nodes seems to play a part.

I am running nvidia drivers version 5336 with Martin Schlemmer's patch applied to make them export info into sysfs.
If I manually "modprobe nvidia", then I can see that the /dev/nvidia0 and /dev/nvidiactl nodes are created. So at this stage it seems to be loaded.

Quoted 8 lines

My theory is that X loads the "nvidia" module, and then immediately tries to initialize the display and whatever else. But as the nvidia* nodes arent in place, it dies.

I am running udev017 on linux 2.6.3-rc2-mm1

Any ideas?

Is :

alias char-major-195* nvidia

present in your /etc/modules.conf ?

Quoted 5 lines

cheers,

Daniel

Quoted 10 lines

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Daniel Drake

If anyone is interested, I have solved the below issue. It turns out that you are supposed to load the module before starting X (even nvidia say so), and devfs did this automatically on bootup. So, the nvidia module should be added to an autoload list, and this issue is not a fault of udev/hotplug.

Daniel

Quoted 51 lines · Daniel Drake

Hi,

Since switching to udev, I have had problems when starting X relating to nvidia drivers. I know this is a tricky situation, with the nvidia drivers being closed-source, nobody really knows how they work. If it seems likely that this problem is not udev-related, then please tell me, and I will go to nvidia instead.

I'm not sure if this is even anything to do with udev. The only reason I suspect udev might be involved, is because of the existance of /dev nodes seems to play a part.

I am running nvidia drivers version 5336 with Martin Schlemmer's patch applied to make them export info into sysfs.
If I manually "modprobe nvidia", then I can see that the /dev/nvidia0 and /dev/nvidiactl nodes are created. So at this stage it seems to be loaded.

Ignoring the above situation, on a normal bootup, the nvidia module is not loaded at the point where I "startx":

# ls /dev/nvidia*
no such file or directory
# startx
XFree86 Version 4.3.0
Release Date: 27 February 2003
[snip]
(=) Using config file: "/etc/X11/XF86Config"
Using vt 7
(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module!
(EE) NVIDIA(0):  *** Aborting ***
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

If I mknod the /dev/nvidia* nodes first, then X is able to start as normal. Also, strangely, if I "modprobe nvidia", and then "startx" then X starts as normal.

I believe that this problem comes around because the /dev nodes are not created quickly enough.

# modprobe nvidia && ls -l /dev/nv*
ls: /dev/nv*: No such file or directory
# rmmod nvidia
Quoted 8 lines
# modprobe nvidia && sleep 2 && ls -l /dev/nv*
crw-rw-rw-    1 root     video    195,   0 Feb 16 19:47 /dev/nvidia0
crw-rw-rw-    1 root     video    195, 255 Feb 16 19:47 /dev/nvidiactl

My theory is that X loads the "nvidia" module, and then immediately tries to initialize the display and whatever else. But as the nvidia* nodes arent in place, it dies.

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Daniel Drake
Quoted 53 lines · Daniel Drake

If anyone is interested, I have solved the below issue. It turns out that you are supposed to load the module before starting X (even nvidia say so), and devfs did this automatically on bootup. So, the nvidia module should be added to an autoload list, and this issue is not a fault of udev/hotplug.

Daniel

Quoted 36 lines · Daniel Drake

Hi,

Since switching to udev, I have had problems when starting X relating to nvidia drivers. I know this is a tricky situation, with the nvidia drivers being closed-source, nobody really knows how they work. If it seems likely that this problem is not udev-related, then please tell me, and I will go to nvidia instead.

I'm not sure if this is even anything to do with udev. The only reason I suspect udev might be involved, is because of the existance of /dev nodes seems to play a part.

I am running nvidia drivers version 5336 with Martin Schlemmer's patch applied to make them export info into sysfs.
If I manually "modprobe nvidia", then I can see that the /dev/nvidia0 and /dev/nvidiactl nodes are created. So at this stage it seems to be loaded.

Ignoring the above situation, on a normal bootup, the nvidia module is not loaded at the point where I "startx":

# ls /dev/nvidia*
no such file or directory
# startx
XFree86 Version 4.3.0
Release Date: 27 February 2003
[snip]
(==) Using config file: "/etc/X11/XF86Config"
Using vt 7
(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module!
(EE) NVIDIA(0):  *** Aborting ***
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

If I mknod the /dev/nvidia* nodes first, then X is able to start as normal. Also, strangely, if I "modprobe nvidia", and then "startx" then X starts as normal.

I believe that this problem comes around because the /dev nodes are not created quickly enough.

# modprobe nvidia && ls -l /dev/nv*
ls: /dev/nv*: No such file or directory
Quoted 8 lines
# rmmod nvidia
# modprobe nvidia && sleep 2 && ls -l /dev/nv*
crw-rw-rw-    1 root     video    195,   0 Feb 16 19:47 /dev/nvidia0
crw-rw-rw-    1 root     video    195, 255 Feb 16 19:47 /dev/nvidiactl

My theory is that X loads the "nvidia" module, and then immediately tries to initialize the display and whatever else. But as the nvidia* nodes arent in place, it dies.

Quoted 9 lines

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

here is a solution :

jlm@Sorcerer:~$ cat /etc/udev/nvidia.sh
#!/bin/sh
mknod /dev/nvidia0 c 195 0 -m a+rw
mknod /dev/nvidia1 c 195 1 -m a+rw
mknod /dev/nvidia2 c 195 2 -m a+rw
mknod /dev/nvidia3 c 195 3 -m a+rw
mknod /dev/nvidia4 c 195 4 -m a+rw
mknod /dev/nvidia5 c 195 5 -m a+rw
mknod /dev/nvidia6 c 195 6 -m a+rw
mknod /dev/nvidia7 c 195 7 -m a+rw
mknod /dev/nvidiactl c 195 255 -m a+rw
jlm@Sorcerer:~$ cat  /etc/modprobe.conf
install ppp_generic     mknod /dev/ppp c 108 0 -m 0666 && modprobe --ignore-install ppp_generic;
install         nvidia                  /etc/udev/nvidia.sh && modprobe --ignore-install nvidia;
[...]

note that the same issue occurs with pppd