How to enable GPU acceleration for PixInsight
Certain processes in PixInsight, like StarNet2 and the RC-Astro XTerminator tools, benefit massively from running on the GPU. Typically they take minutes to finish when using the CPU, but with a CUDA capable GPU they'll be done in less than 30s.
Download the following 4 files:
NVIDIA CUDA Toolkit 11.8.0(
https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe)
NVIDIA cuDNN 8.7.0 for CUDA 11.x(
https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe)
TensorFlow 2.9.0(
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-2.9.0.zip)
zLib DLL x64 1.2.3(
http://www.winimage.com/zLibDll/zlib123dllx64.zip)
1. Replace tensorflow- Go to 'C:\Program Files\PixInsight\bin'- Rename tensorflow.dll to tensorflow-old.dll in case you want to use it later and don't want to re-install- Open libtensorflow-gpu-windows-x86_64-2.9.0.zip- Extract tensorflow.dll from 'lib' to 'C:\Program Files\PixInsight\bin'
2. Install CUDA- Run cuda_11.8.0_windows_network.exe- Select 'Custom (Advanced)'
Deselect everything, then select 'Libraries' in CUDA > Runtime
3. Install cuDNN- Open cudnn-windows-x86_64-8.7.0.84_cuda11-archive.zip- Extract the contents of the folder 'bin' to 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin'- Overwrite existing files if you are updating from another version
4. Install zLib- Open zlib123dllx64.zip- Extract zlibwapi.dll from 'dll_x64' to 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin'
5. Edit Environment Variables- Open the start menu, search for 'environment', and click 'Edit the system environment variables'
- Click 'Environment Variables', then under 'System variables' click 'New' and enter "TF_FORCE_GPU_ALLOW_GROWTH" as name and "true" as value, then click 'OK'
Select the variable called 'Path' under 'System variables', and click 'Edit'
- Click 'New', and add "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin"- If you had previously installed a different version of the CUDA Toolkit, there might be a path pointing to that version as well; remove it if you don't need it, otherwise move it down below 11.8 on the list- Click 'OK' to save and exit
Troubleshooting-
If CPU usage increases instead of the GPU, then re-do steps 1, 3 and 5- If PixInsight crashes, re-do step 4- If still not working, re-do everythingPixInsight re-installs and major updates will overwrite the tensorflow.dll, so step 1 must be re-done occasionally.