Using GPU acceleration with OCCT

Hi everyone,

After some research I didn't find any recent information about the possibility of using GPU acceleration with OCCT.

Here's basically what I want to do : parallelize the computing of BRepAlgoAPI_Section.

I'm using MCVS 2015 and I successfully parallelize on the CPU with OpenMP but I want to improve the performances by using the GPU aswell.

I tried CUDA but the OCCT functions don't seem to be supported. Since Visual Studio supports only OpenMP v2 I couldn't use it to split to the GPU.

Does anyone have any information on this issue ? Is it even possible to do what I want ?

Thank you for reading,

Have a good day.

Benjamin

Kirill Gavrilov's picture

Parallelization on GPU is much more complicated than using multiple CPU threads.
It requires solving a lot of problems:
- Revising algorithm to find places optimal for utilization of GPU computing resources. This is NOT the same as parallelization on CPU due to major architectural differences.
- Finding an optimal workflow for streaming data to and from GPU memory, since most powerful GPUs relies on dedicated fast memory blocks. The most optimal workflow is keeping data in GPU memory (e,g, for visualization results), but apparently it is not applicable to algorithms like BRepAlgoAPI_Section.
- Prepare several use cases and analyze amount of data to be streamed, algorithm usage frequency, computational complexity to roughly estimate potential benefits of GPU resources utilization (or lack of benefits due to overhead on data streaming or algorithm overcomplexity for GPU architecture due to intensive branching / loops / etc.).
- Developing an algorithm using one or another API - plenty of them (CUDA, OpenCL, OpenGL compute shaders, Vulkan compute shaders, etc.). Note that as OCCT is an open source multi-platform framework, the open and multi-platform external APIs are preferred over vendor-locked proprietary solutions.
- Optimize implementation for several common GPU architectures and work out hardware-specific limitations / pitfalls to make it generally applicable and not locked to one-two rare and extremely expensive server configurations.
- Validate performance and robustness of algorithm results on GPU vs. CPU. The performance should be much better to justify significant efforts for supporting GPU algorithm code path in future (as long as there will be no efficient solution allowing to share most algorithm code between CPU and GPU implementations). The GPU results also should match CPU results with sufficient precision. Beware that OCCT algorithms deal with complex geometry and require double floating point precision to produce meaningful results, and single precision / half precision floats (where GPUs show their best) are not applicable at all.

I would say that this task requires significant R&D efforts with unpredictable results, and at first step it makes sense starting with some simple OCCT algorithm.
Utilization of GPU could be promising within computationally intensive, but relatively local algorithm, which is difficult to find in OCCT - trying to convert a whole set of small algorithms utilized by OCCT high-level API would be extremely painful considering limitations of existing APIs for GPU computations.

Paul, Le's picture

I agree with this very good view of the large problem of; How To Use GPU in OCCT?

> I tried CUDA but the OCCT functions don't seem to be supported.

CUDA is not a long term coding language and it only works for NVidia GPU.

Please, only use standard as OpenGL and OpenCL or Vulkan if you are a Hard Coder.

benjamin.longa_146405's picture

Thank you very much for your quick & detailed answer !

Have a nice end of week.

Benjamin