Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用PyCUDA后没有输出_Python_Python 3.x_Parallel Processing_Pycuda - Fatal编程技术网

Python 使用PyCUDA后没有输出

Python 使用PyCUDA后没有输出,python,python-3.x,parallel-processing,pycuda,Python,Python 3.x,Parallel Processing,Pycuda,我已经使用pip安装了PyCUDA。我在两台电脑上试过了。 一个是新安装的python3.7.1,另一个是python3.6.5 使用PuCUDA后,一切都会失败,没有错误消息 最起码的例子是: 这也不会返回任何输出 我认为CUDA失败了,但没有得到任何报告 我的配置: 司机: 我注意到这是一个问题,但没有解决方案。我不确定这是否能帮助您解决问题,但类似的问题由 重新安装cuda(使用anoconda) 如果需要,可以通过conda控制台安装 conda安装-c anaconda cudatoo

我已经使用
pip
安装了
PyCUDA
。我在两台电脑上试过了。
一个是新安装的
python3.7.1
,另一个是
python3.6.5

使用
PuCUDA
后,一切都会失败,没有错误消息

最起码的例子是:

这也不会返回任何输出

我认为CUDA失败了,但没有得到任何报告

我的配置:

司机:


我注意到这是一个问题,但没有解决方案。

我不确定这是否能帮助您解决问题,但类似的问题由 重新安装
cuda
(使用
anoconda

如果需要,可以通过
conda
控制台安装

conda安装-c anaconda cudatoolkit

并检查它是否运行良好

键入
numba-s


希望这能有所帮助

我不确定,但我希望这能帮助您解决这个问题

  • 检查您是否在Windows上安装了
    CUDA
    toolkit
  • 检查
    CUDA
    PATH
    环境是否设置正确
  • 如果您使用的是最新版本的
    VS
    PyCUDA
    可能很难(或不可能)使用它。因此,如果您还想在当前系统上安装较旧版本的
    VS
    ,那么在安装之后,您可能需要指定新(旧版本)编译器的路径 例如,您可以将此行添加到
    site packages\pycuda\compiler.py
    中的
    compiler
    函数中:


    options.extend(['-ccbin',C:\\Program Files(x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe'])

    Ohh,很抱歉,当您运行
    $numba-s
    或任何其他错误消息/信息时,是否可以上载屏幕截图请在conda之外运行脚本。我不用康达来做这个。但是如果你认为有必要,我可以粘贴报告。非常感谢你的帮助。1、2)我已在环境路径中安装并正确设置Cuda工具包。(Cuda编译工具,10.0版,V10.0.130)。此外,我还编辑了编译函数并添加了选项。扩展。。。但同样,打印也不起作用。我安装了Visual Studio 2015。您是否尝试安装最新的游戏就绪Nvdia驱动程序,而不是Microsoft驱动程序或其他任何驱动程序?是的,我安装了游戏就绪驱动程序,刚刚从417.22更新到418.91
    import sys
    import pycuda.driver as cuda
    import pycuda.autoinit # <-- Comment in order for `print` to work
    
    if __name__ == '__main__':
        print('Print works')
        sys.stdout.write("Sys print works")
    
    import pycuda.driver as cuda
    import pycuda.autoinit
    from pycuda.compiler import SourceModule
    
    if __name__ == '__main__':
        mod = SourceModule("""
            #include <stdio.h>
    
            __global__ void test() {
              printf("I am %d.%d\\n", threadIdx.x, threadIdx.y);
            }
            """)
    
        func = mod.get_function("test")
        func(block=(4, 4, 1))
    
    +--------------------+--------------------+
    |        PC1         |        PC2         |
    +--------------------+--------------------+
    | Python 3.6.5       | Python 3.7.1       |
    | Windows 10         | Windows 10         |
    | Cuda toolkit 9     | Cuda toolkit 10    |
    | GeForce GTX 1050   | GeForce GTX 1080   |
    | Visual Studio 2015 | Visual Studio 2015 |
    +--------------------+--------------------+
    
    GeForce Game Ready Driver
    Version        : 418.91 WHQL
    Release Date   : Wed Feb 13, 2019