Skip to main content
 首页 » 编程设计

python之比丘达; nvcc 致命 : Visual Studio configuration file '(null)' could not be found

2024年01月01日63bhlsheji

我正在尝试运行 pycuda introductory tutorial安装 Visual C++ Express 2010 和各种 Nvidia 驱动程序、SDK 等之后。我开始

mod = SourceModule(""" 
__global__ void doublify(float *a) 
{ 
int idx = threadIdx.x + threadIdx.y*4; 
a[idx] *= 2; 
} 
""") 

没有错误。但是 IPython 中的这个调用产生了

CompileError: nvcc compilation of c:\users\koj\appdata\local\temp\tmpbbhsca\kernel.cu failed 
[command: nvcc --cubin -arch sm_21 -m64 -IC:\Python27\lib\site-packages\pycuda\..\..\..\include\pycuda kernel.cu] 
[stderr: 
nvcc fatal   : Visual Studio configuration file '(null)' could not be found for installation at 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin/../..'] 

在此之后,我安装了 MS Windows SDK,但对这个错误没有影响,尽管我现在似乎可以在 Visual C++ Express 2010 中选择 x64 程序。那么,我需要修复什么? (我使用了预编译的 pycuda 文件。)

请您参考如下方法:

在 stackoverflow 帖子中 CUDA linking error - Visual Express 2008 - nvcc fatal due to (null) configuration file Amitabh Mritunjai 的回答修复了这个错误。他解释了 Visual C++ Express 2010 的步骤,而帖子的其余大部分是关于 2008 年的。