Compiling CUDA files with mexcuda in matlab2021b report error

6 views (last 30 days)
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

Answers (1)

Walter Roberson
Walter Roberson on 9 Aug 2022
In the column for GPU Coder, notice that MinGW is not supported. You need VS 2019 or VS 2017
  4 Comments

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!