在Optimus笔记本电脑中强制使用NVIDIA GPU [英] Forcing NVIDIA GPU programmatically in Optimus laptops

查看:900
本文介绍了在Optimus笔记本电脑中强制使用NVIDIA GPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个DirectX游戏,当我在Optimus笔记本电脑上运行它时,会使用英特尔GPU,导致可怕的性能。如果我使用上下文菜单强制使用NVIDIA GPU,或者将我的可执行文件重命名为bf3.exe或其他一些着名的游戏可执行文件名,那么性能就像预期的那样。

显然,重新分配我的游戏,那么有什么方法可以通过编程方式强制笔记本电脑使用NVIDIA GPU?


我已经尝试使用DirectX枚举适配器(IDirect3D9 :: GetAdapterCount,IDirect3D9 :: GetAdapterIdentifier),它不工作:只报告1个GPU(正在使用的GPU)。

I'm programming a DirectX game, and when I run it on an Optimus laptop the Intel GPU is used, resulting in horrible performance. If I force the NVIDIA GPU using the context menu or by renaming my executable to bf3.exe or some other famous game executable name, performance is as expected.
Obviously neither is an acceptable solution for when I have to redistribute my game, so is there a way to programmatically force the laptop to use the NVIDIA GPU?

I've already tried using DirectX to enumerate adapters (IDirect3D9::GetAdapterCount, IDirect3D9::GetAdapterIdentifier) and it doesn't work: only 1 GPU is being reported (the one in use).

推荐答案

http://www.nvidia.com/object/LO_optimus_whitepapers.html 的Optimus白皮书是不清楚在切换到GPU之前需要做什么。白皮书说,检测到DX,DXVA和CUDA调用,将导致GPU打开。但是,除此之外,决定是基于NVIDIA维护的配置文件,当然,还不存在您的游戏。

The Optimus whitepaper at http://www.nvidia.com/object/LO_optimus_whitepapers.html is unclear on exactly what it takes before a switch to GPU is made. The whitepaper says that DX, DXVA, and CUDA calls are detected and will cause the GPU to be turned on. But in addition the decision is based on profiles maintained by NVIDIA and, of course, one does not yet exist for your game.

有一件事要做一个CUDA调用,例如 cuInit(0); 。与DX和DXVA相反,英特尔集成显卡没有办法处理,因此应该强制切换到GPU。

One thing to try would be make a CUDA call, for instance to cuInit(0);. As opposed to DX and DXVA, there is not way for the Intel integrated graphics to handle that, so it should force a switch to the GPU.

这篇关于在Optimus笔记本电脑中强制使用NVIDIA GPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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