2

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 !

talonmies
  • 70,661
  • 34
  • 192
  • 269
Rahul rao
  • 45
  • 5

1 Answers1

1

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

Matthew Hammel
  • 104
  • 2
  • 8
  • 1
    A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – Zoe Nov 28 '18 at 19:18
  • @Zoe Updated. Thanks – Matthew Hammel Nov 28 '18 at 20:52