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.
For faster installation of packages, it is better to use Miniforge. Then go to Step 3.
For regular Anaconda, add conda-forge to anaconda channels
(base)$ conda config --add channels conda-forge
(base)$ conda config --set channel_priority strict
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
Create environment with installed tomocupy
(base)$ conda create -n tomocupy tomocupy
Activate tomocupy environment
(base)$ conda activate tomocupy
Test installation
(tomocupy)$ tomocupy recon -h
Installation for development¶
For faster installation of packages, it is better to use Miniforge. Then go to Step 3.
Add conda-forge to anaconda channels
(base)$ conda config --add channels conda-forge
(base)$ conda config --set channel_priority strict
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
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
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 -
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¶
Install Build VS 2019 utils
Install CUDA toolkit, e.g. cuda 11_2_2
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¶
connect to Polaris main node (computing nodes don’t have access to the internet) and install anaconda
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
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
clone tomocupy:
git clone https://github.com/tomography/tomocupy
install tomocupy
cd tomocupy; pip install .
test tomocupy:
tomocupy recon -h
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
test tomocupy:
cd tests; bash test_all.sh