# [SOLVED][X11][nvidia] startx fails to start

## julien79

Hello

I am new to Gentoo and to this forum.

I am installing Gentoo for the first time, everything was ok until I tried to run startx.

The computer is a Dell Latitude E6420 laptop with the Nvidia GF119M [NVS 4200M] graphics (not mine, but I can use it freely at the moment).

Using the log files, I could repair a few things, but at the end X11 does not work: 

http://pastebin.ca/raw/3238679

I am a bit lost due to lack of experience. Is there something special to investigate at this point?

Thanks a lot

julienLast edited by julien79 on Mon Nov 23, 2015 11:48 pm; edited 1 time in total

----------

## Buffoon

Probably Optimus graphics?

----------

## julien79

Yes. I completely missed it, even the "NVIDIA Driver with Optimus Laptops" page, maybe because I never heard about this technology before. Thank you very much!

----------

## Buffoon

You are welcome!

And welcome to Gentoo and Gentoo Forums.  :Smile: 

----------

## julien79

Thanks again

I tried to follow the documentations, but

1. I cannot get the EDID:

```
get edid
```

returns:

```
Attempting to use i2c interface

Looks like no busses have an EDID. Sorry!

Attempting to use the classical VBE interface

Illegal instruction
```

2. Problems with xrand too:

```
xrandr
```

returns:

```
Can't open display
```

(same with any xrand options)

Reading manual pages about Xorg, xrandr and read-edid did not help. 

Any idea?

----------

## gulivert

Hi,

Ok this laptop seems to have an Intel integrate graphic card?

And if I have good understand you added a new NVIDIA card inside and installed the official NVIDIA-Drivers (also seems from the xorg logs)

If your idea is to use Optimus technology you need to create a specific xorg.conf and add two command in the .xinitrc

Could you provide to us the result of "lspci" and "lshw -c video"

For you info here is my configuration to work with optimus

.xinitrc:

```

#!/bin/bash 

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

...

```

the second and third lines are capital to work with optimus and has to be at the beginning of your xinitrc file as mine.

/etc/X11/xorg.conf

```

Section "ServerLayout"

    Identifier "layout"

    Screen 0 "nvidia"

    Inactive "intel"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    # Change BusID if necessary. Tips: (lspci | grep 3D) (Change 01:00.0 to 1:0:0)

    BusID "PCI:1:0:0"

    Option              "UseEdidDpi" "False"

    Option              "DPI" "96 x 96"

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    Option "AllowEmptyInitialConfiguration" "Yes"

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    # Change BusID if necessary. Tips: (lspci | grep VGA) (Change 00:02.0 to 0:2:0)

    BusID "PCI:0:2:0"

    Option "AccelMethod"  "none"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection

```

Option Option "AllowEmptyInitialConfiguration" "Yes" is also capital for optimus and your xorg complains about this...

Gentoo wiki has a good wiki about this and also Arch linux wiki

About your last post this is normal that you do not get anything because these commands have to be run when X is running from an X session.

Good luck!

----------

## julien79

Thanks gulivert, it's working now.

Actually I needed to install x11-drivers/xf86-video-modesetting which was missing. Also, there was no .xinitrc file, but installing Openbox added it. I could have created it manually, but I wanted to use Openbox anyway.

 *gulivert wrote:*   

> 
> 
> Ok this laptop seems to have an Intel integrate graphic card?
> 
> And if I have good understand you added a new NVIDIA card inside and installed the official NVIDIA-Drivers (also seems from the xorg logs)
> ...

 

Yes it has an Intel graphic card and a Nvidia card, but I did not install any hardware myself (someone gave me this laptop for some time, and I have no idea if the Nvidia card was added as an option or part of the original configuration).

 *Quote:*   

> 
> 
> /etc/X11/xorg.conf
> 
> ```
> ...

 

I am using nearly the same file at the moment. Thanks for this!

 *Quote:*   

> 
> 
> Gentoo wiki has a good wiki about this and also Arch linux wiki
> 
> 

 

I totally agree, these documentations are great. These, and the Linux manual are my main sources for learning!

Best regards

julien

----------

## gulivert

Great news, enjoy your Gentoo!!!

----------

