We have been very successful in setting up Miniconda to work with StarDist 2D using our GPUS on Windows 10 machines
What is great is that Anaconda manages the CUDA libraries for each TensorFlow version -> No NVIDIA installation steps.
NOTE: The most tedious part is the installation of `gputools` which helps speed up StarDist **Training **considerably.
IMPORTANT: This install makes use of **[[https://developer.nvidia.com/cuda-10.1-download-archive-update2?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exenetwork| CUDA Toolkit 10.1 update 2]]** which is the currently recommended version for TensorFlow 2.1. If this changes, it will be written here: https://www.tensorflow.org/install/gpu#software_requirements
# Requirements
## Miniconda
Please install the latest version of Minconda for Windows 10, and **Python 3.7**
https://docs.conda.io/en/latest/miniconda.html
For us, as we use miniconda for multiple users, we select `Install for all users` when prompted during installation
## Build Tools for Visual Studio
StatDist needs to compile certain files, so you need a gcc compiler installed so that usually means the [[ https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019 | Build Tools for Visual Studio 2019 ]]
The minimum individual components that you need are the following:
1. `MSVC v142 - VS 2019 C++ x64/x86 build tools`
2. `Windows 10 SDK (10.0.18362.0)`
# NVIDIA CUDA Version 10.1 update 2
Download [[https://developer.nvidia.com/cuda-10.1-download-archive-update2?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exenetwork| CUDA Toolkit 10.1 Update 2]]
For this installation (Advanced mode), you just need the `Developper` and `Runtime` parts.
{F14514741,size=full}
# CuDNN
For this installation, you do not explicitely need CuDNN installed but you might as well. You need to login in to your NVIDIA account order to have them.
https://developer.nvidia.com/rdp/cudnn-download#a-collapse802-101
unzip and paste folders into **C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\**
# Setup Environement Variables
To compile `pyopencl`, which is needed by `gputools` you need to ensure that the following two environement variables are set
|VARIABLE NAME | Path (Default) |
|-------------------|-----------------|
|INCLUDE| C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include|
|LIB| C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64|
# StarDist Conda Environment
We provide the basic yml file for installing starDist and all dependencies, including JupyterLab
{F14459135}
Download the file above and from your `Anaconda prompt` prompt run the following:
## Previous environment file, before TF 2.1
{F13864455}
Start Anaconda prompt :
```
conda env create -p DESIRED_PATH_TO_STARDIST -f PATH_TO\biop-deep_2.yml
```
For example
```
conda env create -p d:\stardist-env -f "C:\Users\oburri\Desktop\StarDist Install Full\biop-deep_2.yml"
```
### Add tensorboard :
Within environment terminal
**jupyter labextension install @jupyter-widgets/jupyterlab-manager & jupyter labextension install jupyterlab_tensorboard**
# Testing your installation
## Download the StarDist repository: https://github.com/mpicbg-csbd/stardist
Unzip it somewhere to test it out
`eg. D:\stardist-repo`
## Activate the environment you just created
`conda activate d:\stardist-env`
##Navigate to the folder where you unzipped StarDist and Start Jupyter Lab
```
d:
cd stardist-repo
jupyter lab
```
Try to run the 2D demos with the GPU option set to `True`
```