- MATLAB
- Visual Studio (Community or Profesional)
- 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 |
---|---|
Windows | 7, 8, 10. |
MATLAB | 2014b 2016b 2017a 2018b |
CUDA | 9.2 10 |
Visual Studio | 2010 2013 2015 |
- Install MATLAB, Visual Studio and CUDA
- Rename either
mex_CUDA_win64_MVS2013.xml
(Visual Studio 2013 or older) ormex_CUDA_win64_MVS2015.xml
(Visual Studio 2015 or newer) tomex_CUDA_win64.xml
- Run
Compile.m
A succesfull installation should be able to execute the script at TIGRE/MATLAB/Demos/d03_generateData.m
without errors.
-
Install MATLAB
-
Install CUDA
Any version avobe 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 Visiual 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 oherwise. -
Test the correct configuration of Visual Studio
Open MATLAB and run
mex -setup -v
. Among other things, the output shoudl 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
-Lanugages -> 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++ -
Check that MALTAB knows where Visual Studio and CUDA are
Run the following commands:
getenv('CUDA_PATH')
;getenv('VS120COMNTOOLS');
(MVS2013)getenv('VS140COMNTOOLS');
(MVS2015 or newer)
They should return something similar to:
'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2'
'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\'
If any of these return empty, your installation of CUDA or Visual Studio did not happen successfully or you did install it in the non-standard way. Either reinstall, or configure this variables (use
setenv()
) to point to the correct installation locations. -
Rename either
mex_CUDA_win64_MVS2013.xml
(Visual Studio 2013 or older) ormex_CUDA_win64_MVS2015.xml
(Visual Studio 2015 or newer) tomex_CUDA_win64.xml
-
By opening MATLAB on
yourTIGREpath/MATLAB
, executeCompile.m
If it fails, try opening
mex_CUDA_win64.xml
with your favourite 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 [email protected] or [email protected]
- 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 | 16.04 17.10 |
MATLAB | 2017a 2018b |
CUDA | 9.2 10.0 |
gcc | 6.4.0 7.2.0 |
- Install MATLAB, gcc and CUDA
- Run
Compile.m
A succesfull 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 shoudl 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 oherwise. -
Make sure your terminal knows where CUDA is.
For Ubuntu:
-
Using your favourite 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 [email protected] or [email protected]
1 Testing by the TIGRE team in Linux is limited, thus the step by step instructions are less detailed than expected. Please do contact us if you are having trouble or would like to contribute to the instructions.