# udev and nvidia

## Gogiel

I compiled the latest 2.6.11.8 kernel without devfs, because i wanted to migrate to udev.

But I've got problem with nvidia drivers. 

I remerged nvidia-glx and nvidia-kernel. Nvidia module loads fine, but it doesn't create /dev/nvidia0 and /dev/nvidiactl, so X.org can't start.

udev-045

nvidia 7174

----------

## moocha

Do you have an /etc/modules.d/nvidia file? Should contain the following:

```
# Nvidia drivers support

alias char-major-195 nvidia

alias /dev/nvidiactl char-major-195

# To tweak the driver the following options can be used, note that

# you should be careful, as it could cause instability!! For more

# option see /usr/share/doc/nvidia-kernel-1.0.6111-r3/README.gz

#

#   To enable Side Band Adressing:  NVreg_EnableAGPSBA=1

#

#   To enable Fast Writes: NVreg_EnableAGPFW=1

#

# To enable both for instance, uncomment following line:

#

#options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1
```

If you had to create it, don't forget to also run modules-update.

If that still doesn't fix it, create the static nodes as a workaround:

```
mknod /dev/nvidiactl c 195 255

mknod /dev/nvidia0 c 195 0

chown root:video /dev/nvidia{ctl,0}

chmod 0660 /dev/nvidia{ctl,0}
```

----------

## thegazer

This solution works but after a reboot I have to do that again.. help please?

----------

## captain_android

Upgrade to udev-056 and the devices should be created properly at boot.

There was a perl scipt at some point in the past to fix this problem in earlier udev versions.

Something like "NVcreatedevices.pl". Been so long since I needed it I can't remember exactly.

----------

## thegazer

actually, I am using udev-056

I'll try to re-emerge and reboot

----------

## moocha

No need to reboot - just run

```
udevstart
```

after emerging udev again. But I wouldn't count on it working then if you're already running 056. Did you by any chance turn off the device tarball in /etc/conf.d/rc?

----------

## thegazer

yes.. err should I turn it on?

EDIT: kewl it works now, thanks heaps!

----------

## soulfire

to workaround the problem i put this

```
mknod /dev/nvidiactl c 195 255 

mknod /dev/nvidia0 c 195 0 

chown root:video /dev/nvidia{ctl,0} 

chmod 0660 /dev/nvidia{ctl,0}
```

in a script and then i edited the /etc/conf.d/local.start to execute that script everytime i boot.

----------

## Gogiel

Thanks for tips, but I still can't resolve one problem. 

X start ok (log: http://phpfi.com/63254 ), but I can't run any aterm, xterm, konsole etc.

When i startx as a root everything works ok, nor as as user.

----------

## capone007

hi,

got a similar problem. 

when i try to load the nvidia module (in my udev only gentoo) it fails with an error

```

unknown symbol in module

```

and dmesg says

```

nvidia: unknown symbol devfs_mk_cdev

nvidia: unknown symbol devfs_remove

```

seems to be an udev problem. somebody knows a solution?  :Sad: 

----------

## Gogiel

 *capone007 wrote:*   

> hi,
> 
> got a similar problem. 
> 
> when i try to load the nvidia module (in my udev only gentoo) it fails with an error
> ...

 

Are you suer you are running udev kernel (I had same problem, because i forgot to write 'lilo')

----------

## capone007

yeah i´m pretty sure...dont have devfs in my kernel...so it is udev, isnt it?  :Question: 

----------

## Gogiel

Did you do:

```
emerge -e nvidia-kernel
```

??

EDIT:

I resolved my problem by adding my user to group: console

----------

## moocha

If you get missing devfs symbols running a non-devfs (hence udev, yes) kernel, that means you forgot to re-emerge the nvidia-kernel package after removing devfs support from the kernel and recompiling.

Note that portage doesn't (yet) automagically re-emerge the packages that provide kernel modules each time it detects a kernel change. You have to do it manually. You can do it for example with a little script along the lines of:

```
#!/bin/bash

KVERSION="${1:-$(uname -r)}"

equery --nocolor belongs /lib/modules/${KVERSION}|grep -v "Searching for file"|awk '{print "="$1}'
```

You can pipe the output directly to emerge.

----------

## lyonsd

 *moocha wrote:*   

> Do you have an /etc/modules.d/nvidia file? Should contain the following:
> 
> ```
> # Nvidia drivers support
> 
> ...

 

It said the files already exist when I tried that.

Here's my problem...

Whenever I build a new kernel, I have to run this script I downloaded to get X working.  The script is called NVIDIA-Linux-x86-1.0-6629-pkg1.run and I got it from the nvidia web site (I think).  When it's run, it attempts to download a module for your kernel and if not successful, it builds one.  Since I went to kernel-2.6.12-gentoo it fails to build a new module.  This is the error I get when it attempts to build a new module:

```

ERROR: Unable to load the kernel module 'nvidia.lo'.  This is most likely because the kernel module was built using the wrong kernel source files.  Please make sure you have installed the kernel source files for your kernel.  If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' commandline option

```

I know the correct source is on the system and it's linked to /usr/src/linux.  Regardless, if I run the script and even use the command line option specidifed above, it still gives that message.

Looking at /var/log/nvidia-installer.log I see this:

```

-> Kernel module load error: insmod: error inserting './usr/src/nv/nvidia.ks': -1 Unknown symbol in module.

```

And a few lines down...

```

nvidia: Unknown symbol inter_module_get

```

Now when I try to start X, I get the followin g error:

```

# grep EE /var/log/Xorg.0.log

(EE) Failed to load module "speedo" (module does not exist, 0)

```

So I removed the "Load speedo" line form /etc/X11/xorg.conf

But when I attempt to start X, it still fails.  But there are no "EE" messages, just the following:

```

fatal server error:

Caught signal 11. Server aborting

```

WTF?

So I tried the following:

```

X -configure

X -config /root/xorg.conf.new

```

And I got the following errors:

```

(EE) NVIDIA(0): No modes remaining for display device DFP-0

(EE) NVIDIA(0): *** Aborting ***

(EE) Screen(s) found, but none have a usable configuration.

```

So I edited the /etc/X11/xorg.conf file and changed the line

```

Driver "nvidia"

```

to

```

Driver "nv"

```

And now it works!

However, I no longer get the "nvidia" screen immeidately prior to gdm taking over.  No big deal, I didn't care for that screen anyway.

But what a pain in the ass.  I spent hours on this and never touched the xorg.conf file prior to it screwing up.

----------

## moocha

 *lyonsd wrote:*   

> Whenever I build a new kernel, I have to run this script I downloaded to get X working.  The script is called NVIDIA-Linux-x86-1.0-6629-pkg1.run and I got it from the nvidia web site (I think).

 That means you're not using Gentoo's package, which patches the driver for compatibility with newer kernels. Sorry, can't help you there, you're on your own.

----------

## GaDDiM

If you use Driver nv, you are not using nvidia's driver, but the open source one. One disadvantage of the nv driver is it poor performance.

----------

## lyonsd

What do I need to do to get the nvidia driver working?

----------

