Linux проверить версию opengl

Что такое терминальная команда, которая может показать версию OpenGL?

Итак, я хочу узнать, какая у меня версия OpenGL. У меня есть доступ к Ubuntu через SSH. Какую команду мне выполнить?

7 ответов

Чтобы проверить версию OpenGL,

glxinfo | grep «OpenGL version»

Вы получите вывод следующим образом,

glxinfo | grep "OpenGL version" OpenGL version string: 1.4 (2.1 Mesa 7.7.1) 

Редактировать:

Возможно, вам повезет больше с современным OpenGL, просто добавив слово «версия» вместо «версия OpenGL», учитывая различия между профилями ядра и компатации, а также различными версиями GLSL и GLES:

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 

Обратите внимание, что фактическая версия представлена ​​»базовой версией профиля» (4.1), тогда как «версия OpenGL» представлена ​​как 3.0.

В зависимости от того, что вы ищете:

Реализация Open GL

Вы можете использовать glxinfo из пакета mesa-utils:

sudo apt-get install mesa-utils glxinfo | grep "OpenGL version" 

Библиотеки развития

сообщит вам информацию о версии и т. д. любого пакета.

но вам нужно знать, какая конкретная часть / реализация и т. д. opengl вас интересует. Я подозреваю, для вас это будет:

Примечание: я добавил этот ответ позже, потому что ни один из существующих ответов не рассматривает важные аспекты, касающиеся ssh, и не даст вводящих в заблуждение значений тем, кто следует вышеприведенным инструкциям.

Читайте также:  Linux захват экрана со звуком

    Используйте X-forwarding при ssh-ing. Это включено с ssh -X , Без x-forwarding:

$ ssh MYCOMP $ glxinfo Error: unable to open display 
$ 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: 
$ 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: 

Источник

How to Check OpenGL version?

how-to-check-opengl-version

LinuxStoney

Today we learn How to Check OpenGL version? OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

How To Check OpenGL Version,

glxinfo | grep «OpenGL version»

You will get the output as follows,

glxinfo | grep "OpenGL version" OpenGL version string: 1.4 (2.1 Mesa 7.7.1)

You may have better luck with modern OpenGL just grepping for “version” instead of “OpenGL version” given the differences between the core and compat profiles, as well as the various GLSL and GLES versions:

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

Notice that the actual version is presented by the “core profile version” (4.1), whereas the “OpenGL version” is presented as 3.0.

Читайте также:  Linux архивация папки zip

Источник

How do I know which version of OpenGL I am using?

I started writing programs, in C (for now) using GLFW and OpenGL. The question I have is that, how do I know which version of OpenGL my program will use? My laptop says that my video card has OpenGL 3.3. Typing «glxinfo | grep -i opengl» returns:

OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce 9600M GT/PCI/SSE2 OpenGL version string: 3.3.0 NVIDIA 285.05.09 OpenGL shading language version string: 3.30 NVIDIA via Cg compiler OpenGL extensions: 

So have you figured out the solution yourself and forgot about your question or do you still have some unclarities? In the former case just abandoning a question is extremely bad practice and in the latter case feel free to ask any further questions about existing answers or even post your own answer if different from the already existing ones.

If you want to check GLEW version on Linux from terminal, you can install glew-utils and run visualinfo | grep «OpenGL version» .

1 Answer 1

Just call glGetString(GL_VERSION) (once the context is initialized, of course) and put out the result (which is actually the same that glxinfo does, I suppose):

printf("%s\n", glGetString(GL_VERSION)); 

Your program should automatically use the highest possible version your hardware and driver support, which in your case seems to be 3.3. But for creating a core-profile context for OpenGL 3+ (one where deprecated functionality has been completely removed) you have to take special measures. But since version 2.7 GLFW has means for doing this, using the glfwOpenWindowHint function. But if you don’t want to explicitly disallow deprecated functionality, you can just use the context given to you by the default context creation functions of GLFW, which will as said support the highest possible version for your hardware and drivers.

Читайте также:  Raspberry pi linux android

But also keep in mind that for using OpenGL functionality higher than version 1.1 you need to retrieve the corresponding function pointers or use a library that handles this for you, like GLEW.

Источник

How can I find out my OpenGL version on Ubuntu 13.04

Does this question even make sense? SFML 2.0 has added a feature whereby you can specify an OpenGL version to use. Is there a terminal command I can run (or otherwise) to find out what version I should be using?

@EdwardBird: Then your question is poorly phrased. If you wanted to know what the highest version of OpenGL supported by a system is, you should have asked for that. So fix your question.

2 Answers 2

To know your OpenGL version in Ubuntu,

$sudo apt-get install mesa-utils 
$glxinfo | grep "OpenGL version" 

You will get the output as follows,

glxinfo | grep "OpenGL version" OpenGL version string: 1.4 (2.1 Mesa 7.7.1) 

There is no «should be using». The version you «should» be using is the minimum version that you want to support. What version that is depends on what hardware you want your program to execute on. If the hardware can’t support that version, then your code simply won’t run on it. And if you want your code to run on lower versions, then you should have asked for that version and written your application against that lower version.

Well GTX 670MX supports 4.1, but clearly the information you give is not correct, because running SFML with version 3.2 specified causes problems.

@EdwardBird: What kind of problems? Nicol Bolas is right, and whatever’s broken, it should not be due to a higher version being supported than what’s requested.

Источник

Оцените статью
Adblock
detector