NVIDIA Optimus card not switching under OpenGL

老子叫甜甜 提交于 2020-01-13 18:09:12

问题


When I used use "glGetString(GL_VERSION)" and "glGetString(GL_SHADING_LANGUAGE_VERSION)" to check the OpenGL version on my computer, I got the following information:

3.1.0 - Build 8.15.10.2538 for GL_VERSION

1.40 - Intel Build 8.15.10.2538 for GL_SHADING_LANGUAGE_VERSION

When I ran "Geeks3D GPU Caps Viewer", it shown the OpenGL version of my graphics cards(NVS 4200M) are

GL_VERSION: 4.3.0

GLSL version: 4.30 NVIDIA via Cg compiler

Does that mean my graphics cards only supports some OpenGL 4.3.0 functions, and I cannot create 4.3 context?


回答1:


Your graphics card is an NVIDIA Optimus card. This means that it "automatically" chooses between the integrated Intel graphics and the dedicated GPU. The Intel graphics only supports up to 3.1 while the dedicated GPU supports 4.3. Depending on which one is chosen, you'll only have support for up to that version. The only problem with Optimus is that it'll only automatically pick up DirectX, CUDA, C++ AMP, and OpenCL.

This has caused much confusion and frustration.

There are a few solutions to force the dedicated GPU to be used:

  1. The simplest, force your application to use the dedicated GPU via the NVIDIA Control Panel. This is generally a stop-gap solution, as it'll only work on your machine.
  2. Invoke a small bit of (or link to) CUDA or OpenCL at the beginning of your program to get it to trigger the switch to the dedicated card. This adds a dependency to CUDA or OpenCL, however.
  3. Export the global variable _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;. This is generally the best solution, however, depending on which language you're using, you may not be able to export global variables.

NVIDIA released a document about doing this: http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf



来源:https://stackoverflow.com/questions/18071669/nvidia-optimus-card-not-switching-under-opengl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!