I've recently got a Dell XPS L702X laptop and I was trying to get Nvidia Optimus GPU switching to work in Ubuntu 12.04, through Bumblebee but when running "optirun", I was getting this error:
[ERROR]Cannot access secondary GPU - error: XORG NVIDIA(0): No display devices found for this X screen.
After trying various different solutions available on the Bumblebee wiki and other websites, I've finally found one that worked, so I though I'd share it with you, in case you encounter the same issue as me.
Note: this has only been tested with Dell XPS L702X and may or may not work for other laptops.
Get Bumblebee working in Ubuntu 12.04 (tested on Dell XPS L702X)1. Firstly, install Bumblebee if it's not already installed. If you've messed with the Bumblebee config files, it's probably best to revert them to their default values - you can do this by purging and then installing Bumblebee back:
sudo apt-get purge bumblebee sudo apt-get install bumblebee
2. Now, to apply the workaround for getting Bumblebee to work:
You can see if you have the "nvidia-current" or "nvidia-current-updates" driver installed by searching for "nvidia-current" in in Synaptic.
If you are using the nvidia-current driver, copy/paste the following code in a terminal, as a single command (select all the code and paste it):
echo 'Section "ServerLayout" Identifier "Layout0" Option "AutoAddDevices" "true" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" Option "NoLogo" "true" Option "UseEDID" "true" Option "ConnectedMonitor" "DFP" EndSection' | sudo tee /usr/share/X11/xorg.conf.d/10-nvidia-current-latitude-e6530.conf
If you're using the nvidia-current-updates driver, copy/paste the following code in a terminal window, as a single command:
echo 'Section "ServerLayout" Identifier "Layout0" Option "AutoAddDevices" "true" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" Option "NoLogo" "true" Option "UseEDID" "true" Option "ConnectedMonitor" "DFP" EndSection' | sudo tee /usr/share/X11/xorg.conf.d/10-nvidia-current-updates-latitude-e6530.conf
After you're done, restart your computer and run "optirun glxspheres" in a terminal to see if Bumblebee / Nvidia Optimus is working correctly - you shouldn't see the error anymore and instead, something like this should be displayed:
And obviously, glxspheres should start and the framerate should be singnificantly better than running "glxspheres" without "optirun".
andrei@andrei-desktop:~$optirun glxspheres Polygons in scene: 62464 Visual ID of window: 0x21 Context is Direct OpenGL Renderer: GeForce GT 555M/PCIe/SSE2 108.341661 frames/sec - 120.909294 Mpixels/sec 115.823392 frames/sec - 129.258905 Mpixels/sec 118.948088 frames/sec - 132.746066 Mpixels/sec 118.903546 frames/sec - 132.696357 Mpixels/sec 119.179362 frames/sec - 133.004168 Mpixels/sec