Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] Optimus new nvidia drivers

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
68 posts
  • 1
  • 2
  • 3
  • Next
Author
Message
GenBlack
n00b
n00b
Posts: 5
Joined: Wed May 15, 2013 3:27 pm

[SOLVED] Optimus new nvidia drivers

  • Quote

Post by GenBlack » Wed May 15, 2013 3:57 pm

Hello here,

My first message on this forum for ask help, apologize about that.

I'm trying to find a way to make it work my nvidia optimus natively with the drivers from nvidia but it won't work.

Here some information about my system :

Xorg.conf : http://bpaste.net/show/99096/
Xorg version : 1.13.4
Xrandr : 1.4.0
Kernel : 3.9.2
Nvidia version driver : 319.17
xf86-video-modesetting : 0.7.0
lspci |grep VGA :

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 640M] (rev a1)

Actually with this configuration, xorg run fine but using the intel card (direct rendering yes but 1500 fps in 5 seconds with glxgears)

I can't get the display from my nvidia card, with bumblebee yes (optirun glxgears) but the fps is too slow.

I read that :
http://us.download.nvidia.com/XFree86/L ... ndr14.html

Saying I need to pass my nvidia card in master (card0 nvidia and card1 intel with modesetting)

Here the xorg.log if I m trying with the method from nvidia :

http://bpaste.net/show/99099/

I also try to edit my xinitrc for add this :

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Not working at all.

Any idea ?

Thank for your help
Last edited by GenBlack on Wed May 15, 2013 5:54 pm, edited 1 time in total.
Top
GenBlack
n00b
n00b
Posts: 5
Joined: Wed May 15, 2013 3:27 pm

  • Quote

Post by GenBlack » Wed May 15, 2013 5:53 pm

Problem solved

I did just add the BusID for the intel card, switch to opengl nvidia interface and it's work perfectly !

I got now more than 8K fps with glxgears.

If anyone are interest by a small "how to" make work nvidia optimus natively just reply here.
Top
alfalco
n00b
n00b
Posts: 2
Joined: Wed May 15, 2013 7:43 pm
Location: Curitiba - PR - Brazil

Mini How-To

  • Quote

Post by alfalco » Wed May 15, 2013 7:48 pm

Hi GenBlack, it's possible to you, reply this with a how-to?

Thanks in advance.

alfalco
Top
GenBlack
n00b
n00b
Posts: 5
Joined: Wed May 15, 2013 3:27 pm

  • Quote

Post by GenBlack » Wed May 15, 2013 7:51 pm

How to get optimus working with the last drivers nvidia
---------------------------------------------------------------

Requierement :

- Kernel 3.9.x (if the kernel is not at least a 3.9.0 it will not work)
- Xorg version 1.13.4 or higher (Tested on 1.13.4 and 1.14.1 version)
- xrandr 1.4.0
- nvidia drivers 319.12 or higher (Tested with the 319.17 version)
- Check if your card is supported by the drivers -> http://www.nvidia.com/object/linux-disp ... river.html

For security reason stable reason, Gentoo don't provide by default the last update needed for making work optimus natively, you will need to write somes rules in the packages.keywords

You should probably don't do it for the stability of your system, but well... Get fully fps for your card can excuse it :D

If the nouveau drivers (open source nvidia) is setting in your kernel, you need to blacklist this one :

Code: Select all

nano /etc/modprobe.d/blacklist.conf
and add :

Code: Select all

blacklist nouveau
You should probably also, if that is setting in your kernel blacklist rivafb and nvidiafb.

If you did install the drivers by downloading the .run to the nvidia website, use the uninstaller (nvidia-uninstall I guess)

Now we edit the package.keyworkds :

Code: Select all

nano /etc/portage/package.keywords
And here what I did use :

Code: Select all

=x11-apps/xrandr-1.4.0 ~x86
=x11-base/xorg-server-1.14.1 ~x86
=x11-proto/inputproto-2.3 ~x86
=x11-drivers/nvidia-drivers-319.17 ~x86
=x11-drivers/xf86-input-evdev-2.8.0 ~x86
=x11-drivers/xf86-input-synaptics-1.7.0 ~x86
=x11-drivers/xf86-video-modesetting-0.7.0 ~x86
Begin by emerge these packet or update if the lastest version was already installed in your system.

Code: Select all

emerge x11-apps/xrandr
...

When these packet are emerge, you will need to force xorg an the other packet to be rebuild "between them", I find this solution on the gentoo forum by s_bernstein

Code: Select all

 emerge -1 $(qlist -IC x11-drivers)

When that's is done, edit your .xinitrc

Code: Select all

nano /home/yourusername/.xinitrc
And add :

Code: Select all

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
Somes distributions need these line inside the .xsessionrc

Change your interface for nvidia :

Code: Select all

eselect opengl list
If nvidia is the number 1 of the result :

Code: Select all

eselect opengl set 1
You will have in return :

Code: Select all

Switching to nvidia OpenGL interface... done
Almost done, you need to change your xorg.conf as saying in the official documentation nvidia.

Code: Select all

nano /etc/X11/xorg.conf
Remove all inside and add :

Code: Select all

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "<BusID for NVIDIA device here>"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    # Uncomment this line if your computer has no display devices connected to
    # the NVIDIA GPU.  Leave it commented if you have display devices
    # connected to the NVIDIA GPU that you would like to use.
    #Option "UseDisplayDevice" "none"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
You need to put the BusID of your nvidia card, probably PCI:1:0:0 but better to check it with lspci

Code: Select all

lspci |grep VGA
Return for me

Code: Select all

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 640M] (rev a1)
01:00.0 is my busID nvidia.

I recommend too, to set the BusID of your intel card in your xorg.conf I got black/blank screen because it was not writen.

Save your xorg.conf and reboot X (no need to reboot your system except if you did build a new kernel)

It should work now.

If that did not work, try to uncomment the line Option "UseDisplayDevice" "none' in your xorg.conf by removing the #



On my side here the test :

Nouveau driver and bumblebeed : 1500 fps in 5 seconds (glxgears)
Nvidia driver and bumblebeed : 1500 to 1700 fps in 5 seconds (glxgears)
New driver support the optimus by nvidia : 8000 to 8800 fps in 5 seconds (glxgears)


List of game test with the new drivers :

- Crusader kings 2 (work without any problem)
- Left 4 dead 2 (soon)



-------------------------------------------------------------------------------------------------------------------------------------------
Any help to complete this are welcome ! I'm not an expert so if something is wrong on these instructions, tell me and I will edit
Top
GenBlack
n00b
n00b
Posts: 5
Joined: Wed May 15, 2013 3:27 pm

  • Quote

Post by GenBlack » Wed May 15, 2013 8:42 pm

Done
Top
alfalco
n00b
n00b
Posts: 2
Joined: Wed May 15, 2013 7:43 pm
Location: Curitiba - PR - Brazil

  • Quote

Post by alfalco » Thu May 16, 2013 2:16 pm

Thanks for your time.

Great job.
Top
BeaTtheMeaT666
n00b
n00b
Posts: 54
Joined: Tue Nov 12, 2002 3:28 pm

  • Quote

Post by BeaTtheMeaT666 » Tue May 21, 2013 4:45 pm

It works for me when I use startx , but not with a login manager (slim), I get a black screen.
Do I have to put the xrandr commands somewhere in slim's configuration?
Top
GenBlack
n00b
n00b
Posts: 5
Joined: Wed May 15, 2013 3:27 pm

  • Quote

Post by GenBlack » Wed May 22, 2013 1:24 pm

BeaTtheMeaT666 wrote:It works for me when I use startx , but not with a login manager (slim), I get a black screen.
Do I have to put the xrandr commands somewhere in slim's configuration?
You should wait for use the lastest nvidia pilote with your login manager, it's not officialy supported by Gentoo I guess.
Top
beizhuchun
n00b
n00b
Posts: 29
Joined: Thu Apr 11, 2013 7:11 am

  • Quote

Post by beizhuchun » Wed May 22, 2013 2:40 pm

Not work for me. I cann't find xorg.conf in /etc/X11,so I writed a new xorg.conf as

Code: Select all

 Section "ServerLayout" 
    Identifier "layout" 
    Screen 0 "nvidia" 
    Inactive "intel" 
EndSection 

Section "Device" 
    Identifier "nvidia" 
    Driver "nvidia" 
    BusID "PCI:01:00.0 " 
EndSection 

Section "Screen" 
    Identifier "nvidia" 
    Device "nvidia" 
    # Uncomment this line if your computer has no display devices connected to 
    # the NVIDIA GPU.  Leave it commented if you have display devices 
    # connected to the NVIDIA GPU that you would like to use. 
    #Option "UseDisplayDevice" "none" 
EndSection 

Section "Device" 
    Identifier "intel" 
    Driver "modesetting" 
     BusID "PCI:00:02.0 "
EndSection 

Section "Screen" 
    Identifier "intel" 
    Device "intel" 
EndSection

and eselect opengl set to nvidia
I can't startx.
the xorg log report:
[ 10.919] (WW) Falling back to old probe method for modesetting
[ 10.919] (EE) No devices detected.
[ 10.919]
Fatal server error:
[ 10.919] no screens found
[ 10.919] (EE)
Top
Dr.Willy
Guru
Guru
Posts: 547
Joined: Sun Jul 15, 2007 5:13 pm
Location: NRW, Germany

  • Quote

Post by Dr.Willy » Wed May 22, 2013 8:27 pm

Your BusID syntax is probably wrong. Change them to PCI:1:0:0 and PCI:0:2:0
Top
beizhuchun
n00b
n00b
Posts: 29
Joined: Thu Apr 11, 2013 7:11 am

  • Quote

Post by beizhuchun » Thu May 23, 2013 4:34 am

Dr.Willy wrote:Your BusID syntax is probably wrong. Change them to PCI:1:0:0 and PCI:0:2:0
I have tried with corrected BusID, but still not work, xorg.log saied no srceen, if uncommented

Code: Select all

Option "UseDisplayDevice" "none" 
in xorg.conf, lead to black screen.
BTW
can put

Code: Select all

xrandr --setprovideroutputsource modesetting NVIDIA-0 
xrandr --auto

into /etc/gdm/PreSession/default?
Top
vinz94f
n00b
n00b
Posts: 5
Joined: Sat May 25, 2013 10:14 am

  • Quote

Post by vinz94f » Sat May 25, 2013 10:27 am

Hi,

Is it necessary to enable an option in the kernel 3.9.x for optimus works?
I activated the hybrid graphics in section device/graphics.
Is it enough?

Because I have a segfault in X when I type the following command :

xrandr --setprovideroutputsource modesetting NVIDIA-0

My system 64 bit not 32 bit:

- Kernel 3.9.3
- Xorg version 1.14.1
- xrandr 1.4.0
- nvidia drivers 319.17
- Compiled with CFLAGS =" -02 -march=native" and LDFLAGS="-Wl,-O1"
Top
Tolstoi
l33t
l33t
User avatar
Posts: 678
Joined: Thu May 20, 2004 8:06 am

  • Quote

Post by Tolstoi » Sun May 26, 2013 7:28 am

First of all thanks for the guide. Works for me so far with startx but leads to a black screen with KDM. Any ideas?
Top
Dr.Willy
Guru
Guru
Posts: 547
Joined: Sun Jul 15, 2007 5:13 pm
Location: NRW, Germany

  • Quote

Post by Dr.Willy » Sun May 26, 2013 10:57 am

Tolstoi wrote:First of all thanks for the guide. Works for me so far with startx but leads to a black screen with KDM. Any ideas?
You probably need to run
xrandr --setprovideroutputsource modesetting NVIDIA-0
Top
kernelOfTruth
Watchman
Watchman
User avatar
Posts: 6111
Joined: Tue Dec 20, 2005 10:34 pm
Location: Vienna, Austria; Germany; hello world :)
Contact:
Contact kernelOfTruth
Website

  • Quote

Post by kernelOfTruth » Sun May 26, 2013 11:18 am

@GenBlack:

thanks for the in-depth how-to



might need this in the near future - so *subscribing*
https://github.com/kernelOfTruth/ZFS-fo ... scCD-4.9.0
https://github.com/kernelOfTruth/pulsea ... zer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Top
Tolstoi
l33t
l33t
User avatar
Posts: 678
Joined: Thu May 20, 2004 8:06 am

  • Quote

Post by Tolstoi » Sun May 26, 2013 12:34 pm

Dr.Willy wrote:
Tolstoi wrote:First of all thanks for the guide. Works for me so far with startx but leads to a black screen with KDM. Any ideas?
You probably need to run
xrandr --setprovideroutputsource modesetting NVIDIA-0
I had set that in my .xinitrc.
Top
Dr.Willy
Guru
Guru
Posts: 547
Joined: Sun Jul 15, 2007 5:13 pm
Location: NRW, Germany

  • Quote

Post by Dr.Willy » Sun May 26, 2013 1:47 pm

Tolstoi wrote:
Dr.Willy wrote:
Tolstoi wrote:First of all thanks for the guide. Works for me so far with startx but leads to a black screen with KDM. Any ideas?
You probably need to run
xrandr --setprovideroutputsource modesetting NVIDIA-0
I had set that in my .xinitrc.
...which is executed when?
Top
Tolstoi
l33t
l33t
User avatar
Posts: 678
Joined: Thu May 20, 2004 8:06 am

  • Quote

Post by Tolstoi » Sun May 26, 2013 4:13 pm

... I guess after KDM?
Top
kernelOfTruth
Watchman
Watchman
User avatar
Posts: 6111
Joined: Tue Dec 20, 2005 10:34 pm
Location: Vienna, Austria; Germany; hello world :)
Contact:
Contact kernelOfTruth
Website

  • Quote

Post by kernelOfTruth » Sun May 26, 2013 4:35 pm

https://wiki.archlinux.org/index.php/Xinitrc
The ~/.xinitrc file is a shell script read by xinit and startx. It is mainly used to execute desktop environments, window managers and other programs when starting the X server (e.g., starting daemons and setting environment variables). The xinit and startx programs starts the X Window System and works as first client programs on systems that cannot start X directly from /etc/init, or in environments that use multiple window systems.
^^ the arch wiki is awesome :lol:
https://github.com/kernelOfTruth/ZFS-fo ... scCD-4.9.0
https://github.com/kernelOfTruth/pulsea ... zer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Top
Dr.Willy
Guru
Guru
Posts: 547
Joined: Sun Jul 15, 2007 5:13 pm
Location: NRW, Germany

  • Quote

Post by Dr.Willy » Sun May 26, 2013 7:05 pm

Tolstoi wrote:... I guess after KDM?
It's your user's .xinitrc so more to the point it is executed after you login.
Which in turn means until you log in your screen is black.
Top
kernelOfTruth
Watchman
Watchman
User avatar
Posts: 6111
Joined: Tue Dec 20, 2005 10:34 pm
Location: Vienna, Austria; Germany; hello world :)
Contact:
Contact kernelOfTruth
Website

  • Quote

Post by kernelOfTruth » Sun May 26, 2013 7:09 pm

Dr.Willy wrote:
Tolstoi wrote:... I guess after KDM?
It's your user's .xinitrc so more to the point it is executed after you login.
Which in turn means until you log in your screen is black.
had some other issues where the screen also stayed black before you logged in

that's not nice :/

better have it show up the screen before you have logged in
https://github.com/kernelOfTruth/ZFS-fo ... scCD-4.9.0
https://github.com/kernelOfTruth/pulsea ... zer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Top
dcd94
n00b
n00b
Posts: 12
Joined: Thu Mar 28, 2013 2:21 pm

  • Quote

Post by dcd94 » Thu May 30, 2013 2:18 pm

im also having problems starting X, followed the guide and im getting the error:

Fatal server error:
no screens found



Heres my pastebin in Xorg.0.log: http://pastebin.com/a0rKY2eX

I hope you guys know something I really want to test this baby out
Top
jms.gentoo
Tux's lil' helper
Tux's lil' helper
Posts: 105
Joined: Thu May 07, 2009 5:29 am

  • Quote

Post by jms.gentoo » Mon Jun 03, 2013 6:38 pm

Thanks for the guide and anyone helping with it.

amd64
got problem too when starting x =>segfault

Also would like to know about kernel option
Is it necessary to enable an option in the kernel 3.9.x for optimus works?
I activated the hybrid graphics in section device/graphics.
I have this too compiled in my kernel
Device Drivers>Graphics Support
Laptop Hybrid Graphics - GPU switching support (VGA_SWITCHEROO)

*using:

Code: Select all

                                                                      
[ebuild   R   ~] x11-proto/inputproto-2.3  ABI_X86="32 (64) (-x32)" 0 kB                                
[ebuild   R   ~] x11-apps/xrandr-1.4.0  0 kB                                                            
[ebuild   R   ~] x11-base/xorg-server-1.14.1.901:0/1.14.1.901  USE="ipv6 nptl suid udev xorg -dmx -doc -kdrive -minimal (-selinux) -static-libs -tslib -xnest -xvfb" 0 kB                                       
[ebuild   R   ~] sys-kernel/gentoo-sources-3.9.4:3.9.4  USE="-build -deblob -symlink" 0 kB              
[ebuild   R   ~] x11-drivers/xf86-input-evdev-2.8.0  0 kB                                               
[ebuild   R   ~] x11-drivers/xf86-input-synaptics-1.7.1  0 kB                                           
[ebuild   R   ~] x11-drivers/xf86-video-modesetting-0.7.0  0 kB                                         
[ebuild   R   ~] x11-drivers/nvidia-drivers-319.23  USE="X acpi (multilib) tools -pax_kernel" 0 kB  

Code: Select all

lspci | grep 'VGA\|NVIDIA'
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev a1)
note for howto: as you can see NVIDIA apear here as 3D controller not as VGA compatible controller.

my xorg.conf

Code: Select all

Section "ServerLayout"
    Identifier "layout"
    Screen  0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    # Uncomment this line if your computer has no display devices connected to
    # the NVIDIA GPU.  Leave it commented if you have display devices
    # connected to the NVIDIA GPU that you would like to use.
    Option "UseDisplayDevice" "none"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
note :also tried busid format like "PCI:00:02:00"
did try with "#Option "UseDisplayDevice" "none" " too

/root/.xinitrc

Code: Select all

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
and did set opengl to nvidia
did also module rebuild rebuild ,revdep-rebuild and did rebuild all drivers for xorg-server....

But...
my Xorg log with segfault
http://bpaste.net/show/104111/

emerge --info:
http://bpaste.net/show/104118/
Last edited by jms.gentoo on Wed Jun 05, 2013 4:19 am, edited 1 time in total.
Top
jms.gentoo
Tux's lil' helper
Tux's lil' helper
Posts: 105
Joined: Thu May 07, 2009 5:29 am

  • Quote

Post by jms.gentoo » Tue Jun 04, 2013 2:46 pm

ok
about kernel option VGA_SWITCHEROO
Laptop Hybrid Graphics - GPU switching support (VGA_SWITCHEROO)

from what I found here
http://doc.ubuntu-fr.org/vga_switcheroo
VGA Switcheroo ne fonctionne pas avec les pilotes graphiques propriétaires des cartes graphiques
Looks like it's incompatible/useless with proprietary drivers

will test without this when I will have time
Top
dcd94
n00b
n00b
Posts: 12
Joined: Thu Mar 28, 2013 2:21 pm

  • Quote

Post by dcd94 » Tue Jun 04, 2013 6:03 pm

jms.gentoo wrote:ok
about kernel option VGA_SWITCHEROO
Laptop Hybrid Graphics - GPU switching support (VGA_SWITCHEROO)

from what I found here
http://doc.ubuntu-fr.org/vga_switcheroo
VGA Switcheroo ne fonctionne pas avec les pilotes graphiques propriétaires des cartes graphiques
Looks like it's incompatible/useless with proprietary drivers

will test without this when I will have time
Hi got the same kernel as you I found out about my previously error and wrote wrong bus id and now I got the same error as you but I dont have VGA_SWITCHEROO built in
Top
Post Reply

68 posts
  • 1
  • 2
  • 3
  • Next

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic