I have been trying to use the CosmicClarity_sharpen.py script on my Ubuntu 24.04 system. This script is cited in the manual as an example of using a TkInter interface to wrap around an outside application.
The script runs and works - except for one thing. Though my system is equipped with a GPU, GPU acceleration does not work in the script. It produces the message “No GPU acceleration available. Using CPU.” I got in touch with the SetiAstro folks and they suggested I just run the executable outside Siril. It ran like a charm producing identical output to what the Siril script did, but in perhaps 10 seconds, as opposed to 5-20 minutes.
It appears to me then that the script’s dialog box lacks some of the functionality of the application’s dialog box and is not passing all the information needed to run the GPU. Looking at the script’s code, the only thing its dialog box does with the Use GPU checkbox is append
“–disable_gpu” to the command line if it is NOT checked.
This may be a linux-only problem that does not exist in Windows, but it certainly degrades the utility of the script under Linux at least. I would be interested in hearing if Windows users have this problem.
I got this reply on SetiiAstro’s Discord which seems possibly useful.
I’m a bit fuzzy on the specifics, but I believe the issue is that many of the Siril scripts use a basic python template that loads a common set of libraries, one of which is tensorflow. If I recall Cosmic clarity does not use tensorflow but if it is loaded, Cuda will assume you want to use it. Tensorflow is not compatible with many older GPUs. So in my case for example, Cuda will revert to CPU if I run from Siril because it thinks I need tensorflow and my gpu won’t work with it. If I run standalone, tensorflow never enters the picture and Cuda will use the GPU.
So the question is “is tensorflow enabled by default in Siril’s python implementation, and if so, is it possible to remove it from the list of python libraries that will be loaded, preferably for this script?” If it can’t be removed on a script by script basis, can it safely be removed for all siril python scripts?
Just to amuse myself and prove to myself that I can still code (retired 2018), I tried making my own version of the sharpen python script. It simply calls the executable, using that excecutable’s own dialog.
It gives the same error. This would seem to confirm the diagnosis that something in the Siril load of python libraries tells Cosmic Clarity that the GPU option won’t work.