Compiling CUDA files with mexcuda in matlab2021b report error

I am trying to compile cuda files into mex(matlab 2021b)
mexcuda mexGPUExample.cu
The error occurs:
warning: The selected C++ compiler is not supported for CUDA compilation. Searching for a supported compiler.
> 位置:mexcuda (96 )
错误使用 mex
未检测到支持的编译器。有关选项,请访问 https://www.mathworks.com/support/compilers
出错 mexcuda (168 )
[varargout{1:nargout}] = mex(mexArguments{:});
However , when I type:
mex -setup
I have tested the MinGW64 Compiler and it work properly
MEX Configured to use 'MinGW64 Compiler (C)' for C compilation.
要选择不同的语言,请从以下选项中选择一种命令:
mex -setup C++
mex -setup FORTRAN
here are my gpu configurations:
Name: 'NVIDIA GeForce RTX 3090'
Index: 1
ComputeCapability: '8.6'
SupportsDouble: 1
DriverVersion: 11.6000
ToolkitVersion: 11
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 2.5769e+10
AvailableMemory: 2.4283e+10
MultiprocessorCount: 82
ClockRateKHz: 1695000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceAvailable: 1
DeviceSelected: 1

답변 (1개)

Walter Roberson
Walter Roberson 2022년 8월 9일

0 개 추천

In the column for GPU Coder, notice that MinGW is not supported. You need VS 2019 or VS 2017

댓글 수: 4

I turned my compiler from mingw64 to visual studio 2019, and it compiled successfully. But a warning jumped out:
mexcuda mexGPUExample.cu
warning: The selected C++ compiler is not supported for CUDA compilation. Searching for a supported compiler.
> 位置:mexcuda (96 )
使用 'NVIDIA CUDA Compiler' 编译。
MEX successed
the compiled result passed the numerical test successfully.
what does the warning means? would it affect my result?
Joss Knight
Joss Knight 2022년 8월 11일
편집: Joss Knight 2022년 8월 11일
Did you change the default compiler to VS using mex -setup?
Can you run again with the -v option and post the output?

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

제품

릴리스

R2021b

질문:

2022년 8월 9일

댓글:

2022년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by