CSBDeep in Fiji – Installation

Deborah Schmidt edited this page Jan 8, 2019 · 6 revisions

Fiji / ImageJ

Download Fiji from the Fiji Download page and install it by simply unpacking it.

CSBDeep Plugin

  1. Go to Help > Update...

  1. Open the update manager by clicking Manage update sites
  2. Add an update site with the URL http://sites.imagej.net/CSBDeep/ and the Name CSBDeep and close the 'Manage update sites' window again

  1. Click Apply changes to install the plugin

  1. Restart Fiji

GPU support

Install Requirements

Install the NVIDIA requirements to run TensorFlow with GPU support as described in the TensorFlow Documentation.

This includes the recent CUDA® Toolkit and cuDNN.

Set the library path (Linux only)

There are two options to make CUDA visible to Fiji and TensorFlow:

Option 1 (easy but annoying in the long-term):

  • Add the path of CUDA and cuDNN to your LD_LIBRARY_PATH environment variable. (This is also part of the installation instructions above)

  • Always start Fiji from the command line:

    $ /path/to/Fiji.app/ImageJ-linux64
    

    This makes sure the LD_LIBRARY_PATH environment variable is set in Fiji.

Option 2 (root necessary)

NOTE:

  • This will add CUDA and cuDNN to the system-wide library path
  • CUDA and cuDNN will be available to all system users
  • You need to have root access on the system (or ask your system admin)
  • There may be differences for different Linux distributions (Tested on Linux Mint 18.1 Cinnamon 64-bit).

Add a file to /etc/ld.so.conf.d/ called cuda.conf with the content: (Replace the paths with the paths where CUDA and cuDNN are installed)

$ cat /etc/ld.so.conf.d/cuda.conf
/usr/local/cuda/lib64
/usr/local/cudnn/lib64

Run ldconfig to make the new libraries available:

$ sudo ldconfig

Install TensorFlow GPU native libraries

  1. Install one of the following update sites (as described above) to download the Java Native Interface (JNI) into your Fiji installation:
  • for Linux: https://sites.imagej.net/CSBDeep-GPU-linux64-TF1.12.0
  • for Windows: https://sites.imagej.net/CSBDeep-GPU-win64-TF1.12.0

See Installing TensorFlow for Java for additional information or if you want to download a different version. Until we improve the documentation of this part, please contact us in this case so we can help you with the setup.

Multiple GPUs (Linux only)

If you have multiple CUDA enabled GPUs you may want to set the environment variable CUDA_VISIBLE_DEVICES to specify the GPU which should be used.

As CUDA will try to enumerate the GPUs by speed

$ export CUDA_VISIBLE_DEVICES=0

should give you only the fastest GPU. Execute this line before you start Fiji or put it into your ~/.bashrc or set the environment variable somewhere else like in ~/.pam_environment. See the documentation of your distribution for options on how to set environment variables.

Optional:

If this is not sufficient for your setup. You can find out the ID (in PCI bus order) of your GPU with:

$ nvidia-smi
Thu Sep 14 17:39:33 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.66                 Driver Version: 375.66                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  NVS 310             Off  | 0000:A1:00.0     N/A |                  N/A |
| 30%   56C    P0    N/A /  N/A |    294MiB /   961MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   1  TITAN Xp            Off  | 0000:03:00.0     Off |                  N/A |
| 23%   28C    P8     9W / 250W |      1MiB / 12189MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

and also set the environment variable CUDA_​DEVICE_​ORDER:

$ export CUDA_​DEVICE_​ORDER="PCI_BUS_ID"
$ export CUDA_VISIBLE_DEVICES=1

See the CUDA Programming Guide for more information.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.