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

조회 수: 13 (최근 30일)
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:
mexcuda mexGPUExample.cu
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?
Thanks.

채택된 답변

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
Engenuity
Engenuity 2017년 1월 16일
I am using VS2010 and having the same problem. I don't think an earlier version of VS is the correct fix.
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
Dang Manh Truong
Dang Manh Truong 2017년 3월 21일
편집: Dang Manh Truong 2017년 3월 24일
Actually when I tried your solution, an error came up: It says that the file ucrt.lib was missing. I searched the internet but could not find a solution, so I had no choice but to search for the file (in Program Files), then copy it to the Matlab's working directory. Only then did it work. But thanks anyway
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!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 GPU CUDA and MEX Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by