NVIDIA Optimus卡无法在OpenGL下切换 [英] NVIDIA Optimus card not switching under OpenGL

查看:181
本文介绍了NVIDIA Optimus卡无法在OpenGL下切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用"glGetString(GL_VERSION)"和"glGetString(GL_SHADING_LANGUAGE_VERSION)"检查计算机上的OpenGL版本时,得到以下信息:

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-GL_VERSION的内部版本8.15.10.2538

3.1.0 - Build 8.15.10.2538 for GL_VERSION

1.40-GL_SHADING_LANGUAGE_VERSION的Intel Build 8.15.10.2538

1.40 - Intel Build 8.15.10.2538 for GL_SHADING_LANGUAGE_VERSION

当我运行"Geeks3D GPU Caps Viewer"时,它显示了我的显卡的OpenGL版本(NVS 4200M)

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

GL_VERSION:4.3.0

GL_VERSION: 4.3.0

GLSL版本:通过Cg编译器的4.30 NVIDIA

GLSL version: 4.30 NVIDIA via Cg compiler

这是否意味着我的图形卡仅支持某些OpenGL 4.3.0功能,而我无法创建4.3上下文?

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

推荐答案

您的图形卡是 NVIDIA Optimus 卡片.这意味着它自动"在集成的Intel图形和专用GPU之间进行选择.英特尔显卡最多支持3.1,而专用GPU支持4.3.根据所选择的版本,您最多只能支持该版本. Optimus的唯一问题是它只会自动拾取DirectX,CUDA,C ++ AMP和OpenCL.

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.

这引起了很多混淆 有一些解决方案可以强制使用专用GPU:

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

  1. 最简单的方法是通过NVIDIA控制面板强制您的应用程序使用专用GPU.通常这是一个权宜之计,因为它只能在您的计算机上使用.
  2. 在程序的开头调用一小部分(或链接到)CUDA或OpenCL,以使其触发切换到专用卡.但是,这会增加对CUDA或OpenCL的依赖.
  3. 导出全局变量_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;.通常,这是最好的解决方案,但是,根据所使用的语言,您可能无法导出全局变量.
  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发布了有关此操作的文档: http://developer.download.nvidia .com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf

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

这篇关于NVIDIA Optimus卡无法在OpenGL下切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆