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

darkarchon

Active member
Mar 28, 2018
30
18
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:

pfile

PTeam Member
Nov 23, 2009
5,625
105
excellent, thanks for the writeup. this is something i wanted to try but i don't use windows.
 

darkarchon

Active member
Mar 28, 2018
30
18
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.
 

pfile

PTeam Member
Nov 23, 2009
5,625
105
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
 

pfile

PTeam Member
Nov 23, 2009
5,625
105
i will check it out after i build this new machine - my current mac has an nvidia graphics card.
 
  • Like
Reactions: szymon

szymon

Active member
May 2, 2020
42
10
Oh meh. Scratch that. Seems like ROCm that supports AMD doesn't actually support macOS. Ruddy things.
 

RobC

New member
Jan 2, 2014
4
0
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
 

darkarchon

Active member
Mar 28, 2018
30
18
@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
 

Juan Conejero

PTeam Member
Sep 2, 2004
7,555
96
56
Valencia, Spain
pixinsight.com
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.
 

darkarchon

Active member
Mar 28, 2018
30
18
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.
 

ngc1535

PTeam Member
Feb 1, 2014
531
68
AdamBlockStudios.com
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