validateGPU
说明
示例
验证当前选定的 GPU 设备。如果未选择 GPU 设备,该函数将验证默认设备。validateGPU
函数打印执行的验证步骤以及每个步骤是通过、失败还是被跳过的指示。如果验证步骤失败,该函数将打印一条诊断消息。
validateGPU
# Beginning GPU validation # Performing system validation # CUDA-supported platform .................................................PASSED # CUDA-enabled graphics driver exists .....................................PASSED # Version: 537.70 # CUDA-enabled graphics driver load .......................................PASSED # CUDA environment variables ..............................................PASSED # CUDA device count .......................................................PASSED # Found 2 devices. # GPU libraries load ......................................................PASSED # # Performing device validation for device index 1 # Device exists ...........................................................PASSED # NVIDIA RTX A5000 # Device supported ........................................................PASSED # Device available ........................................................PASSED # Device is in 'Default' compute mode. # Device selectable .......................................................PASSED # Device memory allocation ................................................PASSED # Device kernel launch ....................................................PASSED # # Finished GPU validation with no failures.
验证系统中存在的所有 GPU 设备。validateGPU
函数执行一次一系列系统验证检查,然后对每个检测到的设备执行一次一系列设备验证步骤。
validateGPU("all")
# Beginning GPU validation # Performing system validation # CUDA-supported platform .................................................PASSED # CUDA-enabled graphics driver exists .....................................PASSED # Version: 537.70 # CUDA-enabled graphics driver load .......................................PASSED # CUDA environment variables ..............................................PASSED # CUDA device count .......................................................PASSED # Found 2 devices. # GPU libraries load ......................................................PASSED # # Performing device validation for device index 1 # Device exists ...........................................................PASSED # NVIDIA RTX A5000 # Device supported ........................................................PASSED # Device available ........................................................PASSED # Device is in 'Default' compute mode. # Device selectable .......................................................PASSED # Device memory allocation ................................................PASSED # Device kernel launch ....................................................PASSED # # Performing device validation for device index 2 # Device exists ...........................................................PASSED # Quadro P620 # Device supported ........................................................PASSED # Device available ........................................................PASSED # Device is in 'Default' compute mode. # Device selectable .......................................................PASSED # Device memory allocation ................................................PASSED # Device kernel launch ....................................................PASSED # # Finished GPU validation with no failures.
验证索引为 2
的 GPU 设备。
validateGPU(2)
# Beginning GPU validation # Performing system validation # CUDA-supported platform .................................................PASSED # CUDA-enabled graphics driver exists .....................................PASSED # Version: 537.70 # CUDA-enabled graphics driver load .......................................PASSED # CUDA environment variables ..............................................PASSED # CUDA device count .......................................................PASSED # Found 2 devices. # GPU libraries load ......................................................PASSED # # Performing device validation for device index 2 # Device exists ...........................................................PASSED # Quadro P620 # Device supported ........................................................PASSED # Device available ........................................................PASSED # Device is in 'Default' compute mode. # Device selectable .......................................................PASSED # Device memory allocation ................................................PASSED # Device kernel launch ....................................................PASSED # # Finished GPU validation with no failures.
如果您有多个 GPU 设备,那么您可以通过传递设备索引向量作为输入,使用对 validateGPU
的一次调用来验证多个设备。例如,要验证 GPU 设备 1
和 2
,请调用 validateGPU([1 2])
。
输入参数
数据类型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
提示
算法
validateGPU
执行这些系统级验证步骤。
验证步骤 | 描述 |
---|---|
CUDA-supported platform | 操作系统支持 CUDA®。 |
CUDA-enabled graphics driver exists | 找到了受支持的 CUDA 驱动程序。 |
CUDA-enabled graphics driver load | MATLAB® 可以加载 CUDA 驱动程序。 |
CUDA environment variables | 没有设备被诸如 |
CUDA device count | 至少有一个设备。 |
GPU libraries load | MATLAB 可以加载 Parallel Computing Toolbox™ GPU 库。 |
validateGPU
执行这些设备级验证步骤。如果您验证多个设备,则对每个设备重复这些步骤。
验证步骤 | 描述 |
---|---|
Device exists | MATLAB 可以检测到该设备。 |
Device supported | 该设备的计算能力由 MATLAB 支持。 |
Device available | 设备处于可用状态。 |
Device selectable | MATLAB 可以选择该设备。 |
Device memory allocation | MATLAB 可以创建 |
Device kernel launch | MATLAB 可以启动 GPU 内核。 |
版本历史记录
在 R2024b 中推出
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)