[Ubuntu 14.04 64bit]

After switching between Intel / NVIDIA graphics and the different NVIDIA drivers I am now suddenly stuck with the Intel GPU. It used to be no problem at all switching between the two - I cannot say for sure what is suddenly causing the issue. I think the last thing I did was switching to the "X.Org X server" driver - then something broke. The switching was part of me trying to troubleshoot issues with setting up a secondary screen.

enter image description here

Every time I try to switch to NVIDIA I get this very expressive error message and then it switches back to Intel :/

I could use some assistance with troubleshooting or suggestions on what to try.

So far I (un/re)installed the various packages "nvidia-settings" / "nvidia-current" / "nvidia-current-updates" / "nvidia-331" / "nvidia-331-updates". To no avail.

> lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev a1)

/etc/apt/sources.list: may be found at pastebin.com


Regarding suggestion by Qasim:

raffael@raffael-GT60~> sudo prime-select nvidia
[sudo] password for raffael: 
Error: alternatives are not set up properly
Error: nvidia mode can't be enabled
raffael@raffael-GT60~> sudo prime-select intel
Error: alternatives are not set up properly
Error: intel mode can't be enabled

Regarding 2nd suggestion by Qasim:

sudo apt-get purge nvidia*
[reboot]
sudo apt-get install nvidia-319-updates nvidia-settings-319-updates nvidia-prime
[reboot]
[tried to switch to NVIDIA]

Weird thing is - this actually worked the first time !? Then I switched back to Intel - log off/on - Switched back to NVIDIA - log off/on -> system crashed - error as described above.


Regarding suggestion by Louis Matthijssen:

raffael@raffael-GT60:~$ sudo update-alternatives --set /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf /usr/lib/nvidia-331-updates-prime/ld.so.conf
update-alternatives: error: alternative name (/etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf) must not contain '/' and spaces
raffael@raffael-GT60:~$ ls -la /usr/lib/nvidia-331-updates-prime
total 44
drwxr-xr-x   2 root root  4096 Mai  2 22:45 .
drwxr-xr-x 196 root root 32768 Mai  3 10:57 ..
-rw-r--r--   1 root root     0 Apr  4 11:50 alt_ld.so.conf
-rw-r--r--   1 root root    60 Apr  4 11:50 ld.so.conf

Repeated algo twice - didn't work again :/

Now it seems to work:

raffael@raffael-GT60:~$ sudo update-alternatives --set x86_64-linux-gnu_gl_conf /usr/lib/nvidia-331-updates-prime/ld.so.conf 
update-alternatives: using /usr/lib/nvidia-331-updates-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode

raffael@raffael-GT60:~$ sudo update-alternatives --set i386-linux-gnu_gl_conf /usr/lib/nvidia-331-updates-prime/alt_ld.so.conf
update-alternatives: using /usr/lib/nvidia-331-updates-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode

Afterwards I could switch to NVIDIA - but wasn't offered the extended "NVIDIA X Server Settings" - will reboot now and see what happens. Follow up: It switched back to Intel after reboot and cannot switch to NVIDIA as usual. To me it seems that your method, Louis, tricks the OS into believing it uses NVIDIA while this is actually not the case.

  • 2
    I have exactly the same problem, in fact the problem is extended and now my Nvidia card is not working in windows 8.1, that means that affect some configuration aout of the OS :( Indeed i tried with a clean installation of Ubuntu and don't reconizes anymore the card. – user5288 Apr 21 '14 at 15:34
  • Can you post your /etc/apt/sources.list? – davidbaumann May 2 '14 at 16:17
  • @Raffael ... I have deleted the answer, try to remove and reinstall nvidia prime by sudo apt-get install nvidia-319-updates nvidia-settings-319-updates nvidia-prime – Qasim May 2 '14 at 18:55
  • did u removed nvidia 1st ? @Raffael – Qasim May 2 '14 at 19:25
  • can i have teamviewer access so i can look the issue – Qasim May 2 '14 at 19:28

As you get the following error:

Error: alternatives are not set up properly

You may try to set the alternatives yourself.

When I switch to Intel I see:

update-alternatives: using /usr/lib/nvidia-331-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-331-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode

When I switch to NVIDIA I see:

update-alternatives: using /usr/lib/nvidia-331/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-331/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode

So you could try this to switch to Intel:

sudo update-alternatives --set x86_64-linux-gnu_gl_conf /usr/lib/nvidia-331-prime/ld.so.conf
sudo update-alternatives --set i386-linux-gnu_gl_conf /usr/lib/nvidia-331-prime/alt_ld.so.conf

Obviously you should replace 331 by your own version.

Now you could try a few things to trigger the switch:

  • Log out and log in again

    to restart the X server as you normally would do

  • Reboot your whole PC

    for the same purpose of the above

  • Execute sudo prime-select nvidia

    as your alternatives are now set for Intel, I hope this will also fix any other settings so that everything is as it should be again (obviously you should still restart the X server)

I hope that I've interpreted the error right.

Also, you could use prime-select query to check which card is currently selected, and fix the alternatives for that card (for example NVIDIA) as you may somehow have set alternatives for the other card (for example Intel), but the tool is still thinking that you're using the other card (for example NVIDIA), thus giving an error saying that the alternatives are not set up properly.

  • Not sure why you suggest how I should switch to Intel - but invoking the first command ends up as added to my question. – Raffael May 3 '14 at 19:39
  • I'm sorry, those were the wrong commands. I mean you could try to set the alternatives to the current card (Intel) as prime-select says the alternatives are broken. Then, you can try if switching to NVIDIA is working again. I don't know if this will work and you should check what the alternatives are currently pointing to, so you can restore the alternatives if this doesn't work. – Louis Matthijssen May 3 '14 at 20:00
  • 1
    I just got exactly the same problem as you have when I tried to switch to NVIDIA. The commands I provided here worked for me. See my full output. – Louis Matthijssen May 4 '14 at 13:46
  • +10 +50 for the effort ;) I guess I'll just reinstall Ubuntu when I find the time – Raffael May 7 '14 at 14:40
  • 1
    For me the problem was that alternatives pointed to the Mesa driver therefore confusing the prime-select. All I had to do was reset alternatives to defaults: update-alternatives --auto i386-linux-gnu_gl_conf, update-alternatives --auto x86_64-linux-gnu_gl_conf. After that the nVidia panel started working again. – SnakE Apr 24 '15 at 17:29

I think I've found a workaround at least.

It's all about update-alternatives.
I've noticed that both

sudo update-alternatives --config i386-linux-gnu_gl_conf

and

sudo update-alternatives --config x86_64-linux-gnu_gl_conf

returns list containing /usr/lib/i386-linux-gnu/mesa/ld.so.conf or similar.

Somehow after every reboot /usr/lib/i386-linux-gnu/mesa/ld.so.conf was set as choosen even if I've changed it before manually.

I tried changing the order on that list, but finally the solution was to remove it by

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

and

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

That should be enough.
If not, set both 'i386' and 'x86_64' to the same option by

sudo update-alternatives --config x86_64-linux-gnu_gl_conf

and

sudo update-alternatives --config x86_64-linux-gnu_gl_conf

Reboot afterwards.

You can always restore it to original state by

sudo update-alternatives --install /etc/ld.so.conf.d/i386-linux-gnu_GL.conf i386-linux-gnu_gl_conf /usr/lib/i386-linux-gnu/mesa/ld.so.conf 500  

and

sudo update-alternatives --install /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf x86_64-linux-gnu_gl_conf /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf 500

Hope that it will also work for You.

  • 1
    After following your instructions and after rebooting I couldn't login anymore. The login page showed up and after entering my password and hitting Enter it would show a black screen and then the login screen again. I used CTRL+Alt+F1 and used your last two commands to set it back to its previous settings. I can now login but I still can't use my NVidia card. – BourbonCreams Jul 10 '17 at 12:57
  • @BourbonCreams , sorry to hear that. I would recommend trying sudo apt-get purge nvidia-*, rebooting, adding this ppa: ppa:graphics-drivers/ppa(from webupd8.org/2016/06/… ) and installing selected driver using build-in GUI application or running sudo apt-get install nvidia-<choosen driver version> nvidia-prime - it should also work. Sometimes I got to do it twice for some reason (or at least reboot twice). To be honest, I feel that the workaround from this answer isn't perfect. – kcpr Jul 11 '17 at 21:19
  • This update didn't fix it for me, but for me it turned out that the nvidia module wasn't loading due to a bug in some symlinking, as described (and fixed) with this answer here: askubuntu.com/questions/900285/… – Scott Oct 30 '17 at 17:30

what worked for me , I am still trying to find his post. I had so many i was viewing:

Here, this is what worked for me:

I tried:

sudo update-alternatives --config x86_64-linux-gnu_gl_conf
sudo ldconfig -n
sudo update-initramfs -u

And rebooted, with no changes. So I tried:

sudo apt-get purge libvdpau-va-gl1 bumblebee* nvidia*
sudo apt-get install linux-headers-generic
sudo apt-get install nvidia-331 nvidia-settings nvidia-prime

Reboot. Still, no changes, and the same blank error message in nvidia-settings when I try to switch to me nvidia card.

I tried switching manually, using sudo prime-switch nvidia, and configuration info was updated. I tried again, and nvidia-settings asked me to log out and log back in and...voilà! I've got it working!

In my case, it appeared that before being able to switch using nvidia-settings UI, I had to manually switch first as superuser, so as to generate the proper configuration!

Good thing I tried that, or I'd still be tinkering about, installing other drivers! Hope this proves useful to someone else!

follow pre answers, this is the way how I get it right on my linux mint 17.2.

first I do:

sudo update-alternatives --config x86_64-linux-gnu_gl_conf

select the one with 'nvidia-prime':

sudo prime-select nvidia

then restart:

sudo init 6

I've had a problem that looked the same, and the answer was that I still had bumblebee-nvidia installed.

Notice that you're purging "everything NVIDIA" with sudo apt-get purge nvidia*, and the package above doesn't match that wildcard.

So, run command:

apt-get purge bumblebee-nvidia nvidia*

Then reboot, then install the relevant nvidia-xxx, nvidia-settings and nvidia-prime packages (I'm currently using the version 340.24 from xorg-edgers).

Now during this installation you should see the relevant update-alternatives messages about the *gnu_gl_conf files.

  • :-/ ... nothing bumblebish left to purge since my last attempt – Raffael Jul 27 '14 at 9:24

I found the solution.

I'm not sure what exactly was the problem, but this issue seems to have disappeared on a fresh install of 16.04. Perhaps they updated the dependencies properly in it? I'm not sure.

But I can personally confirm that this is no longer an issue in 16.04. I used to have the EXACT same issue in 14.04. But now with 16.04 it is no longer an issue.

  • Forgive me for bringing up an old answer but I was facing the exact same issue – Rakshith Ravi Apr 28 '16 at 12:43

protected by Community Aug 30 '14 at 17:11

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.