Right nvidia optimus driver configuration

Hi all friends!!:slight_smile:
I’ve a problem with the nvidia driver for my notebook asus k53sj.
The problem is with optimus configuration that switch between the intel integrated graphic card and nvidia card (model :gt 620m). If i install the nvidia official driver the OS begin unstable and sometimes i’ve to reboot because of OS freeze, so i’m working with no nvidia driver but with default nouveau.
Another problem is battery autonomy because of the nvidia card that’s always on even if isn’t used. So my answers is: there’s anyone who can help me with this problem ?
Thanks a lot!! :slight_smile:

You will need to look into this. Bumblebee - NVIDIA Optimus support for Linux!

I am not sure how to set it up on openSUSE. There might be an open build service repo.

Yes there are some good repos for this now.
First, if this laptop can only run in Optimus mode you’re bound to use bumblebee, although you might be able to toggle the mode in the bios settings. If there’s no way to change mode do as follows.

First you should confirm that xorg is restored to what it was before installing the Nvidia driver, use the following command:

glxinfo | grep OpenGL

This should output something like this:

vendor string: Tungsten Graphics, Inc
renderer string: Mesa DRI Intel(R) IGD x86/MMX/SSE2
version string: 1.4 Mesa 7.11

The version numbers may differ, but all 3 lines should be there and glxgears should work, giving about 60 fps.
If you don’t get any DRI, reinstall the package xorg-x11-server. Now you should be ready to install the Nvidia drivers the bumblebee way, if you’re on 12.2 use this repo, otherwise change 12.2 to 12.1 or 11.4:

Index of /repositories/home:/Bumblebee-Project:/nVidia:/latest/openSUSE_12.2

Bumblebee can be installed from the following repo, there’s no 12.1 or 11.4 version but I have tested 12.2 on both 12.2 and 12.1, both 32-bit, and it worked on both:

Index of /repositories/home:/Overman79/openSUSE_12.2

The installer will add your user to the bumblebee group, however I had to manually set up the bumblebee daemon manually under systemd, as root use the following commands:

systemctl enable bumblebeed.service
systemctl start bumblebeed.service

Now logout or reboot and test it, run glxgears, it should give you direct rendering and 60 fps on the Intel chip. To test the Nvidia card run:

optirun glxinfo | grep OpenGL

optirun glxgears

At a minimum you should at least expect that your Nvidia card is powered off on boot, on battery power check your battery state before and after you installed bumblebee, the difference should be significant:

cat /proc/acpi/battery/BAT0/state

That’s it.

Hi, when I type “glxinfo | grep OpenGL” on my terminal. This is what it shows

Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Error: couldn’t find RGB GLX visual or fbconfig
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.
Xlib: extension “GLX” missing on display “:0”.

What does this mean? And how can I fix this to show the vendor name like yours?

I can imagine two reasons, either you followed the install instructions for Nvidia equipped systems and added the option “nomodeset” when you started the installation, this option would then be added to your boot loader. Have a look in yast>system/boot loader configuration>alternatives for bootloader, look at the box “Optional Kernel Command Line Parameter”, if the word “nomodeset” occurs there delete it, save the changes and reboot.

Another explanation might be that you have installed the Nvidia driver the “hard way”, if so uninstall it and reinstall the package xorg-x11-server, reboot and see if that helps.

If nothing of the above helps, post the content of /var/log/Xorg.0.log.

http://img600.imageshack.us/img600/9452/snapshot6i.png

I did your first suggestion, the nomodeset isn’t in the “optional kernel command line paramater”. It is in the “failsafe kernel command line parameter”. Do I need to delete it?

And if what you meant by installing nvidia driver the hard way is by installing it from Yast. Then yes, I installed mine from yast. So will I uninstall it?

No don’t delete it from the failsafe line, problems with graphics hardware and/or drivers is probably the most common cause for using failsafe mode, the “nomodeset” option ensures your system will boot into framebuffer mode, which is much more robust.
And yes, uninstall Nvidia completly, also make sure to disable or delete the Nvidia repo, you’ll install Nvidia from the repo I suggested in post #3.

Hi. I’ ve uninstalled the nvidia driver that I installed and now I’ m getting the one you said that i should get when i enter this command “glxinfo | grep OpenGL”.

But how will I install the driver from the links that you’ve given? I’ m really new to this so I’ m sorry if I don’t know how. :expressionless:

Now you should be ready to install the Nvidia drivers the bumblebee way, if you’re on 12.2 use this repo, otherwise change 12.2 to 12.1 or 11.4:

  	 			 			 				[Index of /repositories/home:/Bumblebee-Project:/nVidia:/latest/openSUSE_12.2](http://download.opensuse.org/repositories/home:/Bumblebee-Project:/nVidia:/latest/openSUSE_12.2/) 			 		

Bumblebee can be installed from the following repo, there’s no 12.1 or 11.4 version but I have tested 12.2 on both 12.2 and 12.1, both 32-bit, and it worked on both:

  	 			 			 				[Index of /repositories/home:/Overman79/openSUSE_12.2](http://download.opensuse.org/repositories/home:/Overman79/openSUSE_12.2/)

Install the Nvidia repo with the following command, as root:

zypper ar -r http://download.opensuse.org/repositories/home:/Bumblebee-Project:/nVidia:/latest/openSUSE_12.2/home:Bumblebee-Project:nVidia:latest.repo


Then open up yast/software/software management, in the show tab select archives or if it is repos in the english version. Now select Downloader and installer for the nVi… . dkms will be preselected, if you’re on 64-bit select dkms-nvidia, nvidia-compute and x11-video-nvidia, if you’re on 32-bit select the corresponding 32-bit packages. Click on accept and you should be done with thw Nvidia stuff.

Now proceed with Bumblebee, start with adding the repo:

zypper ar -r http://download.opensuse.org/repositories/home:/Overman79/openSUSE_12.2/home:Overman79.repo

In yast follow the same procedure as for the Nvidia stuff, except now you select the Bumblebee repo. For 64-bit VirtualGL, bumblebee, dkms-bbswitch, libturbojpeg and profile-sync-daemon, for 32-bit you guess it.

Proceed with rest of the instructions.

Wow. Thank you very much. :slight_smile:
Now, when I run “optirun glxinfo | grep OpenGL”. This are the outputs

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 540M/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 304.64
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler
OpenGL extensions:

Does this mean that I successfully installed the driver for my graphics card?

Yes, that’s the right conclusion. You now can tell applications to use the NVIDIA card like this, using “ppracer” as an example:

optirun ppracer

You could even change the menu item properties for programs that require the NVIDIA to be used, by prefixing the starting command with " optirun "

Yes, but I still think the main benefit is that the system runs cooler and less noisy, and of course the battery will last significantly longer. Optirun is just a nice extra feature.

Which gives me the opportunity to thank you for your post about bumblebee a while ago. I followed it step by step, and all works lke it should, without any manual intervention.

Nice. Thank you very much Sir knurpht and sir hank_se!

One last question, why is it that the 3D driver in my system info is still unknown? Isn’t it supposed to be the nvidia gpu already?

http://img571.imageshack.us/img571/7175/snapshot2b.png

Don’t bother about that, your desktop is running on the Intel chip, it knows nothing about bumblebee or optirun, your in charge now!

Oh okay. Thank you very much for your help. :slight_smile:

I have been investigating installation of nvidia optimus drivers (Bumblebee) on W110ER Clevo Laptop under openSUSE 12.2 64-bit OS. There is no BIOS switch to disable optimus mode on this machine consequently when running under Linux OS the battery drains very quickly (less than 2 hours normal use).

I followed the procedure outlined by hank_se at post #3 above. After installing VirtualGL-2.3.2-4.1.x86_64.rpm from Bumblebee_Overman79 repo Yast2 advised: “To activate the service, run as root # systemctl enable psd.service”. I didn’t understand this, but did so (!) trusting Yast2.

Completed final setup steps suggested by hank_se, rebooted and tested with user:~> optirun glxinfo | grep OpenGL

Failed with messages: [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Failed to load /usr/lib64/xorg/modules/libglamoregl.so: /usr/lib64/xorg/modules/libglamoregl.so: undefined symbol: _glapi_tls_Context AND [ERROR]Aborting because fallback start is disabled.

Found possible solution on Github Bumblebee Project Forum Issue #262 in post by dliw [https://github.com/Bumblebee-Project/Bumblebee/issues/262] (final post in thread, undated, unnumbered) who helpfully advised: “I had the same issue recently and solved this problem by replacing Option “ConnectedMonitor” “DFB” → Option “ConnectedMonitor” “CRT” in the file “xorg.conf.nvidia”… [ie. → XorgConfFile=/etc/bumblebee/xorg.conf.nvidia]”

Amended xorg.conf.nvidia as suggested by dliw and this seems to have solved the error described above.

My grateful thanks to repo maintainers, hank_se and to dliw.

I trust this additional information may be useful to others.

Thank you to the contributors to this thread and the maintainers of the OpenSuse Bumblebee repos. I have had various issues with my Lenovo Ideapad Z580, the most perplexing of which was the rapid battery drain in Linux (which didn’t occur in Win7). Having read the various threads on hybrid graphics, being somewhat intimidated by a tutorial for installing Bumblebee from scratch, I arrived at this thread. The instructions worked without any further intervention from me.

One minor warning: during install of the package dkms-nvidia-310.19-176.1.x86_64 via YaST, it looked as though the system was going to freeze (~15 min of seemingly no activity in YaST). From a process search I discovered that wget was downloading the Nvidia drivers. As I was connected via Wifi at my guest university, which is not a fast connection, this took some time to complete . Fortunately leaving it alone while I got a coffee meant it finished successfully before I could intervene!

I’m getting satisfactory frame rates from glxgears and glxspheres using optirun (~960 FPS and ~120 FPS respectively). More importantly, my battery usage is only about 1200 mA when not using graphics intensive applications. If I use optirun, the battery usage climbs to about 3800 mA. I don’t have numbers for before I got bumblee running, but I can only assume my system was consuming battery at the higher rate - it was running very hot.

Again, many thanks to those who have contributed help and advice.

ReubenG >
One quick question : how can you realize your instant battery consumption ?
Because i checked /proc/acpi/battery/state but didn’t find anything meaningful in this file, nor in the other in the same directory.

Those numbers are quite schocking, although not really surprising, from 3800 down to 1200 mA, that’s up to 30 W inside a small unit like a laptop, no wonder people are having problems with them. They are all designed to run Win7 OEM, tailored for those laptops, running Linux without Bumblebee will drain the battery and bake the chips, the latter even when running on AC.

By the way, did you notice there’s a new command ‘primusrun’ installed from the overman-repo, you might get even better performance with that.

And Christophe_deR you can only get those readings when on battery, use the following command:

cat /proc/acpi/battery/BAT0/state