# [SOLVED] Optimus new nvidia drivers

## GenBlack

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 helpLast edited by GenBlack on Wed May 15, 2013 5:54 pm; edited 1 time in total

----------

## GenBlack

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.

----------

## alfalco

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

Thanks in advance.

alfalco

----------

## GenBlack

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  :Very Happy: 

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

```
nano /etc/modprobe.d/blacklist.conf
```

and add :

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

```
nano /etc/portage/package.keywords
```

And here what I did use :

```

=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.

```
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

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

When that's is done, edit your .xinitrc

```
nano /home/yourusername/.xinitrc
```

And add :

```

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

```

Somes distributions need these line inside the .xsessionrc 

Change your interface for nvidia :

```
eselect opengl list
```

If nvidia is the number 1 of the result :

```
eselect opengl set 1
```

You will have in return :

```
Switching to nvidia OpenGL interface... done
```

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

```
nano /etc/X11/xorg.conf
```

Remove all inside and add :

```

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

```
lspci |grep VGA
```

Return for me 

```

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 

----------

## GenBlack

Done

----------

## alfalco

Thanks for your time.

Great job.

----------

## BeaTtheMeaT666

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?

----------

## GenBlack

 *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.

----------

## beizhuchun

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

```
 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)

----------

## Dr.Willy

Your BusID syntax is probably wrong. Change them to PCI:1:0:0 and PCI:0:2:0

----------

## beizhuchun

 *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 

```
Option "UseDisplayDevice" "none" 
```

 in xorg.conf, lead to black screen.

BTW

can put 

```
xrandr --setprovideroutputsource modesetting NVIDIA-0 

xrandr --auto
```

into /etc/gdm/PreSession/default?

----------

## vinz94f

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"

----------

## Tolstoi

First of all thanks for the guide. Works for me so far with startx but leads to a black screen with KDM. Any ideas?

----------

## Dr.Willy

 *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

----------

## kernelOfTruth

@GenBlack:

thanks for the in-depth how-to

might need this in the near future - so *subscribing*

----------

## Tolstoi

 *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.

----------

## Dr.Willy

 *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 
> ...

 

...which is executed when?

----------

## Tolstoi

... I guess after KDM?

----------

## kernelOfTruth

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

----------

## Dr.Willy

 *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.

----------

## kernelOfTruth

 *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

----------

## dcd94

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

----------

## jms.gentoo

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:

```
                                                                      

[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  

```

```

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

```

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

```

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

----------

## jms.gentoo

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

----------

## dcd94

 *jms.gentoo wrote:*   

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

 

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

----------

## steveL

Great guide, GenBlack. Bookmarked for when I upgrade video-cards :-)

Can I ask, would you mind changing use of nano to nano -w as it's important to get newcomers who are wrestling with an install into using safe commands. It means nano won't truncate long lines.

 *Dr.Willy wrote:*   

> Which in turn means until you log in your screen is black.

 

That's a bit worrying. Is that a temporary issue, or does something need to happen in early init/initrd?

I know Nvidia warn about anything other than default console, which people with wider experience have said doesn't matter, but perhaps it might with newer stuff.

----------

## jms.gentoo

 *dcd94 wrote:*   

> 
> 
> 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 don't have VGA_SWITCHEROO built in

 

Well removing VGA_SWITCHEROO didn't have any impact (this would have been too easy).

Nevertheless from what I read I would advise removing it when using proprietary drivers.

Well I wonder if the following has anything to do with my problem and maybe yours my dear fellow dcd94.

from end of dmesg

```

[   10.479141] vgaarb: this pci device is not a vga device

[   10.792870] vgaarb: this pci device is not a vga device

[   82.715413] vgaarb: this pci device is not a vga device

[   82.767100] vgaarb: this pci device is not a vga device

```

Indeed would this have anything to do with the fact that I have 

```
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) 
```

NVIDIA appear has 3D controller and not something like  VGA compatible controller:

?

I read something about a patch for vgaarb to allow it to recognize 3D controller. I don't know if this has been implemented in kernel. 

I don't know if this is a good lead or not.

Maybe dcd94 if you can post the result of lspci | grep 'VGA\|NVIDIA'  , check if your demsg got  something like " vgaarb: this pci device is not a vga device".

Also

If someone with a NVIDIA card showing up as 3D controller in lspci result got it working using proprietary optimus config from NVIDIA I appreciate if you can do a quick post to let me know that this is not an issue.

thanks

----------

## andrzejk

 *jms.gentoo wrote:*   

> 
> 
> If someone with a NVIDIA card showing up as 3D controller in lspci result got it working using proprietary optimus config from NVIDIA I appreciate if you can do a quick post to let me know that this is not an issue.
> 
> thanks

 

My lspci | grep VGA is looking like this:

```

lspci | grep VGA

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)

```

and my dmesg | grep vgaarb is looking like this:

```

dmesg | grep vgaarb

[   12.218381] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=none:owns=none

[  129.701637] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=none,decodes=none:owns=none

```

But I run into exactly same issue as you did, xorg is seagfoulting in the very same moment, my Xorg.0.log is looking almost the same as yours one.

Also on amd64 arch. If anyone know how to deal with this please let me know.

----------

## Dr.Willy

 *steveL wrote:*   

>  *Dr.Willy wrote:*   Which in turn means until you log in your screen is black. 
> 
> That's a bit worrying. Is that a temporary issue, or does something need to happen in early init/initrd?

 

What issue? You just need to run the xrandr commands. Until you do your screen is black.

----------

## andrzejk

 *Dr.Willy wrote:*   

> What issue? You just need to run the xrandr commands. Until you do your screen is black.

 

I wrote clearly segfault, after startx, the X server is crushing in the very same moment that jms.gentoo reported earlier.

----------

## Dr.Willy

 *andrzejk wrote:*   

>  *Dr.Willy wrote:*   What issue? You just need to run the xrandr commands. Until you do your screen is black. 
> 
> I wrote clearly segfault, after startx, the X server is crushing in the very same moment that jms.gentoo reported earlier.

 

What exactly makes you think I was responding to you …?

----------

## andrzejk

 *Dr.Willy wrote:*   

> What exactly makes you think I was responding to you …?

 

I wrote "same issue" just above your msg, and you asked What issue?  :Very Happy:   :Very Happy: . My mistake srry.

----------

## jms.gentoo

well I am not sure what could be the cause.

I don't think the  3D controller in showing in lspci has anything to do with that.

andrzejk you have a different nvidia card(GeForce GT 540M vsGT 620M ) than me and a different intel  VGA contoller (second generation vs 3 generation).

but we both have the same X segfault

We should have something in common that make X segfault but what?

I think this should have to do with a config option somewhere (kernel?)or a wrong set-up from our part.

laptop is an asus u47vc

I use EFI

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

emerge -p @x11-module-rebuild

[ebuild   R   ~] x11-drivers/xf86-input-evdev-2.8.0

[ebuild   R   ~] x11-drivers/xf86-video-intel-2.21.9

[ebuild   R   ~] x11-drivers/xf86-input-synaptics-1.7.1 

[ebuild   R    ] x11-drivers/nvidia-drivers-319.23

[ebuild   R   ~] x11-drivers/xf86-video-modesetting-0.7.0

[ebuild   R   ~] x11-drivers/xf86-video-vesa-2.3.2-r1
```

/etc/X11/xorg.conf

/root/.xinitrc

/usr/src/linux/.config

emerge --info

I also have

```
####ABI_X86

ABI_X86="64 32"

####for  X ##############

VIDEO_CARDS="intel vesa nvidia"

INPUT_DEVICES="evdev"

#INPUT_DEVICES=" evdev keyboard mouse synaptic"
```

Something to to with VGA?

```
 grep VGA /usr/src/linux/.config

CONFIG_VGA_ARB=y

CONFIG_VGA_ARB_MAX_GPUS=6

# CONFIG_VGA_SWITCHEROO is not set

# CONFIG_VGASTATE is not set

# CONFIG_FB_SVGALIB is not set

# CONFIG_FB_VGA16 is not set

CONFIG_VGA_CONSOLE=y

CONFIG_VGACON_SOFT_SCROLLBACK=y

CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128

# CONFIG_LOGO_LINUX_VGA16 is not set

# CONFIG_USB_SISUSBVGA is not set
```

with Frambuffer(not using UVESA)?

```

CONFIG_FB=y

# CONFIG_FB_DDC is not set

CONFIG_FB_BOOT_VESA_SUPPORT=y

CONFIG_FB_CFB_FILLRECT=y

CONFIG_FB_CFB_COPYAREA=y

CONFIG_FB_CFB_IMAGEBLIT=y

# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set

# CONFIG_FB_SYS_FILLRECT is not set

# CONFIG_FB_SYS_COPYAREA is not set

# CONFIG_FB_SYS_IMAGEBLIT is not set

# CONFIG_FB_FOREIGN_ENDIAN is not set

# CONFIG_FB_SYS_FOPS is not set

# CONFIG_FB_WMT_GE_ROPS is not set

# CONFIG_FB_SVGALIB is not set

# CONFIG_FB_MACMODES is not set

# CONFIG_FB_BACKLIGHT is not set

CONFIG_FB_MODE_HELPERS=y

CONFIG_FB_TILEBLITTING=y

# CONFIG_FB_VGA16 is not set

# CONFIG_FB_UVESA is not set

CONFIG_FB_VESA=y

CONFIG_FB_EFI=y
```

with EFI (I have CONFIG_FB_EFI)?

```
CONFIG_EFI_PARTITION=y

CONFIG_EFI=y

CONFIG_EFI_STUB=y

CONFIG_FB_EFI=y

CONFIG_EFI_VARS=y
```

----------

## andrzejk

Mine configuration is looking like this:

Xorg:

xorg.conf

Kernel:

.config

Emerge --info:

emerge --info

If someone with working configuration could paste his kernel config we could then diff it, to find the difference

----------

## jms.gentoo

andrzejk for your xorg you did try theses pci

```
Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "PCI:1:0:0"

#    Option          "UseEDID"               "off"

EndSection
```

```
Section "Device"

    Identifier "intel"

    Driver "modesetting"

    BusID       "PCI:00:02:00"

EndSection
```

Also are your sure you blacklisted nouveau nv, and other potentialy conflicting modules in your kernel as you have 

```
 VIDEO_CARDS="fbdev intel i915 i965 vesa nvidia nouveau nv modesetting"
```

As for me I didn't have  modesetting in VIDEO_CARDS will give it a go.

Also  andrzejk by the way what the your output of lspci?

----------

## andrzejk

 *jms.gentoo wrote:*   

> andrzejk for your xorg you did try theses pci
> 
> Also  andrzejk by the way what the your output of lspci?

 

same result - same seagfoult with "need to create shared pixmap" at the end.

My lscpi:

lspci

Other nvidia drivers are blacklisted.

----------

## steveL

 *Dr.Willy wrote:*   

> What issue? You just need to run the xrandr commands. Until you do your screen is black.

 

So your screen is black from startup til you run a command?

That issue, you numpty ;)

----------

## joeklow

Much to my disappointment, randr support thus multi-monitor support is awful in these drivers.

Running 3.9.1 kernel, 319.23 drivers, after selecting nvidia via .xinitrc, I can't switch back to intel:

```
>> xrandr --listproviders

Providers: number : 2

Provider 0: id: 0x2b0 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 1 name:NVIDIA-0

Provider 1: id: 0x45 cap: 0x2, Sink Output crtcs: 2 outputs: 4 associated providers: 1 name:modesetting

```

```
>> xrandr --setprovideroutputsource modesetting modesetting

X Error of failed request:  BadValue (integer parameter out of range for operation)

  Major opcode of failed request:  139 (RANDR)

  Minor opcode of failed request:  35 ()

  Value in failed request:  0x45

  Serial number of failed request:  16

  Current serial number in output stream:  17

```

Also, I can't enable external display. The following worked flawlessly with Intel, but doesn't work now:

```
xrandr --output VGA-0 --right-of LVDS-0 --mode 1360x768 
```

TwinView is greyed in nvidia-settings (which attempts to generate a weird pre-optimus aged xorg.conf for static setups), so I have no options to connect the display, and I *suspect* that it still would require to restart X server to change display config with NVIDIA graphics -- so bad for the laptop mode.

----------

## legacy

hi

also in my mac mini (linux3.8.13) i see this

# lspci

```

00:00.0 Host bridge: NVIDIA Corporation MCP79 Host Bridge (rev b1)

00:00.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)

00:03.0 ISA bridge: NVIDIA Corporation MCP79 LPC Bridge (rev b2)

00:03.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)

00:03.2 SMBus: NVIDIA Corporation MCP79 SMBus (rev b1)

00:03.3 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)

00:03.4 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)

00:03.5 Co-processor: NVIDIA Corporation MCP79 Co-processor (rev b1)

00:04.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1)

00:04.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1)

00:06.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1)

00:06.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1)

00:08.0 Audio device: NVIDIA Corporation MCP79 High Definition Audio (rev b1)

00:09.0 PCI bridge: NVIDIA Corporation MCP79 PCI Bridge (rev b1)

00:0a.0 Ethernet controller: NVIDIA Corporation MCP79 Ethernet (rev b1)

00:0b.0 IDE interface: NVIDIA Corporation MCP79 SATA Controller (rev b1)

00:10.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)

00:15.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)

00:16.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)

02:00.0 VGA compatible controller: NVIDIA Corporation C79 [GeForce 9400] (rev b1)

03:00.0 Network controller: Broadcom Corporation BCM4321 802.11a/b/g/n (rev 05)

04:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 07)

```

# lspci | grep VGA

```

02:00.0 VGA compatible controller: NVIDIA Corporation C79 [GeForce 9400] (rev b1)

```

----------

## Mac Tzu

Hey Guys, 

I need a quick hand trying to get this working.

I am running macbook pro retina with GT 650M 

this is my xorg log

```

        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

[    10.237] Initializing built-in extension MIT-SCREEN-SAVER

[    10.383] (EE) Screen 1 deleted because of no matching config section.

[    10.850] (EE) NVIDIA(0): Failed to assign any connected display devices to X screen 0

[    10.868] (EE) NVIDIA(0): Failing initialization of X screen 0

[    10.902] (EE) Screen(s) found, but none have a usable configuration.

[    10.902] (EE) 

[    10.902] (EE) no screens found(EE) 

[    10.902] (EE) 

[    10.902] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.

[    10.902] (EE) 

[    10.918] (EE) Server terminated with error (1). Closing log file.

```

This is the xorg.conf I used 

```

   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 

```

----------

## Holysword

 *jms.gentoo wrote:*   

> 
> 
> If someone with a NVIDIA card showing up as 3D controller in lspci result got it working using proprietary optimus config from NVIDIA I appreciate if you can do a quick post to let me know that this is not an issue.
> 
> thanks

 

Here: 

```
jarvis holysword # lspci | grep 'VGA\|NVIDIA'                                                                                              

00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)

01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)

jarvis holysword #             
```

Just got it working (even though you already know its not particular to the 3D controller thing).

Do you have this

```
Device Drivers ---> 

  <*> /dev/agpgart (AGP Support) ---> 

    <*>  Intel 440LX/BX/GX, I8xx and E7x05 chipset support 

  <*> Intel 8xx/9xx/G3x/G4x/HD Graphics 

  [*]   Enable modesetting on intel by default 
```

in your kernel?

----------

## Witos

andrzejk

jms.gentoo

Did you figure out how to get rid of segfault? I have exactly the same with the GF650M.

----------

## Witos

I've managed to solve crash on my gentoo:

X: 1.14.3

kernel: 3.10.7-gentoo

xrandr: 1.4.1

nvidia-drivers: 331.13

xf86-video-modesetting: 0.8.0

```

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" 

    Option "AllowEmptyInitialConfiguration"

EndSection 

Section "Device" 

    Identifier "intel" 

    Driver "modesetting"

    BusID "PCI:0:2:0"

EndSection 

Section "Screen" 

    Identifier "intel" 

    Device "intel" 

EndSection 

```

and ~/.xinitrc

```

xrandr --setprovideroutputsource 0x46 0x2b4

xrandr --output LVDS-0 --off

xrandr --auto

exec startxfce4

```

Starting X using startx, not /etc/init.d/xdm[/code]

----------

## joeklow

Black screen returned with =nvidia-drivers-331.13.

xorg.conf:

```

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"

    Option "UseDisplayDevice" "none"

    Option      "TwinView"  "on"

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    BusID "PCI:0:2:0"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection

```

.xinitrc

```

...

xrandr --setprovideroutputsource modesetting NVIDIA-0

...

```

The configuration above worked for ~325.08.

X: 1.14.3-r1

libXext: 1.3.2

----------

## Witos

joeklow

Try replacing Option "UseDisplayDevice" "none" with   Option "AllowEmptyInitialConfiguration"

----------

## joeklow

 *Witos wrote:*   

> joeklow
> 
> Try replacing Option "UseDisplayDevice" "none" with   Option "AllowEmptyInitialConfiguration"

 

Black screen.

```

Section "Module"

    Load "fb"

    Load    "extmod"

    SubSection  "extmod"

       Option    "omit xfree86-dga"

    EndSubSection

    Load    "i2c"

    Load    "ddc"

    Load    "vbe"

    Load    "dri"

    Load    "glx"

    Load    "dbe"

    Load    "bitmap"

    Load    "freetype"

    Load    "synaptics"

    Load    "record"

EndSection

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"

    Option "AllowEmptyInitialConfiguration" 

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    BusID "PCI:0:2:0"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection 

```

Any suggestions?

(it's laptop, video @ LVDS-0)

----------

## Witos

joeklow

Try in your .xinitrc:

xrandr --setprovideroutputsource 0x45 0x2b0 

xrandr --output LVDS-0 --off 

xrandr --auto 

exec startxfce4 (or other desktop environment)

----------

## joeklow

 *Witos wrote:*   

> joeklow
> 
> Try in your .xinitrc:
> 
> xrandr --setprovideroutputsource 0x45 0x2b0 
> ...

 

no effect (blackscreen).

----------

## Witos

Joeklow, please post your /var/log/X.0.log of your startx with NVIDIA enabled,maybe I'll figure out sth

----------

## joeklow

 *Witos wrote:*   

> Joeklow, please post your /var/log/X.0.log of your startx with NVIDIA enabled,maybe I'll figure out sth

 

Thanks, but I got it already solved.. took few emerge -uDn's, I guess.

nvidia-drivers-331.13, 

xorg.conf - note, no modules section here!

 *Quote:*   

> 
> 
> Section "ServerLayout"
> 
>     Identifier "layout"
> ...

 

.xinitrc:

```

...

        xrandr --setprovideroutputsource modesetting NVIDIA-0

        xrandr --setprovideroutputsource 0x45 0x2b0

        xrandr --output LVDS-0 --on

        xrandr --auto

...

```

----------

## Tolstoi

Setting 

```

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

```

in .xinitrc got things going for the desktop here. As mentioned in an earlier post this only worked with the startx command because these

settings only kick in after loging in with a user. Too late for DMs like KDM/GDM etc.. 

Somewhere I found a hint (guess it was Archlinux Wiki) to set the xrandr options into /usr/share/config/kdm/Xsetup for KDM. Now I can boot up without KDM turning into a black screen.

----------

## Witos

Joeklow, good news, congrats:

One of those two is redundant for sure:

```

        xrandr --setprovideroutputsource modesetting NVIDIA-0 

        xrandr --setprovideroutputsource 0x45 0x2b0 

```

And I doubt whether this:

```

   xrandr --output LVDS-0 --on 

```

changes anything.

----------

## iSmashStacks

hello guys i can't get it working... stuck on black screen as well.

kernel: 3.9.6 (zenkernel)

xorg-server: 1.14.3-r2

nvidia-drivers: 331.13

.xinitrc

```

xrandr --setprovideroutputsource Intel NVIDIA-0 

xrandr --auto

exec startfluxbox

```

I've changed "modesetting" to "Intel" here bcause xrandr couldn't find modesetting provider:

xrandr --listproviders output provided when i run startx without a xorg.conf file.

```

Providers: number : 1

Provider 0: id: 0x47 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:Intel

```

xorg.conf

```

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" 

    # Option "UseDisplayDevice" "none" 

    # Option "AllowEmptyInitialConfiguration"

EndSection 

Section "Device" 

    Identifier "intel" 

    Driver     "modesetting" 

    BusID      "PCI:0:2:0" 

EndSection 

Section "Screen" 

    Identifier "intel" 

    Device     "intel" 

EndSection 

```

lspci | grep VGA

```

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 525M] (rev a1)

```

Any clue?

Xorg.0.log

http://bpaste.net/raw/141057/

Looks like xrandr --listproviders is not showing up anything when i run startx with the new xorg.conf.

I get: Could not find provider with name Intel.

I tried also modesettings and i get same error but with modesetting instead of Intel.

If i try to run xrandr --listproviders while black screen it couldn't connect to display :0.0.

Please help  :Sad: 

----------

## Atmmac

No Clue how you guys got this working. I tried everything here and I am having the falling off the bus issue as documented here... https://devtalk.nvidia.com/default/topic/567297/linux/linux-3-10-driver-crash/1

This has been broken for three months i am on 3.10.7-gentoo-r1 and nvidia 331.

[   64.287867] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  331.13  Sun Sep 29 22:56:10 PDT 2013

[   64.295640] nvidia 0000:01:00.0: irq 46 for MSI/MSI-X

[   75.340770] NVRM: GPU at 0000:01:00.0 has fallen off the bus.

[   75.340774] NVRM: os_pci_init_handle: invalid context!

[   75.340776] NVRM: os_pci_init_handle: invalid context!

[   75.340779] NVRM: GPU at 0000:01:00.0 has fallen off the bus.

[   75.340780] NVRM: os_pci_init_handle: invalid context!

[   75.340781] NVRM: os_pci_init_handle: invalid context!

[   75.359937] NVRM: RmInitAdapter failed! (0x25:0x28:1157)

[   75.359943] NVRM: rm_init_adapter failed for device bearing minor number 0

[   75.359958] NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5

[   75.360184] NVRM: request_irq() failed (-22)

----------

## Witos

iSmashStacks:

[qoute]I've changed "modesetting" to "Intel" here bcause xrandr couldn't find modesetting provider[/quote]

Do you have modesetting installed?

If not install it. 

1. Make sure you have CONFIG_DRM=YES in your kernel  

2. Make sure that your BusID in Section "Device" for both "nvidia" and "intel" are correct

3. Uncomment AllowEmptyInitialConfiguration in xorg.conf

4. Print how the output of xrandr --listproviders look like after startx.

----------

## Atmmac

Alright guys I finally got this working. Updating to kernel 3.12.0 solved every problem I had.

Make sure your make.conf has the following

VIDEO_CARDS="intel nvidia"

and you have the following blacklisted

blacklist nouveau

blacklist rivafb                                                                                                                                                                 

blacklist nvidiafb                                                                                                                                                               

blacklist rivatv                                                                                                                                                                 

blacklist nvidia

Upgrade your kernel to 3.12.0

You will need to add 

sys-kernel/gentoo-sources

to your /etc/portage/pakage.accept_keywords

Emerge gentoo-sources

eselect kernel list

eselect kernel set <new kernel>

cd /usr/src/linux

configure your new kernel or use genkernel.

drop the newly configured kernel into /boot

cp arch/x86_64/boot/bzImage /boot/kernel-3.12.0-gentoo

use genkernel to create an initramfs

genkernel --install initramfs

modify /boot/grub/grub.conf with new kernel name and initramfs

boot into new system

perform a @module-rebuild

i got an error here when first doing an optirun so go ahead and unmerge the following

emerge --unmerge bbswitch bumblebee

emerge --depclean

remove all old packages

then re emerge

emerge bumblebee bbswitch

This will pull in a couple of dependencies.

Reboot the system and you should be golden.

I know most of this is in the manual and i probably missed something. This issue really should have been fixed by nvidia in the 3.10 kernel but w/e.

Just trying to give back after weeks of torture.

Thanks!

----------

## ftomassetti

Hi,

I have this working (but without window manager for same reason) if I run startx but not on GDM (screen remains black).

I understand it is because I need to run xrandr before GDM start.

I added a script in /etc/X11/xinit/xinitrc.d/ and made it executable

```

#!/bin/sh

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

```

still nothing... do you have any idea where should I put those lines?

----------

## ftomassetti

Ok, to make it work with GDM I put those lines into /etc/X11/gdm/Init/Default

Probably it is not the best solution but it works.

The problem is that it clones by monitors... I can not set anymore a large desktop on two screens

----------

## Valheru_pl

Hi,

Kernel 3.10.17

OS Slackware 14.1 x86_64

nvidia-settings:  version 331.20  Wed Oct 30 18:20:32 PDT 2013

Xorg /etc/X11/xorg.conf

```
Section "ServerLayout"

    Identifier     "layout"

    Screen      0  "nvidia" 0 0

    Inactive       "intel"

    InputDevice    "Keyboard0" "CoreKeyboard"

    InputDevice    "Mouse0" "CorePointer"

EndSection

Section "InputDevice"

    # generated from default

    Identifier     "Keyboard0"

    Driver         "keyboard" 

EndSection

Section "InputDevice"

    # generated from default

    Identifier     "Mouse0" 

    Driver         "mouse"  

    Option         "Protocol" "auto"

    Option         "Device" "/dev/psaux"

    Option         "Emulate3Buttons" "no"

    Option         "ZAxisMapping" "4 5"  

EndSection

Section "Monitor"

    Identifier     "Monitor0"

    VendorName     "Unknown" 

    ModelName      "Unknown" 

    Option         "DPMS"

EndSection

Section "Device"

    Identifier     "nvidia"

    Driver         "nvidia"

    BusID          "PCI:01:00:0"

EndSection

Section "Device"

    Identifier     "intel"

    Driver         "modesetting"

EndSection

Section "Screen"

    Identifier     "nvidia"

    Device         "nvidia"

    Monitor        "Monitor0"

    Option         "UseDisplayDevice" "none"

    SubSection     "Display"

        Modes      "nvidia-auto-select"

    EndSubSection

EndSection

Section "Screen"

    Identifier     "intel"

    Device         "intel"

    Monitor        "Monitor0"

EndSection
```

Xinit /etc/X11/xinit/xinitrc 

```
#!/bin/sh

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

[...etc...]    

startkde

```

Where's the point? KDE starting correctly, I can clone display to the external HDMI monitor BUT i can not set anymore a large desktop on two screens :/ My external Monitor on HDMI has a black screen, and turn off.

Do you have any idea what's wrong?

Thx a lot,

webster / Valheru

----------

## Witos

Valheru_pl,

You need to you nvidia-settings for 2 monitor set-up I think.

----------

## Arthanis

Well, I just bought a laptop with optimus technology, and I tried bumblebee and didn`t like it. I read around and I understand that it is now possible to use the nvidia gpu without bumblebee even though my laptop lacks a hardware muxer to disable the intel.

So and followed all the instructions here but couldn' t get it to work. I uninstalled xdm and bumblebee to make things simplier.

These are my adapters:

```

lspci -v |grep VGA

00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06) (prog-if 00 [VGA controller])

lspci -v |grep 3D 

01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev a2)

```

Here is my pci devices and kernel modules being used:

```

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)

   Subsystem: CLEVO/KAPOK Computer Device 2300

00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)

   Kernel driver in use: pcieport

00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: i915

   Kernel modules: i915

00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: snd_hda_intel

   Kernel modules: snd_hda_intel

00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: xhci_hcd

00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: mei_me

   Kernel modules: mei_me

00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: ehci-pci

00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: snd_hda_intel

   Kernel modules: snd_hda_intel

00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)

   Kernel driver in use: pcieport

00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)

   Kernel driver in use: pcieport

00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)

   Kernel driver in use: pcieport

00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: ehci-pci

00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: lpc_ich

00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: ahci

00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)

   Subsystem: CLEVO/KAPOK Computer Device 2300

01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev a2)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: nvidia

   Kernel modules: nvidia

03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)

   Subsystem: Intel Corporation Centrino Advanced-N 6235 AGN

   Kernel driver in use: iwlwifi

   Kernel modules: iwlwifi

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)

   Subsystem: CLEVO/KAPOK Computer Device 2300

04:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)

   Subsystem: CLEVO/KAPOK Computer Device 2300

   Kernel driver in use: r8169

```

Here is my full dmesg on boot:  http://pastebin.com/T1STepGj

Nvidia seems to load fine:

```

g1310max linux # dmesg |grep -i nvidia

[    2.140090] nvidia: module license 'NVIDIA' taints kernel.

[    2.171864] Modules linked in: nvidia(PO+) iwldvm snd_hda_codec_via i915(+) snd_hda_codec_generic joydev coretemp iwlwifi snd_hda_intel snd_hda_codec mei_me drm_kms_helper mei snd_hwdep

[    2.172645] CPU: 2 PID: 1343 Comm: nvidia-smi Tainted: P          IO 3.14.14-gentoo #26

[    2.175708]  [<ffffffffa07c86e7>] nvidia_open+0x567/0x8f0 [nvidia]

[    2.175868]  [<ffffffffa07d2dcf>] nvidia_frontend_open+0x4f/0xa0 [nvidia]

[    4.888691] [drm] Initialized nvidia-drm 0.0.0 20130102 for 0000:01:00.0 on minor 1

[    4.888746] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  340.24  Wed Jul  2 14:24:20 PDT 2014

```

Although there are some warnings in kernel about intel:

```

g1310max linux # dmesg |grep -i vga

[    0.000000] Console: colour VGA+ 80x25

[    0.148899] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none

[    0.149048] vgaarb: loaded

[    0.149137] vgaarb: bridge control possible 0000:00:02.0

[    2.070477] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem

[    2.205517] [drm] GMBUS [i915 gmbus vga] timed out, falling back to bit banging on pin 2

```

I don`t know what is it about this timeout warning.

I have enabled intel kernel mode setting with intel_agpgart and intel drivers, here is my complete kernel config:

http://pastebin.com/LvsuqA0T

Relevant kernel config entries:

```

CONFIG_DRM=y

CONFIG_DRM_KMS_HELPER=m

CONFIG_DRM_KMS_FB_HELPER=y

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

# CONFIG_DRM_I2C_CH7006 is not set

# CONFIG_DRM_I2C_SIL164 is not set

# CONFIG_DRM_I2C_NXP_TDA998X is not set

# CONFIG_DRM_TDFX is not set

# CONFIG_DRM_R128 is not set

# CONFIG_DRM_RADEON is not set

# CONFIG_DRM_NOUVEAU is not set

CONFIG_DRM_I810=m

CONFIG_DRM_I915=m

CONFIG_DRM_I915_KMS=y

CONFIG_DRM_I915_FBDEV=y

# CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set

# CONFIG_DRM_I915_UMS is not set

# CONFIG_DRM_MGA is not set

# CONFIG_DRM_SIS is not set

# CONFIG_DRM_VIA is not set

# CONFIG_DRM_SAVAGE is not set

# CONFIG_DRM_VMWGFX is not set

# CONFIG_DRM_GMA500 is not set

# CONFIG_DRM_UDL is not set

# CONFIG_DRM_AST is not set

# CONFIG_DRM_MGAG200 is not set

# CONFIG_DRM_CIRRUS_QEMU is not set

# CONFIG_DRM_QXL is not set

# CONFIG_DRM_BOCHS is not set

```

I also have x11-drivers/xf86-video-intel,  xf86-video-modesetting, nvidia-drivers and x11-base/xorg-drivers (with VIDEO_CARDS="intel modesetting nvidia") on their latest versions:

```

eix xorg-drivers

[I] x11-base/xorg-drivers

     Available versions:  1.9 1.10 1.11 1.12 1.13 1.14 1.15 ~1.16 {INPUT_DEVICES="acecad aiptek elographics evdev fpit hyperpen joystick keyboard mouse mutouch penmount synaptics tslib vmmouse void wacom" VIDEO_CARDS="apm ark ast chips cirrus dummy epson fbdev fglrx freedreno geode glint i128 i740 impact intel mach64 mga modesetting neomagic newport nouveau nv nvidia omap omapfb qxl r128 radeon radeonsi rendition s3 s3virge savage siliconmotion sis sisusb sunbw2 suncg14 suncg3 suncg6 sunffb sunleo suntcx tdfx tga trident tseng v4l vesa via virtualbox vmware voodoo"}

     Installed versions:  1.15(12:34:58 08/04/14)(INPUT_DEVICES="evdev keyboard mouse synaptics -acecad -aiptek -elographics -fpit -hyperpen -joystick -mutouch -penmount -tslib -vmmouse -void -wacom" VIDEO_CARDS="intel modesetting nvidia -apm -ast -chips -cirrus -dummy -epson -fbdev -fglrx -freedreno -geode -glint -i128 -i740 -mach64 -mga -neomagic -nouveau -nv -omap -omapfb -qxl -r128 -radeon -radeonsi -rendition -s3virge -savage -siliconmotion -sisusb -sunbw2 -suncg14 -suncg3 -suncg6 -sunffb -sunleo -suntcx -tdfx -tga -trident -tseng -v4l -vesa -via -virtualbox -vmware -voodoo")

eix -I xf86 

[I] x11-drivers/xf86-video-intel

     Available versions:  ~*2.9.1 2.19.0 2.20.13 2.21.15 ~2.99.903 ~2.99.905-r1 ~2.99.906 ~2.99.907-r1 ~2.99.909 ~2.99.910 ~2.99.911-r1 ~2.99.912 ~2.99.912-r1 ~2.99.914 {debug dri glamor (+)sna +udev uxa xvmc}

     Installed versions:  2.21.15(11:12:21 08/04/14)(dri sna udev -glamor -uxa -xvmc)

     Description:         X.Org driver for Intel cards

[I] x11-drivers/xf86-video-modesetting

     Available versions:  0.8.1 ~0.9.0

     Installed versions:  0.8.1(10:43:55 08/04/14)

     Description:         Unaccelerated generic driver for kernel modesetting

[I] x11-drivers/nvidia-drivers

     Available versions:  96.43.23^msd 173.14.39^msd 304.123^msd 331.89^msd 334.21-r3^msd 337.25^msd 340.24^msd {+X acpi custom-cflags gtk multilib pax_kernel (+)tools uvm KERNEL="FreeBSD linux"}

     Installed versions:  340.24^msd(12:02:08 08/04/14)(X acpi tools -multilib -pax_kernel -uvm KERNEL="linux -FreeBSD")

     Description:         NVIDIA Accelerated Graphics Driver

```

 As well, the respective modules are loaded:

 *Quote:*   

> 
> 
> lsmod
> 
> Module                  Size  Used by
> ...

 

Also, I tried to recompile mesa specifically with i915 VIDEO_CARDS variable to no avail:

```

[I] media-libs/mesa

     Available versions:  [M]7.10.3 [M]7.11.2 [M]8.0.4-r1 [M]~9.0.3 9.1.6 ~9.2.5-r1 10.0.4 ~10.1.0 ~10.1.1 ~10.1.3 ~10.1.4 ~10.1.6 ~10.2.1 ~10.2.2 ~10.2.4 {bindist +classic debug +dri3 +egl g3dvl +gallium gbm gles gles1 gles2 hardened (+)llvm (+)llvm-shared-libs motif +nptl opencl openmax openvg osmesa pax_kernel pic r600-llvm-compiler selinux shared-dricore +shared-glapi vdpau wayland xa xorg xvmc ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="FreeBSD" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" VIDEO_CARDS="freedreno i915 i965 ilo intel mach64 mga nouveau r100 r128 r200 r300 r600 radeon radeonsi savage sis tdfx via vmware"}

     Installed versions:  10.0.4(12:38:13 08/04/14)(classic egl gallium gbm llvm nptl xa -bindist -debug -gles1 -gles2 -llvm-shared-libs -opencl -openvg -osmesa -pax_kernel -pic -r600-llvm-compiler -selinux -vdpau -wayland -xvmc ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="-FreeBSD" VIDEO_CARDS="i965 intel -freedreno -i915 -ilo -nouveau -r100 -r200 -r300 -r600 -radeon -radeonsi -vmware")

```

I think it's also worth mentioning that I had to set a kernel command line on grub to get modesetting on kernel:

```

cat /etc/default/grub |grep 915

GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=edid/g1310max.bin i915.modeset=1"

cat /sys/module/i915/parameters/modeset 

1

```

The only way I get my Xorg to work is if I don' t have a /etc/X11/xorg.conf file at all, which give me the following /var/log/Xorg.0.log:

http://pastebin.com/rC10K0wf

Which seems to yield intel i965 driver with kms correctly:

```

cat /var/log/Xorg.0.log |grep -i intel

[   602.720] (==) Matched intel as autoconfigured driver 0

[   602.720] (==) Matched intel as autoconfigured driver 3

[   602.720] (II) LoadModule: "intel"

[   602.720] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so

[   602.723] (II) Module intel: vendor="X.Org Foundation"

[   602.724] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:

[   602.730] (II) intel(0): Creating default Display subsection in Screen section

[   602.730] (==) intel(0): Depth 24, (--) framebuffer bpp 32

[   602.730] (==) intel(0): RGB weight 888

[   602.730] (==) intel(0): Default visual is TrueColor

[   602.730] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 4600

[   602.730] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2

[   602.730] (**) intel(0): Framebuffer tiled

[   602.730] (**) intel(0): Pixmaps tiled

[   602.730] (**) intel(0): "Tear free" disabled

[   602.730] (**) intel(0): Forcing per-crtc-pixmaps? no

[   602.730] (II) intel(0): Output eDP1 has no monitor section

[   602.730] (--) intel(0): found backlight control interface acpi_video0 (type 'firmware')

[   602.730] (II) intel(0): Output VGA1 has no monitor section

[   602.730] (II) intel(0): Output DP1 has no monitor section

[   602.730] (II) intel(0): Output HDMI1 has no monitor section

[   602.730] (--) intel(0): Output eDP1 using initial mode 1920x1080 on pipe 0

[   602.730] (==) intel(0): DPI set to (96, 96)

[   602.731] (II) intel(0): SNA initialized with Haswell (gen7.5, gt2) backend

[   602.731] (==) intel(0): Backing store enabled

[   602.731] (==) intel(0): Silken mouse enabled

[   602.731] (II) intel(0): HW Cursor enabled

[   602.731] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.

[   602.731] (==) intel(0): DPMS enabled

[   602.731] (II) intel(0): [DRI2] Setup complete

[   602.731] (II) intel(0): [DRI2]   DRI driver: i965

[   602.731] (II) intel(0): direct rendering: DRI2 Enabled

[   602.731] (==) intel(0): hotplug detection: "enabled"

[   602.738] (II) intel(0): switch to mode 1920x1080@60.0 on pipe 0 using eDP1, position (0, 0), rotation normal

[   602.747] (II) intel(0): Setting screen physical size to 508 x 285

[   602.791] (II) config/udev: Adding input device HDA Intel HDMI HDMI (/dev/input/event10)

[   602.791] (II) config/udev: Adding input device HDA Intel PCH Mic (/dev/input/event7)

[   602.791] (II) config/udev: Adding input device HDA Intel PCH Front Headphone (/dev/input/event6)

[   602.843] (II) intel(0): EDID vendor "CMN", prod id 4931

[   602.843] (II) intel(0): Printing DDC gathered Modelines:

[   602.843] (II) intel(0): Modeline "1920x1080"x0.0  138.78  1920 1966 1996 2080  1080 1082 1086 1112 -hsync -vsync (66.7 kHz eP)

[   602.843] (II) intel(0): Modeline "1920x1080"x0.0   92.52  1920 1966 1996 2080  1080 1082 1086 1112 -hsync -vsync (44.5 kHz e)

```

Although I'm not sure because of the last line of this snippet:

```

cat /var/log/Xorg.0.log |grep -i modesetting

[   602.720] (==) Matched modesetting as autoconfigured driver 4

[   602.723] (II) LoadModule: "modesetting"

[   602.723] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so

[   602.723] (II) Module modesetting: vendor="X.Org Foundation"

[   602.724] (II) modesetting: Driver for Modesetting Kernel Drivers: kms

[   602.729] (WW) Falling back to old probe method for modesetting

```

Does this fallback mean that kms isn't working?

Anyway, without the xorg file, I get a funcional X environment, but without 3D acceleration:

```

glxinfo                

name of display: :0.0

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Error: couldn't find RGB GLX visual or fbconfig

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Error: couldn't find RGB GLX visual or fbconfig

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

Xlib:  extension "GLX" missing on display ":0.0".

```

So, following this topic, I tried with the following xorg.conf:

```

cat /etc/X11/xorg.conf 

Section "ServerLayout" 

    Identifier "layout" 

    Screen 0 "nvidia" 

    Inactive "intel" 

EndSection 

Section "Device" 

    Identifier "nvidia" 

    Driver "nvidia" 

    BusID "PCI:1: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:0:02.0"

EndSection 

Section "Screen" 

    Identifier "intel" 

    Device "intel" 

EndSection 

```

And with the following contents from .xinitrc :

```

cat .xinitrc 

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto 

exec startxfce4 --with-ck-launch

```

Which gives me the following Xorg.0.log:

http://pastebin.com/3d3RUSdT

It seems to try to load nvidia xorg module, but fails (which seems to be the root of my problem):

```

Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

```

Which is strange, because everything seems to be in order. Any help would be appreciated. Thank you very much in advance.

----------

## Maffblaster

I'm glad I'm not the only one who's spent more than one weekend trying to get proprietary nvidia-drivers working. I don't have access to the machine I'm using right now, but when I get home tonight I'm excited to try what I've seen in this thread. I'll post my results either way; if I get it working I'm going to update the article on the wiki so that others can have an easier time...who wants to spend more time than they need to trying to set up multiple monitors to be productive?   :Rolling Eyes: 

See this article for the "official" Gentoo guide:

https://wiki.gentoo.org/wiki/NVIDIA_Driver_with_Optimus_Laptops

More to come!

----------

## logistiker

I posted a working opengl accelerated intel xorg.conf file and a working opengl accelerateded nvidia optimus xorg.conf file here if anyone is interested.  

https://forums.gentoo.org/viewtopic-p-7630612.html#7630612

Note that if you enable Nvidia Optimus at the moment, you might have random freezes which will require you to disable the touchpad or convert it to a regular mouse.

----------

## Maffblaster

logistiker, Thanks for the reply. I had pretty much given up on the issue. It looks like I'll have to try to get it working using advice from that thread. It also looks like I had my configuration right. I think the thing I did wrong was not referencing the EDID correctly (or possibly generating an EDID that was incorrect).

It would be nice if someone wrote a tutorial on how to generate a EDID for the monitors as well and the exact places it needs to be referenced. I.E. does it need to be referenced at /etc/default/grub like this Gentoo Wiki tutorial suggests: https://wiki.gentoo.org/wiki/NVIDIA_Driver_with_Optimus_Laptops?

```
GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=edid/1920x1080_clevo_W670SR.bin"

GRUB_GFXMODE=1920x1080
```

If you have the time, I'm sure myself and the Gentoo community would appreciate you writing up an EDID guide so that people here in the forums can point others to it as a reference. Or if you want to write out the necessary steps on here for me, I'll put it in the wiki (if you give me your permission).   :Very Happy: 

----------

## logistiker

 *Maffblaster wrote:*   

> logistiker, Thanks for the reply. I had pretty much given up on the issue. It looks like I'll have to try to get it working using advice from that thread. It also looks like I had my configuration right. I think the thing I did wrong was not referencing the EDID correctly (or possibly generating an EDID that was incorrect).
> 
> It would be nice if someone wrote a tutorial on how to generate a EDID for the monitors as well and the exact places it needs to be referenced. I.E. does it need to be referenced at /etc/default/grub like this Gentoo Wiki tutorial suggests: https://wiki.gentoo.org/wiki/NVIDIA_Driver_with_Optimus_Laptops?
> 
> ```
> ...

 

You can just follow the guide on https://wiki.gentoo.org/wiki/NVIDIA_Driver_with_Optimus_Laptops for generating the EDID firmware file.   Also note that you will definitely need the xrandr commands as well in /usr/share/config/kdm/Xsetup if you're using kdm, otherwise you will get a blank screen when starting:

```
xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto
```

I also noted that the kdm login screen is screwed up as well (multiple squares) but you can still log in with it and everything is fine after that (minus the freeze issue).

----------

## gulivert

Hi guys,

I took 2h to get Optimus working on my Macbook Pro 9.1, read everything here and did not find what was wrong with my configuration.

And do you know what? It was just my .xinitrc !!!

When it was not working it was looking like this :

```
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

setxkbmap ch fr -model macbook78 &

xbindkeys &

xterm -e mc &

xterm -e mutt &

xterm &

exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome

```

I just modified like this:

```
xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources

setxkbmap ch fr -model macbook78 &

xbindkeys &

xterm -e mc &

xterm -e mutt &

xterm &

exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome

```

If this can help someone! Good luck !

Now if someone can tell me how I can check which card is actually running I will be happy.

I will also by happy to find the way to fix the TTY black screen after the startx command when using NVIDIA-DRIVERS  :Sad: 

Regards,

----------

## NeddySeagoon

gulivert,

You are always using the Intel graphics as its the only graphics you have that can read the pixel buffer to the display.

Attempting to use the nVidia on its own gets you a blank screen, since it is not connected to the display surface.

All the nVidia graphics can do is draw into the pixel buffer for the Intel chip to transfer to the display.

You need to explicitly switch to the nVidia chip for drawing. If you haven't done that, you are only using the Intel graphics.

I think its an xrandr command.

----------

## gulivert

@NeddySeagoon

Ok I see, thank you for your explanations  :Smile: 

----------

