- MATLAB
- Visual Studio (Community or Professional)
- A CUDA capable GPU from NVIDIA with compute capability greater or equal to 3.5
- CUDA Toolkit (9.2 or newer)
Tested on
Software | Version |
---|---|
Windows | 7, 8, 10. |
MATLAB | Any MATLAB >2016b |
CUDA | Any CUDA 9.2> |
Visual Studio | 2010 2013 2015 2019 2022 |
- Install MATLAB, Visual Studio and CUDA (Remember to install C++ when installing Visual Studio!)
- Run
Compile.m
A successful installation should be able to execute the script at TIGRE/MATLAB/Demos/d03_generateData.m
without errors.
-
Install MATLAB
-
Install CUDA
Any version above 9.2 has been tested, however its recommended to get the latests version as possible, for performance and support.
CUDA download link
Detailed installation guide
NOTE: In windows at least, the User has to have no spaces. -
Install Visual Studio
Make sure you install C++.
Download link for the latest version
Download link for older versions
NOTE: In windows at least, the User has to have no spaces. -
Download TIGRE
If you are using git, run:
git clone https://github.com/CERN/TIGRE.git
Manually download zip file otherwise. -
Test the correct configuration of Visual Studio
Open MATLAB and run
mex -setup -v
. Among other things, the output should contain:... Looking for compiler 'Microsoft Visual C++ 2015 (C)' ... ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC' ...Yes.
Note the last 3 Yes. If those are not there it means that you do not have installed C++ on step 3 of this tutorial.
To fix:
-go toControl panel>Add or remove programs -> Visual studio community 20XX -> modify
-Languages -> Visual C++
Make sure that when you run
mex -setup -v
C++ is installed and Visual Studio is selected as the compiler for C/C++ -
By opening MATLAB on
yourTIGREpath/MATLAB
, executeCompile.m
If it fails, try opening
mex_CUDA_win64.xml
with your favorite editor and changing line 125 to link to your localnvcc
location. -
Initialize TIGRE by typing
InitTIGRE
on the MATLAB Command Window. -
Run file
TIGRE/MATLAB/Demos/d03_generateData.m
. If it successfully executes, you have installed and compiled TIGRE properly.
If none of this works, please contact the authors at tigre.toolbox@gmail.com or ander.biguri@gmail.com
- MATLAB
- gcc
- A CUDA capable GPU from NVIDIA with compute capability greater or equal to 3.0
- CUDA Toolkit (9.2 or newer)
Tested on
Software | Version |
---|---|
Ubuntu | Any ubuntu 16.04> |
MATLAB | Any MATLAB 2016b> |
CUDA | Any Cuda 0.2> |
gcc | 6.4.0 7.2.0 |
- Install MATLAB, gcc and CUDA
- Run
Compile.m
A successful installation should be able to execute the script at TIGRE/MATLAB/Demos/d03_generateData.m
without errors.
-
Install MATLAB
-
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 TIGRE
If you are using git, run:
git clone https://github.com/CERN/TIGRE.git
Manually download zip file otherwise. -
Make sure your terminal knows where CUDA is.
For Ubuntu:
-
Using your favorite test editor, open ~/.bashrc. e.g.
gedit ~/.bashrc
. -
Append to the file the following lines:
export LD_LIBRARY_PATH=/usr/local/cuda/lib64 export PATH=$PATH:/usr/local/cuda/bin
-
restart your terminal
-
-
From a terminal, execute MATLAB as
matlab
and runCompile.m
located onTIGRE/MATLAB
-
Run file
TIGRE/MATLAB/Demos/d03_generateData.m
. If it successfully executes, you have installed and compiled TIGRE properly.
If none of this works, please contact the authors at tigre.toolbox@gmail.com or ander.biguri@gmail.com
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 Compile.m
file from the MATLAB command line as Compile --no_pinned_memory
.