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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)