我正在尝试从另一个内核调用 CUDA 内核,但出现以下错误:
Traceback (most recent call last):
File "C:\temp\GPU Program Shell.py", line 22, in <module>
""")
File "C:\Python33\lib\site-packages\pycuda\compiler.py", line 262, in __init__
arch, code, cache_dir, include_dirs)
File "C:\Python33\lib\site-packages\pycuda\compiler.py", line 252, in compile
return compile_plain(source, options, keep, nvcc, cache_dir)
File "C:\Python33\lib\site-packages\pycuda\compiler.py", line 134, in compile_plain
cmdline, stdout=stdout.decode("utf-8"), stderr=stderr.decode("utf-8"))
pycuda.driver.CompileError: nvcc compilation of c:\users\karste~1\appdata\local\temp\tmpgq8t45\kernel.cu failed
[command: nvcc --cubin -arch sm_35 -m64 -Ic:\python33\lib\site-packages\pycuda\cuda kernel.cu]
[stderr:
kernel.cu(14): error: kernel launch from __device__ or __global__ functions requires separate compilation mode
我的理解是,这与动态并行性有关,与此错误相关的另一个问题是由于用户没有适当的硬件。但是,我有一个 GTX Titan,所以它应该是兼容的。我错过了什么?
编辑
添加后"options=['--cubin','-rdc=true','-lcudart','-lcudadevrt,','-Ic:\python33\lib\site-packages\pycuda\cuda kernel.cu' ]" 到 SourceModule,我收到以下错误:
Traceback (most recent call last):
File "C:\temp\GPU Program Shell.py", line 22, in <module>
""", options=['--cubin','-rdc=true' ,'-lcudart', '-lcudadevrt,','-Ic:\python33\lib\site-packages\pycuda\cuda kernel.cu'])
File "C:\Python33\lib\site-packages\pycuda\compiler.py", line 265, in __init__
self.module = module_from_buffer(cubin)
pycuda._driver.LogicError: cuModuleLoadDataEx failed: not found -