笔记本电脑双视频卡-如何以编程方式检测和/或选择使用哪个 [英] laptop dual video cards - how to programatically detect and/or choose which one is used

查看:106
本文介绍了笔记本电脑双视频卡-如何以编程方式检测和/或选择使用哪个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发使用DirectX在Windows 7和更高版本的计算机上进行3D渲染的软件,以及64位C#/。NET代码。

We're developing software which uses DirectX for 3D rendering on Windows 7 and later machines, 64-bit C#/.NET code.

我们观察到,我们正在测试的许多较新的戴尔笔记本电脑都具有双显卡。它们具有Intel HD 4600集成显卡,并且还具有更快的NVIDIA Quadro卡。

We've observed that a number of newer Dell laptops we're testing on have dual video cards. They have the Intel HD 4600 integrated graphics and they also have a faster NVIDIA Quadro card (for example).

默认情况下,开箱即用的是Intel图形由DirectX应用程序。这样做是为了保留电池寿命。但是性能明显要比NVIDIA卡差。

By default, out of the box, the Intel graphics are used by the DirectX application. This is done, presumably to preserve battery life. But the performance is noticeably worse than the NVIDIA card.

使用NVIDIA控制面板,用户可以控制默认使用哪个面板。一旦用户将其切换为使用NVIDIA卡,性能就会大幅度提高。

Using the NVIDIA control panel, the user can control which one is used by default. As soon as the user switches it to use the NVIDIA card, the performance sees a big jump for the better.

所以,我的问题是...。代码中检测此设置和/或为我们的应用程序修改它的方法(在安装和/或启动时)?我们是否可以检测到我们的应用程序正在使用英特尔卡,并且如果它是上述双卡方案之一,则提示用户并可能(如果他们要求)更改其设置?

So, my question is.... Is there any way to, in code, detect this setting and/or modify it for our application (on install and/or on launch)? Can we detect that for our app the Intel card is being used and if its one of these dual card scenarios, prompt the user and perhaps (if they request it) change the setting for them?

目前,我们必须引导用户在NVIDIA控制面板中进行手动更改。

As it is currently we have to walk the users through manually making the change in the NVIDIA control panel.

其他任何人都有处理此问题的经验,并且对如何进行有任何建议?

Anyone else have any experience dealing with this and have any advice on how to proceed?

推荐答案

您可以使用C#DLL Interop访问 NVML(NVidia管理库)属于 GPU部署工具包(GDK)。 NVML包括以下功能,用于枚举和选择GPU设备:

You could use C# DLL Interop to access functions of the NVML (NVidia Management Libraries) that are part of the GPU Deployment Kit (GDK). NVML includes functions such as the following for enumerating and selecting GPU devices:

nvmlInit()
nvmlDeviceGetPciInfo()
nvmlDeviceGetCount()
nvmlDeviceGetHandleByIndex()
nvmlDeviceGetHandleByPciBusId()


nvmlDeviceSetPersistenceMode()

但是,许多NVML功能需要管理员访问权限然后重新启动以更改设置。因此,仅当您的用户对此表示满意(也许在初始安装期间)时,这些方法才可行。

However, many NVML functions require Admin access and a reboot to change settings. So these are only viable if your users are ok with this (perhaps during initial installation).

更好的选择是枚举Direct3D设备,然后选择最合适的设备:使用DirectX11枚举,并使用DirectX9枚举

A better option would be to enumerate the Direct3D devices and select the most appropriate one: Enumerating with DirectX11, and Enumerating with DirectX9.

这篇关于笔记本电脑双视频卡-如何以编程方式检测和/或选择使用哪个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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