转自:https://askubuntu.com/questions/451335/cant-switch-anymore-from-intel-to-nvidia-gpu
sudo prime-select nvidia
报错:Error: nvidia mode can't be enabled
以下方法可以解决
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.