Nvidia – No 3D Support on Lenovo W520 with Nvidia Optimus

graphicsintel graphicsnvidianvidia-optimus

i know about projects like Bumblebee but i don't need them.
I've got a Lenovo W520 and i can choose in the BIOS which graphics card I'd like to use.

And now my problem:
I've installed the nividia-driver and it work's fine but when I switch to the integrated graphics card (Intel) ubuntu isn't able to detect it. It boots up well but Unity 3D doesn't work which means that there is no 3D-support.

What should I do now?

Thanks for your help!

Best Answer

I have seen the Lenovo W520 machines psychically. These provide options to choose between Optimus, Discrete and Integrated mode. Optimus mode still defaults to the Intel graphics card while keeping the Nvidia card on. Discrete just hides the Intel graphics card from the OS. If you wish to take advantage of the nVidia card, you still need Bumblebee for now, or use discrete video mode.

If you switch to the integrated card in BIOS you need to make sure that the nVidia GL libraries are not loaded, otherwise it'll result in broken 3D support. The easiest method is uninstalling the nvidia-current driver. Otherwise, if you want to keep the nvidia drivers (because you frequently switch between Optimus/Nvidia and integrated), a change is needed to control the libraries to be loaded:

Disabling the nvidia libraries (forcing Mesa libraries)

Run the below commands to configure the Mesa libraries as default. One of the commands may fail if you do not have the 64-bit (or 32-bit for the second) libraries.

sudo update-alternatives --set x86_64-linux-gnu_gl_conf /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
sudo update-alternatives --set i386-linux-gnu_gl_conf /usr/lib/i386-linux-gnu/mesa/ld.so.conf
sudo ldconfig

Re-login (or simply reboot) for the changes take effect.

Enabling the nvidia libraries

To enable the nvidia libraries, make the alternatives system automatically choose the best driver available (nvidia takes precedence over Mesa).

sudo update-alternatives --auto x86_64-linux-gnu_gl_conf
sudo update-alternatives --auto i386-linux-gnu_gl_conf
sudo ldconfig

Re-login (or simply reboot) for the changes take effect.