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 GPU Device
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 Local GPU Devices
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.
Choose GPU Device to Validate
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
ind
— Indices of GPU devices
integer | vector of integers
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
List of Validation Steps
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 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)