为什么cuCtxCreate返回旧的上下文? [英] Why does cuCtxCreate return old context?
问题描述
我已安装:
CUDA sdk 4.2 64,
CUDA工具包4.2 64,
CUDA devdriver 4.2 64,
i have installed: CUDA sdk 4.2 64, CUDA toolkit 4.2 64, CUDA devdriver 4.2 64,
I检查了Windows中的每个nvcuda.dll-它们都是4.2版本,但是当我使用驱动程序api创建上下文并使用cuCtxGetApiVersion检查它的版本时,它显示了 3010
I checked every nvcuda.dll in \windows - all of them, are 4.2 version, but when i create a context with driver api and check it verison with cuCtxGetApiVersion - it shows me "3010"
我并不真的在乎那个版本,但是当我尝试在该上下文中使用运行时api(需要将它们混合)时,它会向我显示错误49(cudaErrorIncompatibleDriverContext)
I do not really care about that version, but when i try to use runtime api with that context(need to mix them) - it shows me error 49(cudaErrorIncompatibleDriverContext)
有什么想法,怎么回事以及如何使其协同工作?
any ideas, what is going on and how to make it work together?
似乎不是Windows的问题-在Linux下运行相同的项目会得到相同的3010 API版本。
seems it is not some issue with windows - running the same project under linux results in the same 3010 API version.
推荐答案
我解决了这个问题-我在执行过程中直接导出了 cuCtxCreate函数(这是另一种语言,没有cuda.h)。在查看原始cuda.h之后,我发现它基于某种smartass定义为该功能定义了其他名称。
以及新功能 cuCtxCreate_v2创建了一个良好的上下文。
I solved the problem - i was exporting "cuCtxCreate" function directly during execution(it is other language - no cuda.h). After looking in original cuda.h i found that it defines other name for that functrion, basing on some sort of smartass defines. And that new function "cuCtxCreate_v2" creates a good context.
/ facepalm
/facepalm
这篇关于为什么cuCtxCreate返回旧的上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!