# How I fixed all my Nvidia problems

## marcus_cps

Hi there.

Sick of having trouble with nvidia kernel and glx, I decided to try Nvidia official driver 1.0.8178.

I run:

```
./NVIDIA-Linux-x86-1.0-8178-pkg1.run
```

Followed the steps (that you can't change)...

After that, I just changed /etc/X11/xorg.cof this way:

From this:

```
Screen "Screen 1"
```

To this:

```
Screen "Screen 1" 0 0
```

But I thing it does nothing.

So... everything works fine now.

Considering what happened, I believe something is wrong with nvidia-kernel or nvidia-glx ebuild.

----------

## niskel

um... the ebuild uses NVIDIA-Linux-x86-1.0-8178-pkg1.run and such anyways, you are just doing what the ebuild does, just outside of portage and outside of proper package management which causes more problems than you are saving yourself.

----------

## Suicidal

Whenever I have had problems I just rm -rf /lib/modules/* , and then recompile the kernel and modules.

Ever since I wrote a script for updating my kernel, and everything that directly depends on virtual/linux-sources I never have problems with nvidia, alsa or similar kernel modules on any of my gentoo boxes.

----------

## marcus_cps

I know ebuild does the same.

But it works this way and doesn't works with emerge!

Why? I'd really like to know.

Anybody knows?

----------

## dsd

you should start by explaining your problem or linking to a thread where you have already done so

----------

## marcus_cps

ok. Here I go.

I was using nvidia driver and everything was going fine.

So I upgraded my kernel from 2.6.9 to 2.6.15. By the way, I did "make oldconfig" and made no option change. I've already upgraded kernel once and I had no problems, even with nvidia.

And them my problems started.

After compile my new kernel, I made unmerge nvidia-kernel and nvidia-glx.

So I did emerge nvidia-glx again.

No problems until now. It goes fine.

There was no need to modify my xorg.conf because everything was working before.

When I try startx, screen goes black, changes a little but still black.

Sometimes I can see the cursor blinking in the top and my system aparently freezes. But not the entire system, just the screen. I typed CTRL ALT DEL and the system restarted normaly as if I typed "telinit 6".

Othertimes the cursor doesn't appears...

So I did unmerge again and installed nvidia driver by hand and everything works. I don't even changed a single conf file!

Thats it.

I can send my conf files if someone wants it.

I think thats it.

----------

## marcus_cps

I forgot: After everything, I tryed to emerge nvidia again. (Just in case that some conf file was changed). Same problems. So I got back to my by hand installed driver. And again, everything worked fine.

----------

## niskel

every time you change your kernel, you must remerge nvidia-kernel as this package builds to the kernel linked to in /usr/src/linux. This being said, when you compile a new kernel, you have to remake the linux symlink to point to the sources of that kernel.

----------

## marcus_cps

Yes... I did it.

----------

## niskel

There are two packages, "nvidia-kernel" and "nvidia-glx". You said you remerged "nvidia-glx" but you made no mention of remerging "nvidia-kernel". Also, did you remake the symlink to the proper kernel sources?

----------

## marcus_cps

Yes... I did it.

When you emerge nvidia-glx, nvidia-kernel is automaticaly emerged.

But I tried too. Emerge nvidia-kernel and after this emerge nvidia-glx.

The link is right (/usr/src/linux pointing to /usr/src/linux-2.6.15-r1).

I did everything this way:

-> uncompressed kernel source and copy .config from the last kernel used.

-> ln -s /usr/src/linux-2.6.15-r1 /usr/src/linux (I don't remember the right syntax, but the link is right).

-> kernel configuring (make oldconfig).

-> kernel compiling and copy relevant files to /boot.

-> modules compiling and installing.

-> update grub information

-> emerge nvidia-kernel

-> emerge nvidia-glx

-> make changes in /etc/X11/xorg.conf (if needed).

-> modprobe nvidia

-> startx

If I haven't forgot something, is everything here.

----------

## dsd

can you show the mouse section of your /etc/X11/xorg.conf file?

also, which version of nvidia-kernel and nvidia-glx are you using from portage?

did you remember to "opengl-update nvidia" after re-merging nvidia-glx?

----------

## jonnevers

 *marcus_cps wrote:*   

> Yes... I did it.
> 
> When you emerge nvidia-glx, nvidia-kernel is automaticaly emerged.
> 
> 

 

not on my system

```
blue user # emerge -pv nvidia-glx

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] media-video/nvidia-glx-1.0.8178  -dlloader 0 kB

Total size of downloads: 0 kB

blue user #
```

and the advise for nvidia-kernel and nvidia-glx is always use the ~ARCH versions.

----------

## danyer

 *marcus_cps wrote:*   

> 
> 
> I did everything this way:
> 
> -> uncompressed kernel source and copy .config from the last kernel used.
> ...

 

You should have rebooted after emerging the new kernel. Nvidia kernel will link with the currently running kernel.

I think you did it anyway, but just to be sure...

Dan.

----------

## ebichu

 *danyer wrote:*   

> You should have rebooted after emerging the new kernel. Nvidia kernel will link with the currently running kernel.
> 
> I think you did it anyway, but just to be sure...

 

The Gentoo standard is to build external kernel module packages against whatever is in /usr/src/linux, not against the currently running kernel. If the nvidia-kernel ebuild doesn't do that it's a bug!

----------

## niskel

Either way, you would need to reboot for 1) the kernel to take effect 2) for the modules to work because they were compiled against that kernel. But yes, the process should be: Link sources, make/install kernel, make/install modules, reboot.

----------

## dsd

theres no need to reboot if /usr/src/linux points to your currently running kernel (as opposed to a brand new kernel which you have just compiled and are preparing to boot into)

compiling external kernel modules does not modify the kernel image in any way.

----------

## niskel

*edit misunderstood*

dsd, this is true, but the OP was saying that his problem occured when he upgraded his kernel, so in the situation that the kernel is being upgraded, you would want to recompile your modules and then reboot.

----------

## marcus_cps

 *jonnevers wrote:*   

>  *marcus_cps wrote:*   Yes... I did it.
> 
> When you emerge nvidia-glx, nvidia-kernel is automaticaly emerged.
> 
>  
> ...

 

Yes... I was wrong. But I did emerge nvidia-kernel and after this, emerge nvidia-glx.

----------

## marcus_cps

 *dsd wrote:*   

> can you show the mouse section of your /etc/X11/xorg.conf file?
> 
> also, which version of nvidia-kernel and nvidia-glx are you using from portage?
> 
> did you remember to "opengl-update nvidia" after re-merging nvidia-glx?

 

I think I did it, but I will try emerging again and I'll do it.

My mouse section if fine. I'm using it now. But here it is:

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "ExplorerPS/2"

    Option "Device"      "/dev/input/mice"

    Option "Buttons"     "5"

    Option "ZAxisMapping"    "4 5"

----------

## pteppic

There is a difference between the nvidia.run package and the ebuilds.

The nvidia.run package overwrites the xorg-x11 gl libraries with its's own.

The ebuild doesn't, and you switch to the nvidia glx libs with 

```
eselect opengl set nvidia
```

If by chance the nvidia.run and the nvidia-kernel package you installed are the same version it may work, but in my experiance your xorg-x11 opengl libraries are now borked.

----------

## marcus_cps

 *pteppic wrote:*   

> There is a difference between the nvidia.run package and the ebuilds.
> 
> The nvidia.run package overwrites the xorg-x11 gl libraries with its's own.
> 
> The ebuild doesn't, and you switch to the nvidia glx libs with 
> ...

 

Interesting... So I was right! nvidia.run is not the same as emerge nvidia-kernel and glx packages.

So, considering that nvidia.run and nvidia-kernel package are the same version (8178), what should I do to make it work using emerge instead of nvidia.run? Can you help me?

Thanks so much!

----------

## pteppic

```
eselect opengl set nvidia
```

Should do it, if it works ignore the fact the xorg libs are 'broken', and be sure they will be updated in the future with an emerge -uDNav world, or re-emerge mesa to fix them now (be sure to run eselect opengl set nvidia again after the emerge)

----------

## bernard604

I am having a similar problem, when I run

```

eselect opengl set nvidia

```

I get back

!!! Error Can't load module opengl

This was done after doing a

```

opengl-update nvidia

```

with no apparent problems.

I can only get opengl using Mesa, I can't use my nvidia card.

----------

## peka

my $0,02...

... every time I recompile kernel or upgrade nividia driver I:

1) make sure that kernel symlink is in place and pointing to propre kernel sources

2) re-emerge nvidia-kernel

3) run modules-update

and everything is A-OK

----------

## bernard604

I fixed my problem by realizing that I still had the 

Option Composite Enabled

set in my xorg.conf file. I had it set to experiment with translucency.

Nvidias GLX will not work with composite enabled in the version I have installed

----------

## johol

 *marcus_cps wrote:*   

> ok. Here I go.
> 
> I was using nvidia driver and everything was going fine.
> 
> So I upgraded my kernel from 2.6.9 to 2.6.15. By the way, I did "make oldconfig" and made no option change. I've already upgraded kernel once and I had no problems, even with nvidia.
> ...

 

I got identical problems when I tried to upgrade to the 2.6.15 kernel from 2.6.13.

See https://forums.gentoo.org/viewtopic-p-3189533.html#3189533 for what my Xorg.0.log and xorg.conf filles looks like.

My problems went away when I upgraded the nvidia drivers to the masked 1.0.8178-r3 version of nvidia-kernel and nvidia-glx. Unfortunately this has at least the side effect that all font sizes are too small. When I run xdpyinfo I get this

```
$ xdpyinfo | grep -B1 dot

  dimensions:    1600x1200 pixels (564x423 millimeters)

  resolution:    72x72 dots per inch

$
```

which gives the wrong dimensions. My monitor is 360x220 millimeters and not 564x423 which in turn gives a DPI of 113 x 113. I'll try modifying the nvidia DPI option as described here http://www.mepislovers-wiki.org/index.php?title=Quick_Fixes_for_KDE_3.4.2_upgrade to see if that solves the problem.

----------

## johol

Setting the nividia DPI setting to the DPI I calculated (however the way the MEPIS page describes it gives the wrong value, you have to calculate it using the physical size of the monitor screen, i.e. <X_resolution> * 25.4 / <width_in_mm> and <Y_resolution> * 25.4 / <height_in_mm) which solves the font size problem.  :Smile: 

----------

## marcus_cps

Voila!!!!

Finally I could make it work!

"eselect opengl set nvidia" wasn't workin with v1.0-8178 (i don't know why...)

It says that no module called opengl was found (exactly the same as a friend already told here).

So, what i did:

```
./NVIDIA-Linux-x86-1.0-8178-pkg1.run --uninstall
```

```
emerge --unmerge nvidia-kernel nvidia-glx
```

(just to garantee)

```
emerge opengl
```

 (don't know if it is needes, but I did it)

Insert this lines in /etc/portage/packages.mask:

```
>=media-video/nvidia-kernel-1.0.8178-r3

>=media-video/nvidia-glx-1.0.8178-r3
```

Insert this lines in /etc/portage/packages.keywords:

```
media-video/nvidia-glx ~x86

media-video/nvidia-kernel ~x86

app-admin/eselect-opengl ~x86
```

```
eselect opengl set nvidia
```

 (now it worked)

So... everything is fine now! Even the font size is ok (no need to change DPI, etc)...

Thanks so much for everybody.

----------

