GanosBase automatically enables GPU-accelerated computing when it detects a GPU — no configuration required. For Raster workloads that are compute-intensive or embarrassingly parallel, GPU acceleration delivers significantly higher throughput than CPU-based processing for the same operations.
How it works
GPU acceleration in GanosBase operates at the field object level. GanosBase converts a field object into a model suited for parallel computing, then distributes the workload across the GPU's multiple cores.
GPU acceleration is transparent — existing queries run unchanged and benefit automatically when a GPU is present.
Prerequisites
Before you begin, ensure that you have:
A PolarDB for PostgreSQL cluster with a GPU-equipped node
The
ganos_rasterextension installed, or access to create itAccess to a database session (for example,
rasterdb)
Check GPU availability
Create the
ganos_rasterextension:CREATE EXTENSION ganos_raster CASCADE;Run
st_checkgpu()to verify whether a GPU is available:SELECT st_checkgpu();GPU detected — GanosBase returns the GPU device properties:
rasterdb=# SELECT st_checkgpu(); st_checkgpu ------------------------------------------------------------------------------------------------------------------------------ [GPU(0) prop]multiProcessorCount=20; sharedMemPerBlock=49152; totalGlobalMem=-608239616; maxThreadsPerBlock=1024; maxThreadsPerMultiProcessor=2048; cudaThreadGetLimit=1024 . (1 row)No GPU detected — GanosBase returns an error message:
rasterdb=# SELECT st_checkgpu(); st_checkgpu ------------------------------------------------------------------------------------------------------------------------------------------ There is not gpu device on current environment, cuda_errorcode=35, errormsg=CUDA driver version is insufficient for CUDA runtime version. (1 row)
GPU-accelerated computing can be enabled only in an environment where a GPU is available.
Control GPU acceleration at the session level
In a GPU environment, GanosBase enables GPU acceleration by default. The ganos.raster.use_cuda parameter controls this behavior per session.
| Parameter | Type | Default | Description |
|---|---|---|---|
ganos.raster.use_cuda | Boolean | on | Enables (on) or disables (off) GPU acceleration for the current session. |
When to disable GPU acceleration: A single GPU has limited resources. When many sessions compete for GPU resources simultaneously, we recommend that you disable GPU acceleration at the session level for highly concurrent workloads.
Disable GPU acceleration:
SET ganos.raster.use_cuda = off;Verify the change:
rasterdb=# SET ganos.raster.use_cuda = off;
SET
rasterdb=# SHOW ganos.raster.use_cuda;
ganos.raster.use_cuda
-----------------------
off
(1 row)Re-enable GPU acceleration:
SET ganos.raster.use_cuda = on;Verify:
rasterdb=# SET ganos.raster.use_cuda = on;
SET
rasterdb=# SHOW ganos.raster.use_cuda;
ganos.raster.use_cuda
-----------------------
on
(1 row)Supported modules
GPU acceleration is currently available in the GanosBase Raster module. Support for the GanosBase Trajectory and GanosBase Geometry modules is planned for a future release.
Troubleshooting
GPU acceleration is not taking effect
If you suspect GPU acceleration is not active despite a GPU being present:
Confirm the session parameter is set to
on:SHOW ganos.raster.use_cuda;Confirm the
ganos_rasterextension is installed:SELECT * FROM pg_extension WHERE extname = 'ganos_raster';Confirm the GPU is still detected in the current environment:
SELECT st_checkgpu();
If st_checkgpu() returns an error, the GPU is unavailable. Check that the CUDA driver version is compatible with the CUDA runtime version on the node.