Checks whether a GPU is available in the current runtime environment of PolarDB for PostgreSQL.
Syntax
text ST_CheckGPU();Description
ST_CheckGPU queries the GPU hardware recognized by the current PolarDB for PostgreSQL instance and returns its properties as a text string.
The returned string contains the following CUDA device properties:
| Property | Description | Unit |
|---|---|---|
multiProcessorCount | Number of streaming multiprocessors (SMs) on the GPU | Count |
sharedMemPerBlock | Shared memory available per thread block | Bytes |
maxThreadsPerBlock | Maximum number of threads per thread block | Count |
Examples
select st_checkgpu();Output:
----------------------------------------------------------------------------------------
[GPU prop]multiProcessorCount=20; sharedMemPerBlock=49152; maxThreadsPerBlock=1024
(1 row)In this example, the GPU has 20 streaming multiprocessors, 49,152 bytes (48 KiB) of shared memory per block, and supports up to 1,024 threads per block.
该文章对您有帮助吗?