This guide has been updated to work with the PixInsight 1.8.8-6 version, which has StarNet++ included. It will not work with the old StarNet++ version anymore. If you did this guide before you will need to follow it thoroughly again because all dependencies are updated.
If you are reading this you have found this post most likely by a Google search or have been linked to it. What is it for? Well if you are here, you are looking for a way to speed up Starnet++. And there is one, by utilizing the GPU in your system to bring the speed up. We’re talking a factor of at least 5x as fast as before. On my system (Ryzen 7 2700x, GeForce 2080Ti) it went from 3 minutes 45 seconds on my CPU to 25 seconds via CUDA!
There is a caveat: this method only works on 64bit Windows and only with nVidia GPUs. It does not require PixInsight but the tutorial will focus on getting it to run within the application. Got those prerequisites? Then let’s continue.
Note: this only works with a NVIDIA GPU card with CUDA architectures 3.5, 3.7, 5.2, 6.0, 6.1, 7.0 and higher than 7.0. See the list of CUDA-enabled GPU cards.
(Prerequisites and downloads)
You will need to download several things to get this setup running.
Bringing the system online
Step 1: Replace the tensorflow.dll
- Open the downloaded libtensorflow-gpu-windows-x86_64-2.3.0.zip
- Extract the tensorflow.dll from ‘lib’ folder to ‘C:\Program Files\PixInsight\bin’, overwriting existing files
Step 2: Install CUDA
- Run the cuda_10.1.243_win10_network.exe
- Select ‘Custom (Advanced)’
- Deselect everything but CUDA -> Runtime -> Libraries
- Make sure to deselect the Demo Suite in Libraries too
- Press next until installation is done
Step 3: Install cuDNN
- Open the downloaded cudnn-10.1-windows10-x64-v220.127.116.11
- Extract the folder ‘bin’ from the included folder ‘cuda’ to ‘C:\Program Files\NVIDIA GPU Computing Toolit\CUDA\V10.1’
Step 4: Edit Environment Variables
- You will need to set 2 environment variables in Windows so everything runs flawlessly
- Open the start menu and search for ‘environment’, select ‘Edit the system environment variables’
- In the window open ‘Environment Variables’, click on ‘New’ and enter “TF_FORCE_GPU_ALLOW_GROWTH” as name and “true” as value, Press OK to confirm
- Look for the variable called ‘Path’, select it and click on ‘Edit’, if not present the folder “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin” needs to be added by pressing ‘New’ and adding it
- Press OK to close everything
Step 5: Verify everything works
- Open the Windows Task Manager, go to the ‘Performance’ tab and select GPU 0
- In one of the Drop Downs select ‘Cuda’ as performance metric
- Note: you might not have ‘Cuda’ as performance metric. This is ok. However then you will just see the GPU usage rise.
- Open PixInsight and load in one of your images, ideally one that is non-linear (or stretch it quickly)
- Run the StarNet process from PROCESS -> <All Processes> -> StarNet
- Edit it to include the path to the downloaded weights in C:\Program Files\PixInsight\library\
- If you do not have the files there, make sure to update your PixInsight through Resources -> Updates -> Check for Updates
- Apply the default Process on the image
- Watch the Task Manager GPU or CUDA utilization, it should spike up shortly after StarNet process has begun
- If it does not and your CPU spikes instead, you did something wrong. Verify that you did all steps (especially the Environment Variables)
Gotta Go Fast
Not much I can say here, I only tested it on one image as of the time of writing. Nonetheless, those are the results for a 8.3MP image drizzled to 2x scale, StarNet running with Stride 128.
Thanks for reading, enjoy the new sped up StarNet and have clear skies!