Nvidia optirun|primusrun 缺少 libGL.so.1 解决方案

当您运行optirun或primus时,您或许会遇到…libGL.so.1: cannot open shared object file: No such file or directory…

这个错误暂时状态是open#876033

错误提示

完整错误提示为:

$ primus: fatal: failed to load any of the libraries: /usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1:/usr/lib/i386-linux-gnu/nvidia/libGL.so.1:/usr/lib/nvidia/libGL.so.1
/usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1: cannot open shared object file: No such file or directory
/usr/lib/i386-linux-gnu/nvidia/libGL.so.1: cannot open shared object file: No such file or directory
/usr/lib/nvidia/libGL.so.1: cannot open shared object file: No such file or directory

$ primus: fatal: failed to load any of the libraries: /usr/lib/x86_64-linux-gnu/ nvidia/libGL.so.1:/usr/lib/i386-linux-gnu/nvidia/libGL.so.1:/usr/lib/nvidia/libGL.so.1
/usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1: wrong ELF class: ELFCLASS64
/usr/lib/i386-linux-gnu/nvidia/libGL.so.1: cannot open shared object file: No such file or directory
/usr/lib/nvidia/libGL.so.1: cannot open shared object file: No such file or directory

解决方案

首先,确保你已经开启了i386的支持

1
sudo dpkg --add-architecture i386

其次,确保你已经安装了primus-libs-ia32包,如果没有安装请安装。

1
sudo apt install primus-libs-ia32

然后执行命令安装这些软件包:libgl1-nvidia-glx libgl1-nvidia-glx:i386 nvidia-driver-libs nvidia-driver-libs-i386

1
sudo apt install libgl1-nvidia-glx libgl1-nvidia-glx:i386 nvidia-driver-libs nvidia-driver-libs-i386

转载自:https://wiki.debian-fr.xyz/NVidia_Optimus_Bumblebee#libGL.so.1