PCL, Pixinsight crashing when installing modules

r1k7f3

Member
Dec 25, 2020
6
1
I'm creating a module for pixinsight that requires tensorflow. When I add -ltensorflow and -ltensorflow_framework into makefile-x64 the module builds fine but when I try to install it in pixinsight the application crashes without any errors.
I am using tensorflow 2.8 C api, so I changed the dylib files.
How can I get a log file of what is appening when pixinsight crashes?
I am on macOS.
 

robyx

PixInsight Staff
Jul 17, 2019
861
344
45
Zurich
I am using tensorflow 2.8 C api, so I changed the dylib files.
I think that you need to stick with the TensorFlow library distributed with PixInsight, at runtime you cannot have both versions loaded in memory so your code will find version 2.6 at runtime, most probably this is the reason for the crash.

Is version 2.8 the minimum required or could you downgrade to 2.6?
 

r1k7f3

Member
Dec 25, 2020
6
1
Same error using 2.6
If I first install a version of my module without -ltensorflow and -ltensorflow_framework flags and then I replace my dylib in bin with one that is compiled with the flags I get this error

Code:
<* failed *>

*** PixInsight API Error: Module: /Applications/PixInsight/bin/StarPoint-pxm.dylib

Cannot load library /Applications/PixInsight/bin/StarPoint-pxm.dylib: (dlopen(/Applications/PixInsight/bin/StarPoint-pxm.dylib, 0x0006): Library not loaded: @rpath/libtensorflow.2.dylib

  Referenced from: /Applications/PixInsight/bin/StarPoint-pxm.dylib

  Reason: tried: '/Applications/PixInsight/PixInsight.app/Contents/MacOS/../Frameworks/libtensorflow.2.dylib' (no such file), '/Applications/PixInsight/PixInsight.app/Contents/Frameworks/QtCore.framework/Versions/5/Frameworks/libtensorflow.2.dylib' (no such file), '/Applications/PixInsight/PixInsight.app/Contents/MacOS/../Frameworks/libtensorflow.2.dylib' (no such file), '/usr/lib/libtensorflow.2.dylib' (no such file)): Module load error
Then if I add all the libtensorflow dylib to Contents/Frameworks/ when I open pixinsight it crashes
 

r1k7f3

Member
Dec 25, 2020
6
1
I've also tried to compile the StarNet code on PCL gitlab, it crashes in the same fashion as my module.
Is there a way to debug and see what is happening?
 

pfile

PTeam Member
Nov 23, 2009
7,792
488
what kind of mac are you running, is it M1 or x64 and it doesn't happen to have a Xeon CPU does it?
 

pfile

PTeam Member
Nov 23, 2009
7,792
488
ok well you'll need to get tensorflow libraries that were compiled without AVX2/FMA because rosetta does not support those.

the tensorflow libraries that ship with StarNet2 do not have those instructions, so assuming they are the right version, you can try those. otherwise you might have to build tensorflow itself from scratch and turn off the vector instructions in gcc/clang

rob