Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Optimus new nvidia drivers
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
GenBlack
n00b
n00b


Joined: 15 May 2013
Posts: 5

PostPosted: Wed May 15, 2013 3:57 pm    Post subject: [SOLVED] Optimus new nvidia drivers Reply with quote

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/Linux-x86/319.12/README/randr14.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
Back to top
View user's profile Send private message
GenBlack
n00b
n00b


Joined: 15 May 2013
Posts: 5

PostPosted: Wed May 15, 2013 5:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
alfalco
n00b
n00b


Joined: 15 May 2013
Posts: 2
Location: Curitiba - PR - Brazil

PostPosted: Wed May 15, 2013 7:48 pm    Post subject: Mini How-To Reply with quote

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

Thanks in advance.

alfalco
Back to top
View user's profile Send private message
GenBlack
n00b
n00b


Joined: 15 May 2013
Posts: 5

PostPosted: Wed May 15, 2013 7:51 pm    Post subject: Reply with quote

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-display-ia32-319.17-driver.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:
nano /etc/modprobe.d/blacklist.conf


and add :

Code:
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:
nano /etc/portage/package.keywords


And here what I did use :

Code:

=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:
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:
 emerge -1 $(qlist -IC x11-drivers)



When that's is done, edit your .xinitrc

Code:
nano /home/yourusername/.xinitrc


And add :

Code:

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


Somes distributions need these line inside the .xsessionrc

Change your interface for nvidia :

Code:
eselect opengl list


If nvidia is the number 1 of the result :

Code:
eselect opengl set 1


You will have in return :

Code:
Switching to nvidia OpenGL interface... done


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

Code:
nano /etc/X11/xorg.conf


Remove all inside and add :

Code:

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:
lspci |grep VGA


Return for me

Code:

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
Back to top
View user's profile Send private message
GenBlack
n00b
n00b


Joined: 15 May 2013
Posts: 5

PostPosted: Wed May 15, 2013 8:42 pm    Post subject: Reply with quote

Done
Back to top
View user's profile Send private message
alfalco
n00b
n00b


Joined: 15 May 2013
Posts: 2
Location: Curitiba - PR - Brazil

PostPosted: Thu May 16, 2013 2:16 pm    Post subject: Reply with quote

Thanks for your time.

Great job.
Back to top
View user's profile Send private message
BeaTtheMeaT666
n00b
n00b


Joined: 12 Nov 2002
Posts: 54

PostPosted: Tue May 21, 2013 4:45 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
GenBlack
n00b
n00b


Joined: 15 May 2013
Posts: 5

PostPosted: Wed May 22, 2013 1:24 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
beizhuchun
n00b
n00b


Joined: 11 Apr 2013
Posts: 29

PostPosted: Wed May 22, 2013 2:40 pm    Post subject: Reply with quote

Not work for me. I cann't find xorg.conf in /etc/X11,so I writed a new xorg.conf as
Code:
 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)
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Wed May 22, 2013 8:27 pm    Post subject: Reply with quote

Your BusID syntax is probably wrong. Change them to PCI:1:0:0 and PCI:0:2:0
Back to top
View user's profile Send private message
beizhuchun
n00b
n00b


Joined: 11 Apr 2013
Posts: 29

PostPosted: Thu May 23, 2013 4:34 am    Post subject: Reply with quote

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:
Option "UseDisplayDevice" "none"
in xorg.conf, lead to black screen.
BTW
can put
Code:
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

into /etc/gdm/PreSession/default?
Back to top
View user's profile Send private message
vinz94f
n00b
n00b


Joined: 25 May 2013
Posts: 5

PostPosted: Sat May 25, 2013 10:27 am    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
Tolstoi
l33t
l33t


Joined: 20 May 2004
Posts: 678

PostPosted: Sun May 26, 2013 7:28 am    Post subject: Reply with quote

First of all thanks for the guide. Works for me so far with startx but leads to a black screen with KDM. Any ideas?
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Sun May 26, 2013 10:57 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun May 26, 2013 11:18 am    Post subject: Reply with quote

@GenBlack:

thanks for the in-depth how-to



might need this in the near future - so *subscribing*
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Tolstoi
l33t
l33t


Joined: 20 May 2004
Posts: 678

PostPosted: Sun May 26, 2013 12:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Sun May 26, 2013 1:47 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Tolstoi
l33t
l33t


Joined: 20 May 2004
Posts: 678

PostPosted: Sun May 26, 2013 4:13 pm    Post subject: Reply with quote

... I guess after KDM?
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun May 26, 2013 4:35 pm    Post subject: Reply with quote

https://wiki.archlinux.org/index.php/Xinitrc

Quote:
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-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Sun May 26, 2013 7:05 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun May 26, 2013 7:09 pm    Post subject: Reply with quote

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-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
dcd94
n00b
n00b


Joined: 28 Mar 2013
Posts: 12

PostPosted: Thu May 30, 2013 2:18 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
jms.gentoo
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2009
Posts: 98

PostPosted: Mon Jun 03, 2013 6:38 pm    Post subject: Reply with quote

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
Quote:

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:
                                                                     
[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:

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:

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:

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
Back to top
View user's profile Send private message
jms.gentoo
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2009
Posts: 98

PostPosted: Tue Jun 04, 2013 2:46 pm    Post subject: Reply with quote

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
Quote:
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
Back to top
View user's profile Send private message
dcd94
n00b
n00b


Joined: 28 Mar 2013
Posts: 12

PostPosted: Tue Jun 04, 2013 6:03 pm    Post subject: Reply with quote

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
Quote:
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
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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