nvcc 致命:在 pyCharm windows 10 64bit 上使用 conda env 在 PATH python 3.8 中找不到编译器“cl.exe”

问题描述

好吧,标题几乎总结了环境,也用 venv 尝试过,我已经通过终端安装了 pyCuda 和 cudatoolkit,并且在 Windows 上安装了 Cuda 11.2,我正在尝试运行向量乘法示例并保持得到:

Traceback (most recent call last):
  File "C:/Users/.../PycharmProjects/pythonProject/CudaTest.py",line 6,in <module>
    mod = SourceModule("""
  File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\pycuda\compiler.py",line 290,in __init__
    cubin = compile(source,nvcc,options,keep,no_extern_c,File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\pycuda\compiler.py",line 254,in compile
    return compile_plain(source,cache_dir,target)
  File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\pycuda\compiler.py",line 135,in compile_plain
    raise CompileError("nvcc compilation of %s Failed" % cu_file_path,pycuda.driver.CompileError: nvcc compilation of C:\Users\oranc\AppData\Local\Temp\tmp016c_imu\kernel.cu Failed
[command: nvcc --cubin -arch sm_61 -m64 -Ic:\programdata\anaconda3\envs\pythonproject\lib\site-packages\pycuda\cuda kernel.cu]
[stdout:
nvcc fatal   : Cannot find compiler 'cl.exe' in PATH
]

Process finished with exit code 1

我已添加

C:\ProgramFiles(x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64;

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\cl.exe;.

到 PATH 并没有帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)