qt+ cuda+ opengl,与qopenglcontext共享cuda上下文
我有一个QT程序,它使用Qopenglcontext
进行渲染。
现在,我想使用cuda
来处理图像,而无需提取主机。
如果我使用(qt += core gui OpenGL)
,而无需使用Qopenglcontext
,我将使用cudagraphicsglregisterimage
和map opengl
cuda
,一切正常。
但是,当我使用 qputenv(“ qt_opengl”) ,“ Angle”); (要设置Qopenglcontext
) - 甚至调用cudaglgetDevices(& gldevicecount,gldevicecount,gldevicecect,gdevicecount,gldevicecount,cudagldevicelistall);
给予垃圾 - 给垃圾 - 给垃圾 - 给垃圾 - cuda
上下文与qopenglcontext
不同。
如何设置CUDA上下文与Qopenglcontext相同?
我读过关于cuda contact (cucontext* pctx,unsigned int标志,cudevice dev
但在我看来,没有这样的选择。
也许还有另一个解决方案,如果我必须使用qopenglcontext
?
I have a Qt program, which using QOpenGLContext
for rendering.
Now I want to use CUDA
to process image without extracting image to host.
If I use (QT += core gui opengl)
, without using QOpenGLContext
, I will use cudaGraphicsGLRegisterImage
and map OpenGL
to CUDA
and everything works fine.
But, when I use qputenv("QT_OPENGL", "angle"); (to setup QOpenGLContext
) - even calling cudaGLGetDevices(&glDeviceCount, glDevices, glDeviceCount, cudaGLDeviceListAll);
gives rubbish - meaning the CUDA
context not the same as QOpenGLContext
.
How can I setup CUDA context to be the same as QOpenGLContext?
I have read about CUDA context, e.g cuCtxCreate ( CUcontext* pctx, unsigned int flags, CUdevice dev
but it seems to me, that there no such option.
Maybe there are another solution, if I have to use QOpenGLContext
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论