Installation and test

Tomocupy works in NVidia GPUs of compute capability 6.0 and higher. To run tomocupy the system should have an nvidia driver installed. Cuda Toolkit is not necessary. Run nvidia-smi to check whether the driver is installed. For check compute capability of the GPU, see this document.

  1. Add conda-forge to anaconda channels

(base)$ conda config --add channels conda-forge
(base)$ conda config --set channel_priority strict
  1. Environmental solver mamba works much faster than the regular one, use

(base)$ conda install -n base conda-libmamba-solver
(base)$ conda config --set solver libmamba
  1. Create environment with installed tomocupy

(base)$ conda create -n tomocupy tomocupy
  1. Activate tomocupy environment

(base)$ conda activate tomocupy
  1. Test installation

(tomocupy)$ tomocupy recon -h

Installation for development

  1. Add conda-forge to anaconda channels

(base)$ conda config --add channels conda-forge
(base)$ conda config --set channel_priority strict
  1. Environmental solver mamba works much faster than the regular one, use

(base)$ conda install -n base conda-libmamba-solver
(base)$ conda config --set solver libmamba
  1. Create environment with necessary dependencies

(base)$ conda create -n tomocupy -c conda-forge cupy scikit-build swig numexpr opencv tifffile h5py cmake pywavelets python=3.10

Warning

Conda has a built-in mechanism to determine and install the latest version of cudatoolkit supported by your driver. However, if for any reason you need to force-install a particular CUDA version (say 11.0), you can do:

conda install -c conda-forge cupy cudatoolkit=11.0

  1. Activate tomocupy environment

(base)$ conda activate tomocupy

5*. (If needed) Install meta for supporting hdf meta data writer used by option: –save-format h5

(tomocupy)$ git clone https://github.com/xray-imaging/meta.git
(tomocupy)$ cd meta
(tomocupy)$ pip install .
(tomocupy)$ cd -
  1. Make sure that the path to nvcc compiler is set (or set it by e.g. export CUDACXX=/local/cuda-11.7/bin/nvcc) and install tomocupy

(tomocupy)$ git clone https://github.com/tomography/tomocupy
(tomocupy)$ cd tomocupy
(tomocupy)$ pip install .

Additional instructions for Windows

  1. Install Build VS 2019 utils

  2. Install CUDA toolkit, e.g. cuda 11_2_2

  3. Install Anaconda for windows and use Powershell in which tomocupy environment can be created

Note

It is better to have only one version of VS and one version of CUDA toolkit on your system to avoid problems with environmental variables

Unit tests

Check the library path to cuda or set it by export LD_LIBRARY_PATH=/local/cuda-11.7/lib64

Run the following to check all functionality

(tomocupy)$ cd tests; bash test_all.sh

Update

tomocupy is constantly updated to include new features. To update your locally installed version

(tomocupy)$ cd tomocupy
(tomocupy)$ git pull
(tomocupy)$ pip install .

Installation on Polaris supercomputer

  1. connect to Polaris main node (computing nodes don’t have access to the internet) and install anaconda

  2. add modules:

module add gcc/11.2.0
module add cudatoolkit-standalone/11.4.4

Note

We work with cuda-11.4 not with cuda-12.1 because the current driver version on polaris is 11.4

  1. create tomocupy environment, specifying cudatoolkit=11.4

conda create -n tomocupy -c conda-forge cupy scikit-build swig numexpr opencv tifffile h5py cmake cudatoolkit=11.4
  1. clone tomocupy:

git clone https://github.com/tomography/tomocupy
  1. install tomocupy

cd tomocupy; pip install .
  1. test tomocupy:

tomocupy recon -h
  1. connect to a node with GPUs in interactive mode and a debug allocation for now, smth like

qsub -I -A hp-ptycho -l select=4:system=polaris -l filesystems=home:eagle -l walltime=30:00 -q debug-scaling

Note

Replace hp-ptycho by your project

  1. test tomocupy:

cd tests; bash test_all.sh