validateGPU
Description
validateGPU
validates the currently selected GPU device. If no GPU
device is selected, then the function validates the default device.
validateGPU(
validates all GPU devices
detected in your system."all"
)
Examples
Validate the currently selected GPU device. If no GPU device is selected, the function validates the default device. The validateGPU
function prints the validation steps performed and an indication of whether each step passed, failed, or was skipped. If a validation step fails, the function prints a diagnostic message.
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.
Validate all GPU devices present in your system. The validateGPU
function performs a series of system validation checks once, and then a series of device validation steps once for each device detected.
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.
Validate the GPU device with index 2
.
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.
If you have multiple GPU devices, then you can validate several using a single call to validateGPU
by passing a vector of device indices as input. For example, to validate GPU devices 1
and 2
, call validateGPU([1 2])
.
Input Arguments
Indices of GPU devices to validate, specified as an integer or vector of integers in
the range 1
to gpuDeviceCount
.
Example: 2
Example: [1 3]
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Tips
To validate remote GPUs, start a parallel pool using your cluster with as many workers as there are GPUs, then call
validateGPU
inside anspmd
block.For more information about using remote GPUs, see Work with Remote GPUs.cluster = parcluster("myRemoteGPUCluster"); pool = parpool(cluster,numGPUs); spmd validateGPU end
Algorithms
The validateGPU
performs these system-level validation
steps.
Validation Step | Description |
---|---|
CUDA-supported platform | CUDA® is supported on the operating system. |
CUDA-enabled graphics driver exists | A supported CUDA driver is found. |
CUDA-enabled graphics driver load | MATLAB® can load the CUDA driver. |
CUDA environment variables | No devices are hidden by environment variables such as
|
CUDA device count | There is at least one device. |
GPU libraries load | MATLAB can load Parallel Computing Toolbox™ GPU libraries. |
The validateGPU
performs these device-level validation steps. If
you validate more than one device, then these steps are repeated for each device.
Validation Step | Description |
---|---|
Device exists | MATLAB can detect the device. |
Device supported | The device's compute capability is supported by MATLAB. |
Device available | The device is in an available state. |
Device selectable | MATLAB can select the device. |
Device memory allocation | MATLAB can create a |
Device kernel launch | MATLAB can launch a GPU kernel. |
Version History
Introduced in 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)