簡體   English   中英

`未檢測到使用 mex 支持的編譯器時出錯`:無法為 MATLAB 安裝與 CUDA 兼容的 C++ 編譯器

[英]`Error using mex Supported compiler not detected`: can't install a CUDA-compatible C++ compiler for MATLAB

我有 Matlab 2022b,Windows 11. 在 Matlab mex -setup cpp yields

MEX configured to use 'Microsoft Visual C++ 2022' for C++ language compilation

在命令提示符下, nvcc --version產生:

   nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2022 NVIDIA Corporation
    Built on Mon_Oct_24_19:40:05_Pacific_Daylight_Time_2022
    Cuda compilation tools, release 12.0, V12.0.76
    Build cuda_12.0.r12.0/compiler.31968024_0

當我嘗試運行此文件時,出現此錯誤:

 Error using mex
    Supported compiler not detected. For options, visit https://www.mathworks.com/support/compilers.
    
    Error in mexcuda (line 168)
        [varargout{1:nargout}] = mex(mexArguments{:});
    
    Error in mexGPUall (line 7)
        mexcuda -largeArrayDims spikedetector3.cu

在 Matlab 中選擇“MinGW64 Compiler (C++)”會出現同樣的錯誤。

我找到了這個線程 至少有一位參與者正在嘗試運行與我相同的應用程序 Kilosort。 我嘗試下載並安裝 Visual Studio 2019。完成后, mex -setup cpp並沒有為我提供比以前更多的 C++ 編譯器選項。

有誰知道我如何安裝一個編譯器來執行該文件並運行 Kilosort?

MATLAB 曾經有非常嚴格的 GPU 硬件/CUDA 工具包/MATLAB 版本兼容性要求,一直到小數點后的數字。

您可能需要檢查 您安裝的 Visual Studio 版本是否與您的 CUDA 版本兼容。僅僅使所有內容保持最新是不夠的。

但是,自 R2022 以來,Mathworks 對此一直含糊不清。 我想您可能會使用早期版本以及經過測試可以正常工作的發行版本的特定組合(我們遵循該表並啟動並運行 Kilosort),或者嘗試對較新版本進行一些變體。

如果您成功了,也請分享您的工具鏈配置,以便其他人可以從您的經驗中受益。 .

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM