JJPPeters / clTEM

OpenCL accelerated multislice simulation for electron microscopy.
https://jjppeters.github.io/clTEM/
13 stars 3 forks source link

compiler optmisation flags causing segfaults on linux #124

Open arkdavy opened 2 years ago

arkdavy commented 2 years ago

Hi Jon,

We've got your reply regarding segmentation faults when clTEM compiled on linux (#117) with optimisation flags higher than -O0, which is the default. I assume that the most of processing is done on the GPU via libraries, and it is independent of clTEM compilation, therefore, this is not an urgent issue, but is worth hanging it here I guess. It is also worth checking whether the same happens on Windows.

Best, Arkadiy

JJPPeters commented 2 years ago

117 doesn't refer to segmentation faults. I have never had faults when compiling clTEM on linux. However, it has been a long time since I tested that, all I can remember is that it was on Ubuntu/Mint using GCC. Probably some of the updates I added since then have caused this problem though.

Can you give information on the Linux version, compiler versions and the versions of the external libraries you are using?

Do you know if the segmentation fault occurs in the simulation library, the command line or the GUI part?

arkdavy commented 2 years ago

Hi,

117 refers to Linux install, thought it is worth mentioning it here. We did some valgrind tests, it always crashes when calling to QT, JSON or OpenCL libraries (which might be purely Valgrind issue), but the one we report here (i.e., present only in -O1 comilation) is in /simulation/clwrapper/cldevice.h, and it's below the

device_name = device.getInfo<CL_DEVICE_NAME>(&status);

call (line 42). We did not understand the reason behind it. It could be the labraries issue. We currently compiled it with GCC/10.2.0 CUDA/11.1.1 (shipped with OpenCL/3.0, at least this version is reported using a script from here https://github.com/sivagnanamn/opencl-device-info)