How-To: Speed up StarNet++ as PI Module on nVidia GPUs with CUDA on Windows

darkarchon

Well-known member
Hello all,

you surely know about StarNet and its PixInsight module and we all know it can be very useful for generating Star Masks. However we also all know that is very slow.
We (well technically, @patdufour) have found and documented a way how to run StarNet on the GPU. At least for Windows and nVidia GPUs. It might be very specific but maybe this will help someone out running StarNet faster.

In terms of speed; I did test runs on my example images (8.3MP, drizzled 2x, 6708×5058)

CPU (Ryzen 7 2700X): 03:45.94 (that's 3 minutes, 45 seconds)
GPU (2080Ti): 25.804 seconds

For me this gives a 9 times speed increase. Results may vary but the GPU will pretty much always outperform the CPU.

Edit: The Guide has been udpated for PixInsight 1.8.8-6

Long story short, you can find the tutorial how to set it up here: https://darkskies.space/pixinsight-starnet-cuda/

Thanks for reading and have clear skies,
Stanley
 
Last edited:
excellent, thanks for the writeup. this is something i wanted to try but i don't use windows.
 
I think a similar solution might be possible for Linux since there is a tensorflow-gpu available for Linux as well. Technically all it would take would be to replace the original (.so I presume) and get CUDA 10.0 with cuDNN to run on the system. For OSX I don't know, I think that is more limited since OSX does not support tensorflow-gpu for all I know.
 
yes it should work on linux but (you guessed it) i use osx. google dropped support for tensorflow-gpu some time ago. it might have something to do with apple locking out new nvidia cards after osx 10.13.

rob
 
Oh meh. Scratch that. Seems like ROCm that supports AMD doesn't actually support macOS. Ruddy things.
 
Thank you! Works great!

My i9-9980HK with NVIDIA GTX 2060 (Zenbook Pro Duo) went from 3:05 minutes to 34.7 seconds for a 6248 x 4176 pixel OSC shot!

Roberto
 
Is there a minimum Cuda Compute Capability for running StarNet++ GPU ? I have two older nVidia graphic cards (1) a GeForce GT 730M with a Cuda Compute Capability of 3 and (2) a GeForce 930MX with 5. The GPU is not invoked on either of these cards when running StarNet++ gpu.

My understanding was that "libTensorflow_gpu" should execute in GPU mode on graphic cards with a Cuda Compute Capability of 3 or more. Elsewhere I have seen that a defect is causing "libTensorFlow-gpu" to only execute on graphic boards with a Cuda Compute Capability > 6.

Can some please clarify if there is a minimum Cuda Compute Capability for StarNet++ GPU.

Thanks and Cheers

RobC
 
@RobC I think the minimum might be CUDA 6 or 7. For all I know the new PI StarNet uses CUDA 8.


Also:
The Guide has been udpated for PixInsight 1.8.8-6
 
Just a few notes:

- The TensorFlow DLLs that are included with the Windows PixInsight distribution have been digitally signed with our corporate EV code signing certificate. This guarantees file integrity and provides protection against viruses and other malwares. If you replace these files with unsigned versions, you are taking an additional risk. Such risks are never negligible on Windows.

- We are going to release an optional update with GPU-enabled TensorFlow libraries for Linux and Windows, which of course will also be digitally signed. So we strongly recommend waiting until we make this update available.

- The StarNet weights databases are already being distributed as an official update (see the official announcement), so there is no need to download and copy them manually.
 
Thank you for the reply Juan. I know plenty of people who are used to running StarNet with CUDA support before and the guide has been updated for all of those who wanted to keep running it - most of them would not have updated to 1.8.8-6 because of missing CUDA support for the new StarNet.

I have updated the guide for the StarNet files. Most of it (CUDA, cuDNN installation etc.) will probably still apply the same way even when you release the officially GPU supported tensorflow.
 
While waiting for the future update- could you assist in the present?
I have followed the instructions..but there is something still not quite right. I have two GPUs on my computer. I think one on the motherboard and another separate one. Please see the attached image. You will see "Cuda" is listed as expected...but it is not being used. :(

-adam
 

Attachments

  • Capture.JPG
    Capture.JPG
    94.9 KB · Views: 131
It will kind of suck if PI becomes cuda only. Hopefully, they can figure out GPU support while not making everyone buy nvidia.
 
Oh, I completely agree with you Byron. But it would be great to have the option. I am still using an old 1080Ti but with this change starnet still ran faster than my 8 core i7-9700K which is no slouch
 
First of all, I don’t see Starnet in the list of modules in PI 1.8.8-6 fresh & clean default installation.
Probably, ’cause my pretty old processor (Intel Core i7 970) doesn’t support AVX instructions.

I’ve tried to overcome it with the use of my GPU (GTX 1060) as described above but it doesn’t work.
I’ve done all manipulation, re-booted, checked twice that environment variables were in place.

Does it mean that Starnet (or PI) somehow check compatibility of CPU with AVX instructions set and if AVX isn’t supported by CPU then Starnet will not be available in PI at all? It will be great if we will be able to use StarNet via CUDA on GPUs in this case...
 
Back
Top