Catalyst-ParaView implementation crashes with external ptr to GPU memory (CUDA)
When using a conduit node containing values set as an external pointer to a GPU allocated memory, then ParaView-Catalyst implementation crashes.
To reproduce:
- Download and unzip this small project: catalyst-cuda-master.zip
- Create a build folder in the source and configure with cmake, then build the software
- Set environment variable
CATALYST_IMPLEMENTATION_NAME=paraview
- Set environment variable
CATALYST_IMPLEMENTATION_PATHS=/path/to/catalyst/paraview/lib/folder
- Launch the
catalyst_gpu
executable - Crash in
vtkDataArrayPrivate::AllValuesMinAndMax
=> not OK!
A simple workaround is to use cudaMallocManaged
instead of cudaMalloc
on the simulation side, but a generic solution could be implemented on the ParaView side to handle GPU memory pointers and make explicit copy to RAM before processing it. Ascent seems to implement such a logic with their MagicMemory functions.
Thanks to @jfavre for the initial issue report and @louis.gombert for the minimal test case!