2
votes

I am on windows machine with python 2.7 ( 32 bit ) and pycuda with cuda 7.5 whl installed . I get error while running a sample program to test pycuda.

Traceback (most recent call last):
  File "C:\Users\newbie\Desktop\roo.py", line 82, in <module>
    """)
  File "C:\Python27\lib\site-packages\pycuda\compiler.py", line 265, in __init__
    arch, code, cache_dir, include_dirs)
  File "C:\Python27\lib\site-packages\pycuda\compiler.py", line 255, in compile
    return compile_plain(source, options, keep, nvcc, cache_dir, target)
  File "C:\Python27\lib\site-packages\pycuda\compiler.py", line 137, in compile_plain
    stderr=stderr.decode("utf-8", "replace"))
pycuda.driver.CompileError: nvcc compilation of c:\users\newbie\appdata\local\temp\tmplluyeq\kernel.cu failed
[command: nvcc --cubin -arch sm_35 -m32 -Ic:\python27\lib\site-packages\pycuda\cuda kernel.cu]
[stdout:
kernel.cu

]
[stderr:
'C:\Program' is not recognized as an internal or external command,

What could be the possible solution . Please help !

1

1 Answers

1
votes

With limited knowledge my first guess would be that the white space after Program in a path containing C:\Program Files\anything is not getting handled properly.

Edit: Including solutions independent of the link.

You may need to escape the space in the file path. THough, I am not sure about windows slashes due to primarily using linux. Example C:/Program\ Files/foo/bar.exe

Another method may be to wrap quotes around the path. Either C:\"Program files"\foo\bar.exe or "C:\Program files\foo\bar.exe"

A thrid option could be replacing the space with hex such as %20 like in C:\Program%20files\foo\bar.exe. In c++ I think you can replace whitespace with \u0020. So this replacement method could be an avenue as well.

Suggested answers on this post may be helpful:

https://superuser.com/questions/432980/how-to-call-a-program-that-contains-space-in-filenameenter link description here