Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] NVidia & nouveau at the same time
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Fri Feb 22, 2013 11:36 pm    Post subject: [SOLVED] NVidia & nouveau at the same time Reply with quote

Is it possible to install Nvidia and nouveau drivers at the same time as a backup?

Last night I waisted all night to trouble shoot Nvidia drivers-304.64 with newer kernel-3.6.11 just to realize they they are not compatible with each other (at least not with my card).
I would like to install both of them so I can switch "on the fly" to an alternative driver just in case something this this happens again.

Does Nvidia provide any information which binary driver support which kernel and which video card?
I have a:
Code:
VGA compatible controller: NVIDIA Corporation GF116 [GeForce GTS 450] (rev a1)
and I would like to avoid situation like last night.
_________________
#Joseph


Last edited by Joseph_sys on Sun Feb 24, 2013 8:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Fri Feb 22, 2013 11:48 pm    Post subject: Reply with quote

Sure it's possible. Compile nouveau as a module, but blacklist it. Then when you want to use it, remove the blacklist. And also remove xorg.conf, that way X will use autodection, which will choose xf86-video-nouveau.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sat Feb 23, 2013 12:05 am    Post subject: Reply with quote

Gusar wrote:
Sure it's possible. Compile nouveau as a module, but blacklist it. Then when you want to use it, remove the blacklist. And also remove xorg.conf, that way X will use autodection, which will choose xf86-video-nouveau.

I found some instructions:
http://en.gentoo-wiki.com/wiki/Nouveau
Note very intuitive for an emergency switch or testing.
_________________
#Joseph
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sat Feb 23, 2013 12:17 am    Post subject: Reply with quote

That page contains a whole bunch of stuff that's not necessary. I told you everything you need to do: remove blacklist, remove xorg.conf (move them to somewhere, like /root). Then, when you want nvidia again, put them both back into place. Well, there's also "eselect opengl", but that's one simple command.
Back to top
View user's profile Send private message
popsUlfr
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2011
Posts: 80

PostPosted: Sat Feb 23, 2013 4:31 pm    Post subject: Reply with quote

Alternatively to make the best use of the X hotplugging feature put a file named e.g.: '30-nvidia.conf' into '/etc/X11/xorg.conf.d/' (create it if does not exist) with this content:
Code:

Section "Device"
        Identifier "Nvidia Card"
        Driver "nvidia"
        Option "NoLogo" "1"
        Option "TripleBuffer" "1"
        Option "DynamicTwinView" "0"
EndSection


and remove your '/etc/X11/xorg.conf'. To switch between nouveau or the official nvidia driver all you have to do is replace 'Drive "nvidia"' with 'Driver "nouveau"' and vice-versa (the modprobe and eselect stuff still applies).
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sat Feb 23, 2013 4:53 pm    Post subject: Reply with quote

xorg.conf is the same as xorg.conf.d/99-something.conf, so having an xorg.conf has no relation whatsoever in regards to hotplugging. It's not the files that matters, it's what's in them.

Also, removing a file that says Driver "nvidia", or replacing "nvidia" with "nouveau" within that file is also completely equivalent in this case.
Back to top
View user's profile Send private message
popsUlfr
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2011
Posts: 80

PostPosted: Sat Feb 23, 2013 5:05 pm    Post subject: Reply with quote

Gusar wrote:
xorg.conf is the same as xorg.conf.d/99-something.conf, so having an xorg.conf has no relation whatsoever in regards to hotplugging. It's not the files that matters, it's what's in them.

Also, removing a file that says Driver "nvidia", or replacing "nvidia" with "nouveau" within that file is also completely equivalent in this case.


Yes, you're absolutely right. But most users who haven't embraced the xorg.conf.d folder yet also usually have old pre-hotplug sections inside their xorg.conf they carried over for years :P
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sat Feb 23, 2013 5:12 pm    Post subject: Reply with quote

popsUlfr wrote:
Yes, you're absolutely right. But most users who haven't embraced the xorg.conf.d folder yet also usually have old pre-hotplug sections inside their xorg.conf they carried over for years :P

True. Then there's also those who run the outdated nvidia-xconfig instead of manually creating an xorg.conf (or xorg.conf.d/20-nvidia.conf) containing just the Device section. My point was simply: there's no need to explicitly avoid having an xorg.conf - as long as what's in there is proper (no InputDevice sections, no ServerLayout sections, or other stuff of the past).
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sat Feb 23, 2013 9:38 pm    Post subject: Reply with quote

I'm trying to find which driver I should use and which one I should mask.
According to gentoo instructions: http://en.gentoo-wiki.com/wiki/Nvidia

Code:
...
The nvidia-drivers package supports the full range of available nVidia cards. Multiple versions are available for installation, depending on the card(s) you have.
    Newer cards such as the GeForce 8, 7 and 6 series should use the newer drivers from the 200.x series.
    Older cards such as GeForce FX 5 series and related Quadro FX cards require the 173.x drivers. For these cards, you should mask >=x11-drivers/nvidia-drivers-180.00 in your /etc/portage/package.mask file.
 Older cards such as the GeForce 3 or GeForce 4 and related Quadro4 and some Quadro2 series require the 96.x drivers. For these cards, you should mask >=x11-drivers/nvidia-drivers-97.00 in your /etc/portage/package.mask file. This will prevent newer versions of the driver which are incompatible with your card from being installed.
Old NV2x-based cards (such as TNT, TNT2, GeForce, GeForce 2, Quadro and Quadro2) require the older 71.x drivers (such as nvidia-drivers-71.86.01). For these cards, you should mask >=x11-drivers/nvidia-drivers-87.00 in /etc/portage/package.mask.


My card being "GeForce 4" I should use 96.x drivers but currently the card is working with:
nvidia-drivers-295.75
So how accurate is that information? Drivers 97.00 87.00 71.00 are no longer in portage; it would means they shouldn't work.
How to find out which drivers I should mask or what to avoid future problems. I tried to use direvers-304.64 but my screen when blank so this was my problem not making it.
_________________
#Joseph
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sat Feb 23, 2013 9:51 pm    Post subject: Reply with quote

Err, your card is not Geforce 4, it's Geforce 400. Geforce 4 is ten years old, while yours is a Fermi card, which is previous generation (current generation is Kepler): http://en.wikipedia.org/wiki/GeForce_series#Generations

You use the latest available, currently that's 313.18 (or 310.32-lts).
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 3:18 am    Post subject: Reply with quote

Gusar wrote:
That page contains a whole bunch of stuff that's not necessary. I told you everything you need to do: remove blacklist, remove xorg.conf (move them to somewhere, like /root). Then, when you want nvidia again, put them both back into place. Well, there's also "eselect opengl", but that's one simple command.


OK, I'm ready to follow your steps, to go from nvidia to nouveau

Assuming I'm using "nvidia" and have "nouveau" compile as module with the following configuration:
Code:
cat /etc/modprobe.d/blacklist.conf
blacklist nouveau

cat /etc/X11/xorg.conf
Section "Device"
    Identifier "Nvidia card"
    Driver     "nvidia"
EndSection

eselect opengl list
Available OpenGL implementations:
  [1]   nvidia *
  [2]   xorg-x11

In order to switch it to "nouveau" I would need to unload the nvidia module, but I can not do it when it is in use so I need to stop "xdm" first, am I correct?
Code:
/etc/init.d/xdm stop (X crashes at this moment)
modprobe -r nvidia
mv /etc/modprobe.d/blacklist.conf /etc/modprobe.d/blacklist.conf_backup
mv /etc/X11/xorg.conf  /etc/X11/xorg.conf _nvidia
eselect opengl set xorg-x11
modprobe nouveau
mv /etc/X11/xorg.conf_nouveau /etc/X11/xorg.conf
/etc/init.d/xdm start (at this moment I should have login screen

Did I miss anything? Will it work if I put it into an "sh" script?
_________________
#Joseph
Back to top
View user's profile Send private message
init_6
Apprentice
Apprentice


Joined: 22 Jun 2008
Posts: 166

PostPosted: Sun Feb 24, 2013 8:16 am    Post subject: Reply with quote

Create a boot option for easy nvidia or nouveau display driver switching

instead of xcfgmaker use xdm-setup
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Feb 24, 2013 10:47 am    Post subject: Reply with quote

While it's possible to switch without rebooting (though who knows how the card will react to suddenly being reprogrammed by a different driver, it might simply lock up), the simplest way is to reboot, so that each driver starts from a clean state. Also, switching from nouveau to nvidia requires not just quitting X, but also unbinding nouveau from the console. But since you pretty much have to stop all running apps, why not just reboot.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2439

PostPosted: Sun Feb 24, 2013 2:21 pm    Post subject: Reply with quote

I've never quite trusted the nVidia kernel module to cleanly unload, so I just reboot to switch.

Some of this sounds overly complex. I'd swear that I just blacklist both nouveau and nvidia kernel modules, and just use xorg.conf to select. It demand-loads what it needs, and all is well. (I haven't done this in a while, I set it up a year or so back, tested it, and just left it alone since.)
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 5:12 pm    Post subject: Reply with quote

Gusar wrote:
While it's possible to switch without rebooting (though who knows how the card will react to suddenly being reprogrammed by a different driver, it might simply lock up), the simplest way is to reboot, so that each driver starts from a clean state. Also, switching from nouveau to nvidia requires not just quitting X, but also unbinding nouveau from the console. But since you pretty much have to stop all running apps, why not just reboot.


I did it last night and I've experience some problems with lockup, no display.
After using nvidia, I stoped "xdm" I got the console prompt login. I log in as root "modprobe -r nvidia" and console locked up, I had to ssh to finish the job and reboot.

It seems to me it will not be an easy solution.
I was trying to simulate the situation where I upgrade the system (kernel and/or video drivers) and after rebooting I get a console login no X.
At this point the "nvidia" kernel module is loaded so I was thinking I would just unload it and load "nouveau" but it seems after doing it I would not be even able to type reboot. I would need to pull the cord to restart.
_________________
#Joseph


Last edited by Joseph_sys on Sun Feb 24, 2013 5:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 5:15 pm    Post subject: Reply with quote

init_6 wrote:
Create a boot option for easy nvidia or nouveau display driver switching

instead of xcfgmaker use xdm-setup


Thanks for suggestion, but it seems to me a bit complicated, I don't want to mess up with boot. Gentoo does not have a default documentation on it and trying to get a help when I get stuck might be hard.
_________________
#Joseph
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Feb 24, 2013 5:20 pm    Post subject: Reply with quote

Why unload anything? Move aside (or move back into place, depending on which direction you're going) the xorg.conf and blacklist, and reboot.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 5:21 pm    Post subject: Reply with quote

depontius wrote:
I've never quite trusted the nVidia kernel module to cleanly unload, so I just reboot to switch.

Some of this sounds overly complex. I'd swear that I just blacklist both nouveau and nvidia kernel modules, and just use xorg.conf to select. It demand-loads what it needs, and all is well. (I haven't done this in a while, I set it up a year or so back, tested it, and just left it alone since.)


How do you use "xorg.conf" to select; you have to load either "nvidia or nouveau" kernel driver first, isn't it?
_________________
#Joseph
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 5:22 pm    Post subject: Reply with quote

Gusar wrote:
Why unload anything? Move aside (or move back into place, depending on which direction you're going) the xorg.conf and blacklist, and reboot.


How do you do it? Move aside or back into place.
_________________
#Joseph
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2439

PostPosted: Sun Feb 24, 2013 5:40 pm    Post subject: Reply with quote

Joseph_sys wrote:
depontius wrote:
I've never quite trusted the nVidia kernel module to cleanly unload, so I just reboot to switch.

Some of this sounds overly complex. I'd swear that I just blacklist both nouveau and nvidia kernel modules, and just use xorg.conf to select. It demand-loads what it needs, and all is well. (I haven't done this in a while, I set it up a year or so back, tested it, and just left it alone since.)


How do you use "xorg.conf" to select; you have to load either "nvidia or nouveau" kernel driver first, isn't it?


From what I remember, if xorg.conf selects nvidia, then X demand-loads the nvidia kernel module. Otherwise nouveau.

EDIT - I'd already mentioned earlier in this thread that I blacklist both nvidia and nouveau

Once you blacklist both, it's a simple matter of editing /etc/X11/xorg.conf, and then it will demand-load the correct kernel module when X starts. The blacklist entry is to prevent anything from getting loaded when the hardware is probed at boot time. That said, I also don't trust the nvidia kernel module to cleanly and completely unload, so I suggest rebooting to switch drivers.
_________________
.sigs waste space and bandwidth


Last edited by depontius on Sun Feb 24, 2013 7:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Feb 24, 2013 5:46 pm    Post subject: Reply with quote

depontius wrote:
From what I remember, if xorg.conf selects nvidia, then X demand-loads the nvidia kernel module. Otherwise nouveau.

Correct. But the nouveau kernel module will load before you even get to X, preventing nvidia to load. So just having an xorg.conf is not enough, you also need to blacklist nouveau.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 6:15 pm    Post subject: Reply with quote

The closest solution I came up with is here:
http://wiki.gentoo.org/wiki/Nouveau_%26_nvidia-drivers_switching

I'm trying to use one kernel but can not figure it out how to manipulate the suffix name, as the switching rely on suffix from:
uname -r
isn't this name taken from the link where /usr/src/linux -> is pointing to?
_________________
#Joseph
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Feb 24, 2013 7:07 pm    Post subject: Reply with quote

Why are you complicating things again? You already have everything necessary, you yourself even once described the process. Except, instead of quitting X and playing with modules, you simply reboot.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2379
Location: Edmonton, AB

PostPosted: Sun Feb 24, 2013 7:11 pm    Post subject: Reply with quote

Gusar wrote:
Why are you complicating things again? You already have everything necessary, you yourself even once described the process. Except, instead of quitting X and playing with modules, you simply reboot.


Yes, rebooting is simple. But my question is how system knows which module to load, how the selection process goes?
_________________
#Joseph
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Feb 24, 2013 7:22 pm    Post subject: Reply with quote

Joseph_sys wrote:
Yes, rebooting is simple. But my question is how system knows which module to load, how the selection process goes?

It's all in this thread - through blacklists and xorg.conf
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
Goto page 1, 2  Next
Page 1 of 2

 
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