Search code examples
pythoncudanvccpycuda

pycuda; nvcc fatal : Visual Studio configuration file '(null)' could not be found


I'm trying to run pycuda introductory tutorial after installing Visual C++ Express 2010 and all kinds of Nvidia drivers, SDK, etc. I get to

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

without errors. But this call in IPython yields

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/../..']

After this I installed MS Windows SDK without impact on this error, although I now seem to be able to choose x64 programs in Visual C++ Express 2010. So, what do I need to fix? (I used precompiled pycuda files.)


Solution

  • In stackoverflow post CUDA linking error - Visual Express 2008 - nvcc fatal due to (null) configuration file the answer by Amitabh Mritunjai fixed this error. He explains the steps for Visual C++ Express 2010 while the most of the rest of the post is about 2008.