Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nvidia guide conflicts with X Server Configuration Document
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Thu Oct 04, 2012 11:54 pm    Post subject: Nvidia guide conflicts with X Server Configuration Document Reply with quote

In the X Server Configuration it states:

Quote:
The X server is designed to work out-of-the-box, with no need to manually edit Xorg's configuration files. It should detect and configure devices such as displays, keyboards, and mice.

You should first try starting X without editing any configuration files. If Xorg won't start, or there's some other problem, then you'll need to manually configure Xorg as shown in the next section.


Mine started, I then began to look into setting up my nvidia card using the Nvidia guide, and ran accross this:

Quote:
Once the appropriate drivers are installed you need to configure your X Server to use the nvidia driver instead of the default nv driver.

Open /etc/X11/xorg.conf with your favorite editor (such as nano or vim) and go to the Device section. In that section, change the Driver line:


But wait.... I didn't need to configure xorg.conf.... I don't even have one.

Do I go through the trouble of configuring one now? Or is there a better way to get the nvidia driver used?[/quote]
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Oct 05, 2012 12:01 am    Post subject: Reply with quote

With blob you need minimal xorg.conf

Code:
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
EndSection


This should do, unless you have multiple displays.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Oct 05, 2012 12:05 am    Post subject: Reply with quote

Say you have nouveau, nvidia driver, nv and vesa driver

All of those drivers are able to run on your card : so without any xorg.conf you will have xorg working, as it will basically try all of them and use the first that work.

But if you want configure your nvidia to use the nvidia driver, if you don't tell it in xorg.conf, you won't be sure it's the one in use.

As simple as that, and you can gave plenty nvidia driver options in it.
So both docs are correct.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2506
Location: Silver City, NM

PostPosted: Fri Oct 05, 2012 12:35 am    Post subject: Reply with quote

krinn wrote:
Say you have nouveau, nvidia driver, nv and vesa driver

All of those drivers are able to run on your card : so without any xorg.conf you will have xorg working, as it will basically try all of them and use the first that work.

My experience has been very different from this on all the machines I've tried. If the nouveau driver is on the machine then it will take over early in the boot process which usually renders all my virtual consoles unreadable. Since it takes over so early, you can't unload it so you can't try other drivers. IMO this is a huge pain. You need to use special boot parameters in order to avert this hostile takeover in order to even get a chance to try other drivers.

I'm surprised by such rude behavior from Free (as in freedom) software.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Oct 05, 2012 12:39 am    Post subject: Reply with quote

BitJam wrote:
krinn wrote:
Say you have nouveau, nvidia driver, nv and vesa driver

All of those drivers are able to run on your card : so without any xorg.conf you will have xorg working, as it will basically try all of them and use the first that work.

My experience has been very different from this on all the machines I've tried. If the nouveau driver is on the machine then it will take over early in the boot process which usually renders all my virtual consoles unreadable. Since it takes over so early, you can't unload it so you can't try other drivers. IMO this is a huge pain. You need to use special boot parameters in order to avert this hostile takeover in order to even get a chance to try other drivers.

I'm surprised by such rude behavior from Free (as in freedom) software.

You are talking about Gentoo experience? Without genkernel?
Frankly, I do not see how this could happen with manually configured kernel.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2506
Location: Silver City, NM

PostPosted: Fri Oct 05, 2012 1:03 am    Post subject: Reply with quote

Jaglover wrote:
You are talking about Gentoo experience? Without genkernel?

Yes and yes.

It has to do with KMS (Kernel Mode Setting). The default behavior is for nouveau to take control of the virtual consoles very early in the boot process, ignore any vga=xxx, setting and put the virtual consoles in the highest resolution supported by the video card. This often makes the displays unreadable sometimes by losing sync and other times because it selects by default the smallest font possible.

By this time, processes are depending on the nouveau module so it can't be unloaded. Since it can't be unloaded it blocks loading of the nvidia module and perhaps also the nv driver.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Oct 05, 2012 8:39 am    Post subject: Reply with quote

I don't know BitJam i never tried nouveau, but my start with "Say you have" imply an hypothesis, and it was there to proof why you must write xorg.conf to tell it to use nvidia driver.

For the correctness, i will just assume you are right. Forgive the shortcut i tooked.
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Fri Oct 05, 2012 9:31 am    Post subject: Reply with quote

Jaglover wrote:
With blob you need minimal xorg.conf

Code:
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
EndSection


This should do, unless you have multiple displays.


That did not work, here's the error log:

Code:
[ 39133.889] (II) LoadModule: "glx"
[ 39133.890] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[ 39133.906] (II) Module glx: vendor="NVIDIA Corporation"
[ 39133.906]    compiled for 4.0.2, module version = 1.0.0
[ 39133.906]    Module class: X.Org Server Extension
[ 39133.906] (II) NVIDIA GLX Module  304.51  Tue Sep 18 17:38:06 PDT 2012
[ 39133.906] Loading extension GLX
[ 39133.906] (II) LoadModule: "nvidia"
[ 39133.906] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
[ 39133.907] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 39133.907]    compiled for 4.0.2, module version = 1.0.0
[ 39133.907]    Module class: X.Org Video Driver
[ 39133.960] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
[ 39133.960] (EE) NVIDIA:     system's kernel log for additional error messages.
[ 39133.960] (II) UnloadModule: "nvidia"
[ 39133.960] (II) Unloading nvidia
[ 39133.960] (EE) Failed to load module "nvidia" (module-specific error, 0)
[ 39133.960] (EE) No drivers available.
[ 39133.960]
Fatal server error:
[ 39133.960] no screens found
[ 39133.960] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[ 39133.960] (EE) Please also check the log file at "/var/log/Xorg.1.log" for additional information.
[ 39133.960] (EE)


I have the nvidia-drivers package installed also.
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Oct 05, 2012 9:49 am    Post subject: Reply with quote

You have nvidia framebuffer loaded?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Fri Oct 05, 2012 10:08 am    Post subject: Reply with quote

Jaglover wrote:
You have nvidia framebuffer loaded?


In the kernel, no. All I have enabled as far as framebuffers go is:

Code:
EFI-based Framebuffer Support

_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Oct 05, 2012 1:46 pm    Post subject: Reply with quote

Code:
[ 39133.960] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
[ 39133.960] (EE) NVIDIA:     system's kernel log for additional error messages.


How about follow the advise given ?
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Fri Oct 05, 2012 9:34 pm    Post subject: Reply with quote

krinn wrote:
Code:
[ 39133.960] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
[ 39133.960] (EE) NVIDIA:     system's kernel log for additional error messages.


How about follow the advise given ?


Code:
Oct  5 17:33:03 shark kernel: [43613.425569] NVRM: No NVIDIA graphics adapter probed!
Oct  5 17:33:03 shark kernel: [43613.462498] NVRM: The NVIDIA probe routine was not called for 1 device(s).
Oct  5 17:33:03 shark kernel: [43613.462500] NVRM: This can occur when a driver such as nouveau, rivafb,
Oct  5 17:33:03 shark kernel: [43613.462501] NVRM: nvidiafb, or rivatv was loaded and obtained ownership of
Oct  5 17:33:03 shark kernel: [43613.462502] NVRM: the NVIDIA device(s).
Oct  5 17:33:03 shark kernel: [43613.462504] NVRM: Try unloading the conflicting kernel module (and/or
Oct  5 17:33:03 shark kernel: [43613.462505] NVRM: reconfigure your kernel without the conflicting
Oct  5 17:33:03 shark kernel: [43613.462506] NVRM: driver(s)), then try loading the NVIDIA kernel module
Oct  5 17:33:03 shark kernel: [43613.462507] NVRM: again.


*edit*

Per the X configuration manual, I have this in my make.conf:

Code:
VIDEO_CARDS="nouveau"


Is that what is causing the issue?
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Oct 05, 2012 9:46 pm    Post subject: Reply with quote

No, make.conf entry is not causing it, although you should change it to have nvidia installed for you automatically. See your lsmod output, I suspect some conflicting framebuffer may be loaded.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
M
Guru
Guru


Joined: 12 Dec 2006
Posts: 432

PostPosted: Fri Oct 05, 2012 9:48 pm    Post subject: Reply with quote

There is no hostile takeover. With nouveau (and intel, radeon...) you have KMS, nvidia blob doesn't have support for that.
Reason why xorg can't autodetect nvidia blob is because xorg devs rejected such patch from nvidia (they don't want something they can't control).

I never used genkernel but I guess there nouveau is built as a module. You can unload nouveau if you first unbind vtconsole.
I use this script to toggle drivers, 50-nvidia.conf is a minimal required config for blob:

Code:
#!/bin/sh

FILE="50-nvidia.conf"

rm_nouveau() {
    echo -n 0 > /sys/class/vtconsole/vtcon1/bind
    modprobe -r nouveau
    /etc/init.d/consolefont restart
    modprobe -r ttm
    modprobe -r drm_kms_helper
    modprobe -r drm
}

nvidia() {
    rm_nouveau
    modprobe nvidia
    cp /etc/X11/${FILE} /etc/X11/xorg.conf.d/
    eselect opengl set nvidia
}

nouveau() {
    modprobe -r nvidia
    rm -f /etc/X11/xorg.conf.d/${FILE}
    eselect opengl set xorg-x11
}

case $1 in
    nvidia)     nvidia ;;
    nouveau)    nouveau ;;
    *)          [ -f /etc/X11/xorg.conf.d/${FILE} ] && nouveau || nvidia ;;
esac
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Fri Oct 05, 2012 9:54 pm    Post subject: Reply with quote

Jaglover wrote:
No, make.conf entry is not causing it, although you should change it to have nvidia installed for you automatically. See your lsmod output, I suspect some conflicting framebuffer may be loaded.


lsmod shows no modules loaded whatsoever.
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Fri Oct 05, 2012 9:57 pm    Post subject: Reply with quote

M wrote:
There is no hostile takeover. With nouveau (and intel, radeon...) you have KMS, nvidia blob doesn't have support for that.
Reason why xorg can't autodetect nvidia blob is because xorg devs rejected such patch from nvidia (they don't want something they can't control).

I never used genkernel but I guess there nouveau is built as a module. You can unload nouveau if you first unbind vtconsole.
I use this script to toggle drivers, 50-nvidia.conf is a minimal required config for blob:

...some code...


I don't use genkernel.
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
M
Guru
Guru


Joined: 12 Dec 2006
Posts: 432

PostPosted: Fri Oct 05, 2012 10:02 pm    Post subject: Reply with quote

Bigun wrote:
I don't use genkernel.

Even better, than you have full control. Don't build nouveau in kernel, I guess you have it built in right now since you don't see it in lsmod.
Remove it or build nouveau as a module. I prefer to have both because I want kms and only switch to nvidia when I want to play games or similar.
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Fri Oct 05, 2012 10:20 pm    Post subject: Reply with quote

M wrote:
Bigun wrote:
I don't use genkernel.

Even better, than you have full control. Don't build nouveau in kernel, I guess you have it built in right now since you don't see it in lsmod.
Remove it or build nouveau as a module. I prefer to have both because I want kms and only switch to nvidia when I want to play games or similar.


That got me in the right direction, I just flat-out left DRM out of the kernel or module alltogether. Rebuilt, reboot, and it seems I'm golden. Thank for the help!

*edit*

However I feel the Nvidia document could use a few warnings about the conflict between the nouveau and nvidia drivers. Heck, in the xorg config it should probably start by preparing the user for what they plan on using (ATI, Nvidia, or DRM).
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2506
Location: Silver City, NM

PostPosted: Fri Oct 05, 2012 10:37 pm    Post subject: Reply with quote

M wrote:
Bigun wrote:
I don't use genkernel.

Even better, than you have full control. Don't build nouveau in kernel, I guess you have it built in right now since you don't see it in lsmod.
Remove it or build nouveau as a module. I prefer to have both because I want kms and only switch to nvidia when I want to play games or similar.

I don't have it built-in. I do have it built as a module. I am not claiming there are no work-arounds, My complaint is that the default boot behavior changed so that if the nouveau module exists then some systems (all of my systems) become unusable. IMO this is a huge violation of the principle of least surprise. At the very least, they could have continued to honor the vga=xxx setting instead of ignoring it.

If you add new behavior that makes many systems unusable then DON'T MAKE IT THE DEFAULT.

This collection of bone-headed choices has wasted a lot of my time both in figuring out the source of the very surprising problem they introduced and also in helping others when they got the nice surprise. For example, if Debian based distros want to include the nouveau driver then they need to add "nomodeset" as a boot parameter as the default so the hostile takeover doesn't make a significant set of systems unbootable. In addition, documentation about what was going on and how to fix it was very hard to find when I first encountered the problem.

There are cases where the nouveau driver makes a system unusable because you lose the vconsoles and X. Some of this breakage could have been avoided if they simply honored the vga=xxx boot parameter. IMO all of the breakage would have been avoided if the default hadn't been so drastically changed. There should have been a "modeset" boot parameter instead of a "nomodeset" boot parameter.

This is exactly the sort of behavior I would expect from Windows. I was very surprised to see it in Linux. I was excited about the nouveau driver when it was being developed. I am not interested in it any more.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Oct 05, 2012 10:39 pm    Post subject: Reply with quote

M wrote:
Reason why xorg can't autodetect nvidia blob is because xorg devs rejected such patch from nvidia (they don't want something they can't control).

Yep, the X guys rejected a patch, with a reason that makes sense. But you know, this is open source, so distros aren't forced to use what vendors serve them. While it's generally a good idea to stay close to upstream, adding nvidia to X's autoload list is not an invasive patch. Arch does it, for example.

Bigun wrote:
However I feel the Nvidia document could use a few warnings about the conflict between the nouveau and nvidia drivers.

Yeah, the nvidia guide is quite outdated. It still speaks of "editing" an xorg.conf, as if people have one by default. But that was a long time ago. Nowadays, the guide should say one should *create* an xorg.conf, containing just the four lines Jaglover posted. Or maybe even better, that one should create an xorg.conf.d/20-nvidia.conf containing those lines.



BitJam wrote:
At the very least, they could have continued to honor the vga=xxx setting instead of ignoring it.

The vga= option controls vesafb. Why should the option be honored if vesafb is not used?

BitJam wrote:
If you add new behavior that makes many systems unusable then DON'T MAKE IT THE DEFAULT.

I don't see where and how KMS drivers make systems unusable.

BitJam wrote:
For example, if Debian based distros want to include the nouveau driver then they need to add "nomodeset" as a boot parameter as the default so the hostile takeover doesn't make a significant set of systems unbootable.

What "hostile takeover"? WTF? It makes sense that if the kernel has a driver for a certain hardware, that driver gets loaded at boot. You're talking as if the ALSA driver getting loaded is a "hostile takeover" of your sound card.

BitJam wrote:
There are cases where the nouveau driver makes a system unusable because you lose the vconsoles and X.

Sometimes modesetting fails, yeah. But that's a bug that should be reported, not a "hostile takeover". And it's not nearly as common as you make it out to be.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Oct 06, 2012 2:28 am    Post subject: Reply with quote

BitJam wrote:
Yes and yes.

It has to do with KMS (Kernel Mode Setting). The default behavior is for nouveau to take control of the virtual consoles very early in the boot process, ignore any vga=xxx, setting and put the virtual consoles in the highest resolution supported by the video card. This often makes the displays unreadable sometimes by losing sync and other times because it selects by default the smallest font possible.

By this time, processes are depending on the nouveau module so it can't be unloaded. Since it can't be unloaded it blocks loading of the nvidia module and perhaps also the nv driver.

Have you ever considered selecting a larger font from the very same menu group you enabled nouveau in?

Or using the very clear docs the kernel provides to set an appropriate video= parameter?

Or doing *anything* to try and solve your problem instead of shotgun debugging and ranting about it as if it's some sort of battlefield? Nobody's forcing you to use video cards from bad manufacturers. Accept some responsibility for your own choices.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum