Fix Xlib: extension GLX missing on display :8 error running Gui programs

After installing both Bumblebee and Nvdia Prime like this, an error of:

1
Xlib: extension "GLX" missing on display ":8".

is got when attempting to run an gui program.

The most effective solution found is to follow this solution here given by sapjunior, but with slight modification.

Here’s the solution worked for me:
Still all the driver version numbers need to be replaced with yours!

  1. Add the following to /etc/modprobe.d/bumblebee.conf

    1
    2
    3
    4
    alias nvidia-drm nvidia_364_drm
    alias nvidia-uvm nvidia_364_uvm
    alias nvidia-modeset nvidia_364_modeset
    remove nvidia rmmod nvidia-drm nvidia-modeset nvidia-uvm nvidia
  2. Perform these two command and record the configuration file names currently used.

    1
    2
    sudo update-alternatives --config x86_64-linux-gnu_gl_conf
    sudo update-alternatives --config i386-linux-gnu_gl_conf
  3. Make sure the x86_64 config contains all of the following

    1
    2
    3
    4
    5
    6
    /usr/lib/x86_64-linux-gnu/mesa
    /usr/lib/x86_64-linux-gnu/mesa-egl
    /usr/lib/i386-linux-gnu/mesa
    /usr/lib/i386-linux-gnu/mesa-egl
    /usr/lib/nvidia-387
    /usr/lib32/nvidia-387

    and the i386 config contains all of the following:

    1
    2
    /usr/lib/i386-linux-gnu/mesa
    /usr/lib32/nvidia-387
  4. Refresh shared libiary status with sudo ldconfig. (Maybe reboot just in case)

2018/1/10