【问题标题】:Pycuda Compilation ErrorPycuda 编译错误
【发布时间】:2016-04-07 04:53:09
【问题描述】:

我在安装了 python 2.7(32 位)和 pycuda 的 Windows 机器上安装了 cuda 7.5 whl。运行示例程序以测试 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,

可能的解决方案是什么。 请帮忙 !

【问题讨论】:

    标签: python pycuda theano-cuda


    【解决方案1】:

    由于知识有限,我的第一个猜测是,在包含 C:\Program Files\anything 的路径中 Program 之后的空格没有得到正确处理。

    编辑:包括独立于链接的解决方案。

    您可能需要转义文件路径中的空格。虽然,由于主要使用 linux,我不确定 Windows 斜线。示例 C:/Program\ Files/foo/bar.exe

    另一种方法可能是在路径周围加上引号。 C:\"Program files"\foo\bar.exe 或 "C:\Program files\foo\bar.exe"

    第三个选项可以用 %20 等十六进制替换空格 就像在 C:\Program%20files\foo\bar.exe 中一样。在 c++ 中,我认为您可以用 \u0020 替换空格。所以这种替换方法也可能是一种途径。

    这篇文章的建议答案可能会有所帮助:

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-09
    • 2015-02-17
    • 1970-01-01
    • 2013-08-27
    • 2015-08-04
    • 2018-12-04
    • 2011-08-08
    • 2011-09-04
    相关资源
    最近更新 更多