NVIDIA Optimus Notebook - primus not working

Dear Community,

since I started my new job 6 months ago I switched almost entirely from Windows to Linux as my choice for my operating system. And for usual work it is a great experience. Unfortunately I didn’t manage to get bumblebee/primus working on my notebook which is necessary to play games on steam and (apparently) to use OpenGL desktop effects.

I installed the latest propriety grafics card driver and bumblebee. Unfortunately its not working. I can, however, use optirun to verify the general functionality of my NVIDIA chip.

When I try to run
$ primusrun glxspheres
I get
primus: fatal: broken GLX on main X display.

Can anyone help me with this?

Best regards

PS: I am using openSUSE 13.1 KDE with a ASUS N61jv Notebook.

You don’t need Bumblebee to use OpenGL desktop effects.
But as you apparently installed the normal nvidia driver, you broke intel’s OpenGL. And the system (including the desktop) normally runs on the intel chip.

I installed the latest propriety grafics card driver and bumblebee. Unfortunately its not working.

Right.
You should not install the proprietary nvidia driver on an Optimus system, it doesn’t support that.
And it breaks the intel driver which is normally used for all things on an Optimus system.

So remove it again. Then desktop effects should work (on intel, as the system runs on the intel chip).
How you would do that depends on how you installed it in the first place.

If you used the RPM packages from the official repo, search for “nvidia” in YaST->Software Management, and uninstall all 5 of them.
Then check that you have NO_KMS_IN_INITRD=“no” in /etc/sysconfig/kernel. If it is “yes”, change it to “no” and run “sudo /sbin/mkinitrd”.

To be able to use the nvidia driver with Bumblebee, you should install the package nvidia-bumblebee from the Bumblebee repo instead, see here:
https://en.opensuse.org/SDB:NVIDIA_Bumblebee
But first remove the nvidia driver completely.

Ah, thx.

Before uninstalling it let me please double check:

nvidia-bumblebee
nvidia-computeG03
nvidia-gfxG03-kmp-desktop
nvidia-glG03
nvidia-uvm-gfxG03-kmp-desktop
x11-video-nvidiaG03

will be removed (because of dependencies).

Does this look correct?

Well, you need nvidia-bumblebee to use the nvidia driver with Bumblebee (this actually installs the nvidia driver for Bumblebee).

But I suppose it’s better to remove that as well, and then install it freshly afterwards.

So, yes, remove those 6 packages.

Afterwards install nvidia-bumblebee again, reboot, and it should actually work (if you installed the rest of bumblebee correctly)…

Ok, I’ll try that.

A question regarding nvidia-bumblebee:

Will it automatically start and install the appropriate driver after reboot or do I need to do something?

No. nvidia-bumblebee will download and install the appropriate driver when you install it.

But you still need to use optirun/primusrun to actually use the nvidia chip, if that’s what you mean. That’s how Bumblebee works.

There is an exception though.
If it’s possible to disable the intel graphics in the BIOS settings, you could do that, remove Bumblebee and install the standard nvidia driver again.
You would then use only the nvidia chip, so everything will run on the nvidia chip of course. This then would also need more power/generates more heat though. And in that case the nvidia chip cannot be turned off any more to save power when you don’t need powerful graphics performance. You’re actually turning off Optimus then.

Ok, now KDE no longer starts. (I’m writing now from my desktop machine.)

It reaches the “graphical interface” point during boot and than does nothing.

After uninstalling the nvidia driver?
Try to select “Recovery Mode” at the boot menu (“Advanced Options”).

It reaches the “graphical interface” point during boot and than does nothing.

Apparently X fails to start then.
Probably you created an /etc/X11/xorg.conf (with “nvidia-xconfig” maybe) that tells X to use the nvidia driver. Since it is not installed, X cannot load it and aborts.

Remove /etc/X11/xorg.conf and X/KDE should start again.

Ok, I will try this later. (I need to work on something atm.) Actually I experienced this before but was only to get the system working again by reinstalling (which I’d like to avoid if possible).

PS: WIth the “graphical interface” point I meant the message that you see when you press escape during boot.

Yes, I know.

That’s the last step during boot and is the point where the graphical session is started.
“graphical.target reached” means, that the system did everything that is needed for the graphical session to start, so the boot is finished from its point of view.
In your case, X fails to start then though.

You should be able to login to text mode if you press Ctrl+Alt+F1 at that point.

And /var/log/Xorg.0.log should tell why X failed to start.

Ah, thx again. I knew how to use the terminal but not where to look (xorg.log…) I will check this.

Hi, so now I tried removing (moving) the xorg entries in etc. It didn’t change the behavior (of doing nothing once graphical target is reached).

I skimmed through the log file but I didn’t spot the issue. What is it that I should look for. Any further ideas I can try?

Well, for lines starting with “(EE)” as a start.

You might also boot to “Recovery Mode” and then post the file /var/log/Xorg.0.log.old (which always contains the log from the previous boot).

Ok, using grep --color -E EE /var/log/Xorg.0.log produced a number of errors:

Failed to load /usr/lib64/xorg/modules/libglamoregl.so: … undefined symbol: _glapi_tls_Context
Failed to load module “glamoregl” (loader failed, 7)
[drm] KMS not enabled
(twice)
Failed to initialize GLX extension (Compatible NVIDIA X driver not found)
Server terminated successfully (0)

I need to add that I just uninstalled every nvidia and bumblebee package (since I assumed that the installation was corrupt anyway).

What should I do now?

Well, there are at least parts of the nvidia driver still on your system, the error messages point to libglx in particular.

Maybe that happened because you actually installed the nvidia driver twice. (the nvidia packages and nvidia-bumblebee)
Probably that mixed things up during uninstallation or something like that.
Or did you try to install the driver via the .run installer from nvidia’s homepage as well?
If that’s the case, you might try to run “nvidia-installer --uninstall”, maybe that would remove the rest.

OTOH, libglx is part of the package “xorg-x11-server”, so re-installing that should at least get the graphical system running again.

sudo zypper in -f xorg-x11-server

Since the nvidia driver overwrites Mesa-libGL1 as well, you should re-install that one, too.

Ok, I’m doing this. Should I reinstall Mesa or just the lib?

The package “Mesa-libGL1” should be enough.
This contains exactly the lib that the nvidia driver replaces, i.e. libGL.so.1.

Ok, KDE is back. Do you think reinstalling bumblebee makes sense now?