canUseGPU
Verify supported GPU is available for computation
Syntax
Description
returns a logical value
indicating if there is a GPU available for computation. The function returns logical
tf
= canUseGPU1
(true
) if there is a supported GPU available, a
recent GPU driver is present, and Parallel Computing Toolbox™ is installed and licensed for use. Otherwise, the function returns logical
0
(false
).
Use canUseGPU
to avoid executing code that requires a GPU if one is
not available. Using a GPU requires Parallel Computing Toolbox and a supported GPU device. For information on supported GPUs, see GPU Computing Requirements (Parallel Computing Toolbox). To diagnose issues
with your GPU, for example if canUseGPU
unexpectedly returns
0
(false
), use the validateGPU
(Parallel Computing Toolbox).
Examples
Version History
Introduced in R2019b
See Also
gpuDevice
(Parallel Computing Toolbox) | gpuDeviceCount
(Parallel Computing Toolbox) | validateGPU
(Parallel Computing Toolbox) | canUseParallelPool
| gpuArray
(Parallel Computing Toolbox)
Topics
- Run MATLAB Functions on a GPU (Parallel Computing Toolbox)
- Identify and Select a GPU Device (Parallel Computing Toolbox)
- GPU Computing Requirements (Parallel Computing Toolbox)