切换显卡,nvidia x server 不能使用 Error: nvidia mode can't be enabled

转自: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.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值