ST_CheckGPU
Updated at:
Copy as MD
Checks whether a GPU is available in the current runtime environment.
Syntax
text ST_CheckGPU();Description
ST_CheckGPU() checks whether a GPU can be identified in the current runtime environment of ApsaraDB for RDS. When a GPU is detected, the function returns a string listing the CUDA device properties.
Return value
When a GPU is available, the return value is a text string in the following format:
[GPU prop]multiProcessorCount=<value>; sharedMemPerBlock=<value>; maxThreadsPerBlock=<value>The returned string contains the following CUDA device properties:
| Property | Description |
|---|---|
multiProcessorCount | The number of streaming multiprocessors (SMs) on the GPU. Higher values indicate more parallel processing capacity. |
sharedMemPerBlock | The amount of shared memory available per thread block, in bytes. For example, 49152 means 48 KiB of shared memory per block. |
maxThreadsPerBlock | The maximum number of threads that can run in a single thread block. This determines the upper bound of parallelism for GPU-accelerated spatial operations. |
Examples
Run the following query to check whether a GPU is available:
SELECT ST_CheckGPU();If a GPU is available, the output is similar to:
[GPU prop]multiProcessorCount=20; sharedMemPerBlock=49152; maxThreadsPerBlock=1024
(1 row)See also
For other Ganos auxiliary functions, see the Ganos auxiliary functions overview.
Is this page helpful?