Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[feature] OpenCL support #7451
This is the implementation of QEP 121: qgis/QGIS-Enhancement-Proposals#121 that was accepted as a GRANT candidate.
The following processing algorithms have been ported:
Even if was not in scope for this QEP, the hillshade renderer has been optimized and can also benefit of OpenCL acceleration.
I tested this implementation on 2 different machines (with Linux on both):
Note that on machine 2, the intel OpenCL runtime identifies two different OpenCL devices, one is the CPU and the other is the GPU, while the AMD OpenCL runtime only identifies the GPU as an OpenCL device on machine 1.
The tests have been run by comparing two different algorithms (slope and hillshade) on three different implementations from the QGIS processing toolbox:
The input raster is a 40000x40000 DEM float 32: eu_dem_v11_E40N20 from copernicus.
Building and configuration
A new CMake option (enabled by default) will build QGIS with OpenCL support, (opencl dev headers need to be installed on the building machine).
To run OpenCL, you need to install:
Note that OpenCL in QGIS is opt-in: you need to enable it in the QGIS options dialog as shown below:
Selecting a different OpenCL device
If you happen to have more than one OpenCL device on your system you will notice more than one entry in the a.m. configuration dialog, please note that if you change the device QGIS needs to be restarted in order to pick up the new settings.
@elpaso , I can't get to compile QGIS with OpenCL enabled on my machine (Ubuntu 18.04, NVIDIA driver), I get the following error:
@elpaso , I'm on Ubuntu 18.04 LTS. Ubuntu's packages website indicates this is a new package since 18.04: https://packages.ubuntu.com/search?keywords=opencl-clhpp-headers