Compiling CUDA files with mexcuda - why wont Matlab accept my compiler?!
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
Mendi Barel
le 28 Fév 2017
Modifié(e) : Mendi Barel
le 28 Fév 2017
2 votes
This is how to compile (mexcuda) with Visual Studio 2015 and Cuda 8.0 :
- Go to: "\toolbox\distcomp\gpu\extern\src\mex\win64"
- Copy files and rename 2013 to 2015: { "nvcc_msvcpp2013.xml" , "nvcc_msvcpp2013_dynamic.xml"}
- Replace inside those files "7.5" to "8.0" and "12" to "14".
- Done.
2 commentaires
Dang Manh Truong
le 21 Mar 2017
Modifié(e) : Dang Manh Truong
le 24 Mar 2017
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
le 4 Oct 2017
Dang, is the name of file exactly ucrt.lib? I cannot find it in the program files.Thanks!
Catégories
En savoir plus sur Get Started with GPU Coder dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!