Need help with xorg.conf: KDE won't start when using an NVIDIA card

Hello. I can’t get a KDE4 session to start with nvidia’s graphics driver.

I’m using OpenSuse 12.2 x64 on an HP ENVY dv6 laptop. After installing the nvidia drivers and running nvidia-config, X11 would not start and threw an error about number of devices and monitors being different. When I deleted everything from xorg.conf, it was empty before nvidia-config, startx launches a KDE4 session and everything works (including running CUDA applications) except for anything using openGL. From Xorg.0.log I found out that X11 was using an intel driver for an Intel chipset (I wasn’t even aware the laptop had one, since Windows didn’t see it) together with a libglx made by Nvidia for their own driver. Hence the broken openGL.

Xorg.1.log for an empty/missing xorg.conf (it’s 1 now for some reason): 4848.990] X.Org X Server 1.12.3 Release Date: 2012-07-09 4848.990] X Pr - Pastebin.com](http://pastebin.com/gk17YDwX)

So I tried to manualy specify the corect grafics card in xorg.conf using the PCI adress I got from

# lspci | grep VGA

Here is what I now have for xorg.conf:


# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 319.49  (buildmeister@swio-display-x64-rhel04-03)  Tue Aug 13 20:42:18 PDT 2013

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
EndSection

Section "Files"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "Nvidia Corporation"
    BusID          "PCI:1:0:0"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
#    Option       "Monitor-LVDS1" "LVDS1 monitor"
    HorizSync       30-94
    VertRefresh       48-85
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device1"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    Modes        "1366x786"
    EndSubSection
EndSection



Running startx with this results in a black screen with a cursor in the top left corner. Xorg.0.log says that the nvidia driver is in use, but the only monitor it is conected to is CRT-0, which produces no EDID.

Xorg.0.log: 1766.835] X.Org X Server 1.12.3 Release Date: 2012-07-09 1766.835] X Pr - Pastebin.com](http://pastebin.com/krJsNznD)

I even tried specifying that the same monitor as the intel card was using should be used (commented out in above xorg.conf), but the log (not shown) said that CRT-0 is the only one available to the nvidia card and X11 defaulted to that.

Any ideas as to what I should do? I need both the CUDA capability I get from the nvidia drivers and the ability to use openGL to visualise the results I get from programs I run using CUDA.

Any help would be appreciated.

I note that the DNVY DV6 is offered with a few different graphics card options. The Xorg.0.log does suggest that you have an Intel chipset. (Probably Intel 4000 based on the specs I’ve googled.)

From what I see I get the laptop has an NVIDIA Optimus configuration, i.e. an integrated Intel, a discrete NVIDIA. To get this working, you need Bumblebee. A good guide to get this working can be found here: Smithfarm - the Brain: openSUSE 12.3: How to install ‘bumblebee’ for NVIDIA Optimus VGA

Yes, that could well be the case, although strange that the OP didn’t seem to be aware of that…

Yes, I wasn’t aware of that, thank you. Using Bumblebee did help. The only problem now is that Bumblebee turns off the nvidia card whenever it is not in use by openGL applications. So I have to run my CUDA applicaions using

# optirun mycudaapp

Is there a way to tell Bumblebee to either leave the nvidia card on or make “optirun” implicit when running anything from the command line?

First: don’t use bumblebee / run apps with root permissions.
Second: ATM optirun/primusrun is the way to run apps on the NVIDIA. A thing to consider is to use the menu-editor and replace the commands as they are by “optirun command”.