我想找出我正在使用的OpenGL版本。我通过SSH可以访问Ubuntu。我应该执行哪个命令?
检查OpenGL版本,
glxinfo | grep "OpenGL version"
您将得到以下输出,
glxinfo | grep "OpenGL version"
OpenGL version string: 1.4 (2.1 Mesa 7.7.1)
glxinfo | grep 'version'
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Max core profile version: 4.1
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL core profile version string: 4.1 (Core Profile) Mesa 11.1.2
OpenGL core profile shading language version string: 4.10
OpenGL version string: 3.0 Mesa 11.1.2
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
sudo apt-get install mesa-utils
glxinfo | grep "OpenGL version"
开发库
这有点取决于情况,
dpkg -s [package name]
dpkg -s libglu1-mesa
ssh -X
进行启用。
没有开启X转发:
$ ssh MYCOMP
$ glxinfo
Error: unable to open display
开启了X转发:
$ ssh -X MYCOMP
$ glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 8800 GT/PCIe/SSE2
OpenGL version string: 2.1.2 NVIDIA 310.44
OpenGL shading language version string: 1.20 NVIDIA via Cg compiler
OpenGL extensions:
需要注意的是,这里显示的是错误的显卡和错误的版本号(与您所期望的不同)。
DISPLAY
变量设置为:0
,以允许从远程会话中访问图形卡的驱动程序。
$ ssh -X MYCOMP
$ DISPLAY=:0
$ glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 550 Ti/PCIe/SSE2
OpenGL version string: 4.3.0 NVIDIA 310.14
OpenGL shading language version string: 4.30 NVIDIA via Cg compiler
OpenGL extensions:
这显示了正确的显卡(远程计算机上的显卡),以及正确的版本号。
localhost:10.0
,不幸的是导致了X Error of failed request: GLXBadContext
。 - phil294$ glxinfo | awk '/OpenGL version/ {print $4}'
3.0
optirun glxinfo | awk '/OpenGL version/ {print $4}'
。DISPLAY=:0 glxgears -info | grep GL_VERSION
GL_VERSION = 3.3.0 NVIDIA 340.93
DISPLAY=:0
。命令glxgears
位于mesa-utils
软件包中,可以通过以下方式安装:sudo apt-get install mesa-utils
glxinfo | grep "OpenGL version"
OpenGL version string: 3.0 Mesa 17.2.2
sudo apt install mesa-utils
nvidia-settings
并转到图形信息 > OpenGL。查找版本:属性的值,它应该类似于4.6.0 NVIDIA 450.66。如果您具有对运行Ubuntu 16.04的远程计算机的root访问权限,您可以运行
user@local_computer:~$ ssh root@remote.example.com
root@remote:~# export DISPLAY=:0
root@remote:~# export XAUTHORITY=/var/lib/lightdm/.Xauthority
root@remote:~# glxinfo | grep -i "OpenGL version"
OpenGL version string: 3.0 Mesa 11.2.0
glxinfo
命令。要能够使用它,您需要安装mesa-utils
软件包。 - starleaf1