ST_CheckGPU

更新时间:
复制 MD 格式

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:

PropertyDescriptionUnit
multiProcessorCountNumber of streaming multiprocessors (SMs) on the GPUCount
sharedMemPerBlockShared memory available per thread blockBytes
maxThreadsPerBlockMaximum number of threads per thread blockCount

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.