- Python 3.7-3.11
- MVS
- A CUDA capable GPU from NVIDIA with compute capability greater or equal to 3.5
- CUDA Toolkit
Tested on
Software | Version |
---|---|
Windows | 10, 11 |
Python | 3.7 3.8 3.9 3.10, 3.11 |
CUDA | 9.2> |
MSVC | 19.24 |
We strongly recommend using conda
environments and doing the install in one specific for tigre.
- Install Python and pip, MSVC and CUDA
- run
git clone https://github.com/CERN/TIGRE.git
- run
pip install .
in the Python 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_PATH
andPATH
environment 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/Python/ pip install -r requirements.txt --user pip install . --user
NOTE: If you are working under the virtual environment that created by
venv
or aconda
environment and you want to install TIGRE to it, you should remove the--user
option. With the--user
option, 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.
We strongly recommend using conda
environments and doing the install in one specific for tigre.
- Python 3
- gcc
- A CUDA capable GPU from NVIDIA with compute capability greater or equal to 3.5
- CUDA Toolkit
Tested on
Software | Version |
---|---|
Ubuntu | 16.04> |
Python | 3.7-3.11 |
CUDA | 9.2> |
gcc | 7.6.0 |
- Install python, gcc, pip and CUDA
- run
git clone https://github.com/CERN/TIGRE.git
- run
python setup.py install --user
in the Python 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/Python/ pip install -r requirements.txt --user pip install . --user
NOTE: If you are working under the virtual environment that created by
venv
and you want to install TIGRE to it, you should remove the--user
option. With the--user
option, 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.
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 requirements_dev
file is located in Tigre's Python
directory. These dependencies can be installed using pip install -r requirements_dev.txt --user
while in the Python
directory.
Dev dependencies may also be installed using the lint
extras defined in setup.py
. These dependencies can be installed using pip install .[lint] --user
while in the Python
directory.
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.py
pre-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.......................................................Passed
NOTE: 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
.