转载自:https://blog.csdn.net/weixin_34910922/article/details/109906628
报错:
pycuda._driver.LogicError: explicit_context_dependent failed: invalid device context - no currently active context?
原因:
pycuda.driver没有初始化,导致无法得到context,需要在导入pycuda.driver后再导入pycuda.autoinit,即如下:
import pycuda.driver as cuda
import pycuda.autoinit