MATLAB Answers

Compiling CUDA files with mexcuda - why wont Matlab accept my compiler?!

25 ビュー (過去 30 日間)
Petter Stefansson
Petter Stefansson 2016 年 10 月 2 日
コメント済み: Soroush Mehravar 2017 年 10 月 4 日
Im trying to compile CUDA files into mex.
Matlab ships with an example CUDA file located in matlabfolder\toolbox\distcomp\gpu\extern\src\mex, but when I try to compile it by typing:
I get:
"Error using mex
No supported compiler or SDK was found"
Im using the Microsoft Visual C++ 2015 Professional (C) compiler for both C and C++ but Ive also tried the MinGW64 Compiler and the Windows SDK 7.1 which all gives me the same error.
Im using the CUDA toolkit 8, and in Visual studio I can compile .cu files so I obviously have a supported compiler. How do I make Matlab realize that and allow me to compile .cu files?


Joss Knight
Joss Knight 2016 年 10 月 3 日
Hello Petter,
CUDA 8.0 was only released last week! mexcuda doesn't yet support it, and consequently does not yet support Visual Studio 2015, which is supported by CUDA 8.0 but not CUDA 7.5.
  7 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 28 日
CUDA 7.5 supported VS 2013, VS 2013 Community, VS 2012, and VS 2010


その他の回答 (1 件)

Mendi Barel
Mendi Barel 2017 年 2 月 28 日
編集済み: Mendi Barel 2017 年 2 月 28 日
This is how to compile (mexcuda) with Visual Studio 2015 and Cuda 8.0 :
  1. Go to: "\toolbox\distcomp\gpu\extern\src\mex\win64"
  2. Copy files and rename 2013 to 2015: { "nvcc_msvcpp2013.xml" , "nvcc_msvcpp2013_dynamic.xml"}
  3. Replace inside those files "7.5" to "8.0" and "12" to "14".
  4. Done.
  2 件のコメント
Soroush Mehravar
Soroush Mehravar 2017 年 10 月 4 日
Dang, is the name of file exactly ucrt.lib? I cannot find it in the program files.Thanks!


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by