I am attempting to work through the three methods to compute the Mandelbrot Set outlined on this page. I am stuck on the third method, which I think is also demonstrated here. In particular, I cannot compile the .cu file using mexcuda:
mexcuda -ptx pctdemo_processMandelbrotElement.cu
I have installed MATLAB Support for MinGW-w64 C/C++ Compiler, NVIDIA CUDA Toolkit 12.2 and Microsoft Visual Studio Community 2022 (but I'm not completely sure if I installed the C++ Compiler with Visual Studio).
Is there something else I am missing? I am on a Windows 10 PC with an NVIDIA GeForce GTX 1080 and MATLAB R2023a Update 3. See below for the error(s) I am getting:

답변 (1개)

Ty
Ty 2023년 7월 6일

1 개 추천

NVidia CUDA requires the Visual C++ compiler. It looks like MATLAB is showing you only have MinGW available. I would double check that you selected the "Desktop development with C++" workflow during the Visual Studio 2022 install. Just re-run the installer which should allow you to add or remove packages.
After you've verified that, see if it now lists the Microsoft Visual C++ compiler when you run the "mex -setup C++" command. You can add a verbose flag with "-v" to see which program folders it's checking.
Lastly, once you've been able to switch the compilers, make sure you've followed the instructions for Setting Up the Prerequisite Products. There are a few system environment variables that need to get set.

댓글 수: 1

Anton Kogios
Anton Kogios 2023년 8월 9일
편집: Anton Kogios 2023년 8월 9일
Hi Ty, thank you so much for your reply, and apologies for taking a long time to respond.
I finally got around to looking at this again, and have since gotten Microsoft Visual C++ Compiler to work. However, I am now stuck at this line:
kernel = parallel.gpu.CUDAKernel(ptxFilename,cudaFilename);
What I believe is the source of the issue is the PTX code not compiling correctly. I have attached it as a TXT file, and it appears to not have any actual code in it.
I attempted the first example on the CUDAKernel documentation page, and that seemed to compile fine, not that I would know what a correct PTX file would look like (resulting PTX file also attached as TXT file).
In terms of setting up the prerequisite products as you mentioned, a couple of the coder.checkGpuInstall tests fail on my system. However, I am not too sure how to address them.
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'tensorrt';
gpuEnvObj.DeepCodeexec = 1;
gpuEnvObj.DeepCodegen = 1;
results = coder.checkGpuInstall(gpuEnvObj)
I also attempted to run the GPU Environment Check app, and it all seems to be fine (results attached as PDF).
Edit: I just checked this, and it appears that when I follow the example on this page, it works fine.

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

카테고리

도움말 센터File Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2023년 7월 6일

편집:

2023년 8월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by