nVIDIA驱动程序如何将设备索引分配给GPU? [英] How do the nVIDIA drivers assign device indices to GPUs?

查看:112
本文介绍了nVIDIA驱动程序如何将设备索引分配给GPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设在单个节点上,有几个具有不同计算功能的设备,nvidia如何对其排序(按级别,我是指cudaSetDevice分配的数字)?

Assume on a single node, there are several devcies with different compute capabilities, how nvidia rank them (by rank I mean the number assigned by cudaSetDevice)?

是关于此有任何一般性准则吗?谢谢。

Are there any general guideline about this? thanks.

推荐答案

我相信与 cudaGetDevice cudaSetDevice (即CUDA运行时枚举顺序应基于启发式方法,该方法确定最快的设备并使其成为第一个,或者基于 PCI枚举顺序。您可以使用 deviceQuery示例,该示例根据设备枚举的顺序打印设备的属性(包括PCI ID) cudaSetDevice。

I believe the ordering of devices corresponding to cudaGetDevice and cudaSetDevice (i.e. the CUDA runtime enumeration order should be either based on a heuristic that determines the fastest device and makes it first or else based on PCI enumeration order. You can confirm this using the deviceQuery sample, which prints the properties of devices (including PCI ID) based on the order they get enumerated in for cudaSetDevice.

但是我建议不要以此为依据。 PCI枚举顺序没有什么神奇的,甚至系统BIOS升级之类的东西也可以更改设备枚举顺序(交换设备,移动到另一个系统等也可以)。

However I would recommend not to base any decisions on this. There's nothing magical about PCI enumeration order, and even things like a system BIOS upgrade can change the device enumeration order (as can swapping devices, moving to another system, etc.)

通常最好查询设备(请参阅deviceQuery示例),然后根据返回的特定设备和/或其属性做出决策。您还可以使用 cudaChooseDevice 来启发式选择设备

It's usually best to query devices (see the deviceQuery sample) and then make decisions based on the specific devices returned and/or their properties. You can also use cudaChooseDevice to select a device heuristically.

您可以使CUDA运行时根据环境变量在CUDA 8中。

You can cause the CUDA runtime to choose either "Faster First" or "PCI Enumeration Order" based on the setting (or lack of) an environment variable in CUDA 8.

这篇关于nVIDIA驱动程序如何将设备索引分配给GPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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