Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Let "nouveau" and "nvidia" cohabit: possible?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Thu Sep 20, 2012 8:18 pm    Post subject: Let "nouveau" and "nvidia" cohabit: poss Reply with quote

Hi all.

Is is possible to configure my system so as to select either nouveau or nvidia for Xorg at boot time using appropriate kernel arguments? (sub-question: which ones?) It could be through the use of an initramfs (which I'm already using since the root filesystem in on LVM) or whatever.

Thanks in advance for any hint or suggestion.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Thu Sep 20, 2012 8:26 pm    Post subject: Reply with quote

VinzC,

I think you need two different kernel trees to do this, one set up for niVida, one for nouveau as nVidia will not build against a kernel that has KMS and nouveau.

Now you boot the kernel you want and pass a parameter in the kernel line in grub, which you can parse from /proc/cmdline with a script in /etc/local.d/ to do whatever you want.
Choose a parameter thats easy to parse and that the kernel will ignore.

Your script can choose the right xorg.conf and anything else you need.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Thu Sep 20, 2012 8:35 pm    Post subject: Reply with quote

I used to have my system set up to boot with neither nividia or nouveau.

They were built as modules, with both blacklisted and I just selected one along with copying a preset up xorg conf file for one or the other.

I'm not sure if that is still possible as I haven't kept up with nouveau in the last year or so.

Edit to add:

I had this in /etc/modprobe.d/blacklist.conf

Code:
blacklist drm
blacklist ttm
blacklist nouveau
blacklist nvidia


and this in my .bashrc file

Code:
nvidia() {
  sudo modprobe -r nouveau
  sudo modprobe nvidia
  sudo eselect opengl set 1
  sudo cp ~/doc/nvidia.conf /etc/X11/xorg.conf.d/30-video.conf
  echo ------> Nvidia drivers loaded <------
}

nouveau() {
  sudo modprobe -r nvidia
  sudo modprobe nouveau
  sudo eselect opengl set 2
  sudo cp ~/doc/nouveau.conf /etc/X11/xorg.conf.d/30-video.conf
  echo ------> Nouveau drivers loaded <------
}


This was all pre KMS nouveau days, don't know if it will still work.

Edit to add 2:
I suppose you could build two kernels, one set up for nouveau and the other for nvidia, and boot the appropriate one from grub/lilo.

Edit to add 3:
https://wiki.archlinux.org/index.php/Nouveau
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 311

PostPosted: Fri Sep 21, 2012 5:42 am    Post subject: Reply with quote

You need to unbind fbcon before rmmod nouveau:

echo 0 > /sys/class/vtconsole/vtcon1/bind
echo 1 > /sys/class/vtconsole/vtcon0/bind
rmmod nouveau
vbetool post
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Fri Sep 21, 2012 9:59 pm    Post subject: Reply with quote

Thanks NeddySeagoon et al.

I'm currently trying to configure my system with both modules in the same kernel tree. Fact is I already installed nvidia proprietary drivers prior to recompiling the kernel with requried modules for nouveau. From your hints I believe it's all possible if I blacklist all modules (nouveau and nvidia). Looks like nvidia gets loaded before running X so it's the easiest part.

In the meantime I'm also trying to keep my bootsplash screen so if nvidia is selected, uvesafb must be loaded. If nouveau is selected, I must update the video=xxx argument accordingly. The tricky part is to write the appropriate xorg configuration file before X starts. I hope local.start is the right place for that.

So thanks for your hints. I'll report here whatever I will have found out.

@s4e8:

I don't really need to unbind in fact for I'll just reboot to switch video drivers. At least in the beginning. Thanks for pointing that anyway.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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