- Python 3.7-3.11
- NVIDIA CUDA-capable GPU with compute capability >=3.5
- MSVC (for building)
- CUDA Toolkit (for building)
Tested on:
| Software | Version |
|---|---|
| Windows | 10, 11 |
| Python | 3.10-3.14 |
| CUDA | >=9.2 |
| MSVC | 19.24 |
We strongly recommend using conda environments and doing the install in one specific for tigre.
Tip
Quick Summary:
- Install Python and pip, MSVC and CUDA
- run
git clone https://github.com/CERN/TIGRE.git - run
pip install .in the root folder.
A successful installation should be able to execute the script at TIGRE/Python/example.py
-
Install MS Visual Studio Build Tools with Windows SDK.
NOTE: The User has to have no spaces. -
Install Python 3 + pip. You can use a virtual conda environment or just a normal python installation. We strongly recommend the conda environments. Activate the environment before step 5.
-
Install CUDA. Make sure the
CUDA_PATHandPATHenvironment variable are set accordingly.
NOTE: The User has to have no spaces. -
Download/clone TIGRE
git clone https://github.com/CERN/TIGRE.git -
Compile libraries
cd TIGRE/ pip install . --user
NOTE: If you are working under the virtual environment that created by
venvor acondaenvironment and you want to install TIGRE to it, you should remove the--useroption. With the--useroption, TIGRE and the other required packages will be installed to your Python user install directory, not to your virtual environment or system directory. -
Try demo 3. If it runs successfully then you are good to go.
An unofficial conda package is built & maintained by CCPi Tomographic Imaging - you can install it by running:
conda install -c ccpi tigre
Please report conda issues upstream.
We strongly recommend using conda environments and doing the install in one specific for tigre.
- Python 3
- NVIDIA CUDA-capable GPU with compute capability >=3.5
- gcc (for building)
- CUDA Toolkit (for building)
Tested on:
| Software | Version |
|---|---|
| Ubuntu | >=16.04 |
| Python | 3.10-3.14 |
| CUDA | >=9.2 |
| gcc | 7.6.0 |
We strongly recommend using conda environments and doing the install in one specific for tigre.
Tip
Quick Summary:
- Install python and pip, gcc and CUDA
- run
git clone https://github.com/CERN/TIGRE.git - run
pip install .in the root folder.
A successful installation should be able to execute the script at TIGRE/Python/example.py
For Ubuntu
-
Install python and pip
Recommended to do it via Anaconda3, and not the following.
sudo apt update sudo apt upgrade sudo apt install python3.10 python-pip
-
Install CUDA
Installing CUDA in linux (specially one with a GUI) can be a challenge. Please follow NVIDIAs instructions carefully.
CUDA download link -
Install gcc
gcc should already be installed in your linux, as it is part of the linux distribution.
If you need to install an older version of gcc, read here. -
Download/clone TIGRE
git clone https://github.com/CERN/TIGRE.git -
Compile libraries
cd TIGRE/ pip install . --userNOTE: If you are working under the virtual environment that created by
venvand you want to install TIGRE to it, you should remove the--useroption. With the--useroption, TIGRE and the other required packages will be installed to your Python user install directory, not to your virtual environment or system directory. -
Try demo 3. If it runs successfully then you are good to go.
if this fails, then try:
export CUDAHOME=yourcudahome, e.g. default is export CUDAHOME=/usr/local/cuda
pip install . --user
NOTE: as of November 2020 the pip pytigre is behind the main repo, we recommend you install it and compile it yourself. Trying to fix that.
An unofficial conda package is built & maintained by CCPi Tomographic Imaging - you can install it by running:
conda install -c ccpi tigre
Please report conda issues upstream.
Optional linting dependencies are provided to enforce the prevailing codestyle in the Python component of the TIGRE library.
The primary linting packages utilized are:
Multiple installation options have been provided:
A dev dependency group is included in the pyproject.toml file. Use pip install --group dev . to install those dependencies.
Linting dependencies are also provided as a pre-commit configuration. With the pre-commit hooks installed, code will be linted prior to commit, preventing code from being committed that fails linting. By default, these hooks are only run against staged files.
The pre-commit package is included in the above pip installs; once the framework is installed, hooks can be installed by invoking pre-commit install.
Once installed, invoking the linting tools is straightforward. From TIGRE's Python directory:
# Run in current directory & subdirectories
$ flake8 .
$ black .
# Or specify a file
$ flake8 ./example.py
$ black ./example.pypre-commit may also be manually invoked, which will run flake8 and black against all staged files:
$ pre-commit run
flake8...................................................................Passed
black....................................................................Passed
Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
check blanket noqa.......................................................PassedNOTE: pre-commit may also be manually invoked against all files (staged and unstaged) using the pre-commit run --all-files. However, some changes made to Python's TIGRE codebase by black have been manually reverted for readability reasons and should not be committed in their blackened state.
If you are doing reconstruction of large datasets, and you want to use swap memory, you will need to deactivate TIGREs pinned memory feature at compile time. This will allow you to use swap memory, but it will make the operators in TIGRE slower, as pinned memory is used for simultaneous memory and compute.
You can do this by calling the setup.py with the flag --no_pinned_memory.