Enable hardware-accelerated desktop effects with NVIDIA Optimus/Bumblebee

13,973

If you use nvidia-current-updates, you have to edit /etc/bumblebee/bumblebee.conf and set KernelDriver=nvidia-current-updates under [driver-nvidia].

It sounds that you've just installed Bumblebee, but that you've selected the universe repository during installation. That pulled in the nvidia driver which broke your 3D acceleration and other OpenGL capabilities. Try restarting the X server, e.g. by rebooting the machine.

In case the issue still persists, it is possible that some libraries have been installed in a wrong location. After installation of Bumblebee, /usr/lib/xorg/modules/extensions/ should not contain libglx.so, libglx.so.VERSION or nvidia_drv.so. If that is the case, remove those files (it requires root privileges):

sudo rm -f /usr/lib/xorg/modules/extensions/libglx.so* /usr/lib/xorg/modules/extensions/nvidia_drv.so

You may also have to reinstall the nvidia-current package if Bumblebee does not work afterwards:

sudo apt-get install --reinstall nvidia-current

Re-login and your problem should be solved.

Share:
13,973
Jacob Ensor
Author by

Jacob Ensor

Updated on September 18, 2022

Comments

  • Jacob Ensor
    Jacob Ensor over 1 year

    I'm pretty new to Linux and I'm trying to install Ubuntu 12.04 on my personal laptop, a Dell XPS 15. It has an NVIDIA GT540M with Optimus. Conveniently, there's no way to disable Optimus in the BIOS. lspci output:

    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

    01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev a1)

    I have bumblebee installed and it seems to work fine. I've been using glxgears from mesa-utils to test it. I'm not sure if this is normal, but running "glxgears" by itself gives:

    Error: couldn't get an RGB, Double-buffered visual

    But "optirun glxgears" works fine, getting framerates around 5800-6000 in 5 seconds.

    My only issue is that the hardware-accelerated desktop effects aren't working. I can't enable wobbly windows or any animations. Worst of all, the Aero-like window-maximizing effect doesn't work. I haven't been able to get that effect enabled at all, even though it worked when I ran off the USB drive. I'm only assuming it's linked to my video card issues, but if there's a way to enable it please let me know!

    Is it that optirun uses the NVIDIA drivers, but the intel drivers aren't setup properly? Did I miss a step?

    Here's one more screenshot. It's also worth noting this is a 64 bit install of Ubuntu!

    Another one I thought would be useful.

    • Web-E
      Web-E almost 12 years
      Ok which bublebee have you installed? is it from MrMee repository (ironhide and bumblebee project) OR the bumble project (bumblebee-project.org)?
    • Jacob Ensor
      Jacob Ensor almost 12 years
      The bumblebee project. I updated the post with a screenshot if that helps.
  • Jacob Ensor
    Jacob Ensor almost 12 years
    I tried this to no avail. I'm more interested in the [driver-nouveau] section, actually. I know bumblebee works by creating a display :8 ran by the nvidia driver, and it seems to be working fine. It's the driver on the other display that I'm having problems with. Is that controlled by [driver-nouveau]? It seems like optimus runs my nvidia drivers fine, but my integrated intel card must not be letting hardware accelerated effects happen.
  • Lekensteyn
    Lekensteyn almost 12 years
    @JacobEnsor [driver-nouveau] is used if Driver=nouveau is set in [bumblebeed]. It has nothing to do with the primary X server that is run on the Intel graphics card. If you do not install nvidia drivers, 3D acceleration and such won't be broken. If possible, please paste your /var/log/Xorg.0.log file.
  • Jacob Ensor
    Jacob Ensor almost 12 years
  • Lekensteyn
    Lekensteyn almost 12 years
    I see /usr/lib/x86_64-linux-gnu/xorg/extra-modules/libglx.so: libnvidia-tls.so.295.40: cannot open shared object file: No such file or directory. This indicated that an error occurred setting the so-called alternatives link of "...gl_conf". Try reinstalling bumblebee. If after rebooting/restarting X the issue still persists, please add the output of update-alternatives --display x86_64-linux-gnu_gl_conf to your question.
  • Jacob Ensor
    Jacob Ensor almost 12 years
    paste.ubuntu.com/955156 I'm taking a look myself... I'm wondering if a solution similar to user corp769's at this link is in order... linuxquestions.org/questions/slackware-14/…
  • Jacob Ensor
    Jacob Ensor almost 12 years
    I thought this output could also be helpful... ldd /usr/lib/x86_64-linux-gnu/xorg/extra-modules/libglx.so gives: linux-vdso.so.1 => (0x00007fff0d1ff000) libnvidia-tls.so.295.40 => not found libnvidia-glcore.so.295.40 => not found libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f157e927000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f157e723000) /lib64/ld-linux-x86-64.so.2 (0x00007f157f701000)
  • Lekensteyn
    Lekensteyn almost 12 years
    ls -l /usr/lib/x86_64-linux-gnu/xorg/extra-modules (note: no slash!) should output /etc/alternatives/x86_64-linux-gnu_xorg_extra_modules. The last file should point to /usr/lib/x86_64-linux-gnu/xorg/x11-extra-modules which should be an empty directory. Somewhere in that path, there is something wrong. Have you performed an upgrade or a fresh installation? If it was an upgrade, did you use MrMEEE/bumblebee, mj-casalogic/bumblebee or Ironhide before?
  • Jacob Ensor
    Jacob Ensor almost 12 years
    I performed a fresh installation. I have uninstalled and reinstalled Bumblebee a couple of times though. I have never installed Ironhide. ls /etc/alternatives/x86_64-linux-gnu_xorg_extra_modules gives me libglx.so libglx.so.295.40 nvidia_drv.so. ldd output on the libglx.so file is similar to the above.
  • Lekensteyn
    Lekensteyn almost 12 years
    What if you add -l to ls? Does it show /etc/alternatives/x86_64-linux-gnu_xorg_extra_modules -> /usr/lib/x86_64-linux-gnu/xorg/x11-extra-modules?
  • Jacob Ensor
    Jacob Ensor almost 12 years
    Sorry to cut you off, but I wanted to share my progress with you. I noticed that libglx.so was the only thing being loaded from the /usr/lib/x86_64-linux-gnu/xorg/extra-modules ModulePath. I also noticed that /usr/lib/xorg/modules/extensions/ provided a libglx.so and it didn't reference any nvidia software. To make the xserver use that one instead, I removed the x86_64 path from the ModulePath by creating a new xorg.conf like paste.ubuntu.com/955698 . After hesitantly restarting, I logged in and my background came up but no unity. From the first console I ran unity.
  • Jacob Ensor
    Jacob Ensor almost 12 years
    It loaded in the display console perfectly! The hardware-accelerated effects all work, including maximizing the window by dragging top/left/right. I can run glxgears and get around 59.7 FPS, and optirun glxgears gets me around 500 FPS. That's about half what optirun gave me before, but I'm guessing it's because of the juice the new hardware effects take up? Now I just need to figure out why unity didn't start with the machine. First step, reboot. I'll be right back. --side note, adding -l to the ls did give me that. Is this the proper directory to use? Is there a problem with my method?
  • Jacob Ensor
    Jacob Ensor almost 12 years
    This time rebooting brought up unity fine, so I guess I have no issues! As soon as you confirm there isn't a more efficient method to load glx I'll update the question and mark it solved. This is my first question so I'm not sure if marking it solved beforehand will lock you out from commenting... :?
  • Lekensteyn
    Lekensteyn almost 12 years
    Even if this question is marked as accepted, I'll still receive notifications. As for the performance drop, try running VGL_READBACK=pbo optirun glxgears. Please report back if it helps, I'll then fix it in the next version of Bumblebee.
  • Jacob Ensor
    Jacob Ensor almost 12 years
    It ran with about the same frame rate, and output [VGL] ERROR: in readback--. Thanks for all your help!!
  • Lekensteyn
    Lekensteyn almost 12 years
    Can you join #bumblebee on Freenode IRC for further discussion about this issue?
  • Jacob Ensor
    Jacob Ensor almost 12 years
    I was just now able to get on and didn't see you. This week is going to be fairly busy for me, but if you can let me know when you're typically on in EST time I'll try to get on.
  • Lekensteyn
    Lekensteyn almost 12 years
    @JacobEnsor My question was whether the program immediately outputted that error or if it only happens after closing glxgears.
  • Jacob Ensor
    Jacob Ensor almost 12 years
    It only happens after closing glxgears. Sorry for the confusion. Another issue I'm having is occasionally when using optirun Ubuntu gives me a "System error has been detected" box, and asks me to send and error report. Should I send the report to them? Is there some way to get it for you? I haven't experienced any issues after seeing it, but it pops up occasionally.
  • Lekensteyn
    Lekensteyn almost 12 years
    Some programs may not be fully compatible with Bumblebee (actually, the virtualgl component) and crash. Sending it to Ubuntu does not really help.
  • EboMike
    EboMike over 11 years
    Guys, would it be possible to edit the answer to include the most important information of what was discussed in the comments here? Thanks!
  • Eliah Kagan
    Eliah Kagan over 11 years
    Can you expand this answer to provide more information about exactly how to do that?