ImageMagick 的显示 GPU“内存泄漏”?
我正在测试 CUDA 应用程序,遇到奇怪的内存问题:
我的程序执行一些图像操作并使用 ImageMagick 的显示程序显示它。 问题是,每次运行 IM 的显示时,我都会使用更多的 GPU 内存,因此用于 GPU 计算的内存更少。
我正在使用 IM 的显示器,因为我找不到任何可以显示管道输入图像的东西。有什么建议吗?
无论如何,为什么 IM 的显示占用如此多的 GPU 内存并且为什么不释放它?
I'm testing CUDA app and I have run into strange memory issue:
My program performs some image operations and displays it using ImageMagick's display program.
The problem is that every time I run that IM's display I get more GPU memory usage, so less memory for GPU computation.
I'm using IM's display, because I couldn't find anything that displays image from the pipe input. Any suggestions?
Anyway why IM's display takes so much GPU memory and why is it not freed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您的问题,在执行一组 GPU 密集型操作后,您尝试使用与 Bash 不同的 shell 按顺序显示一系列文件。您很好奇为什么每次后续调用 ImageMagick
display
display,每次操作结束后似乎都成功关闭。
我们可以进一步推断,您至少在某些处理中使用了 ImageMagick 的 OpenCL 支持。虽然我们没有足够的信息来确定每次通过
display
渲染完成时 GPU 的纹理缓冲区是什么样子,但我推测您的 GPU 没有及时释放纹理,导致内存缓慢增加。我不会继续围绕这个假设进行猜想,而是会推荐一个工具来调试您的问题:gDEBugger 。这应该允许您询问您的视频卡以确定速度变慢的确切原因。
祝您申请顺利。
Based on your question, you're attempting to display a series of files in sequence using a shell not unlike Bash after performing a set of GPU-intensive operations. You're curious why more GPU memory is being consumed with every subsequent invocation of ImageMagick
display
, which appears to be closing out successfully after the conclusion of each operation.We may further theorize that you're using ImageMagick's OpenCL support for at least some of your processing. While we don't have enough information to determine what your GPU's texture buffers look like at the completion of each rendering via
display
, I speculate your GPU isn't freeing textures expediently, causing memory to slowly creep up.Instead of continuing to build conjecture around this hypothesis, I will instead recommend a tool to debug your issue: gDEBugger. This should allow you to interrogate your video card to determine exactly why things are slowing down.
Best of luck with your application.
我知道它很旧,但我们已经发现使用管道(
popen()
)在内存中制作程序的复杂副本,这也会导致复制最终程序指令,或者任何所谓的......当我关闭使用popen
打开的程序时,我还完成了程序结束时通常在“后台”中释放的所有 CUDA 相关上下文。因此,在关闭popen
应用程序后清理 CUDA 内存将不起作用,我认为这是我的内存泄漏和一般主要程序错误。我希望有人会觉得它有用。
I know it's old, but we have figured out that using pipes (
popen()
) makes sophisticated copy of the program in memory, what also causes copying the end program directives, or whatever called... So when I close program opened withpopen
I also finish all CUDA related context that are usually freed in "background", when program ends. So cleaning CUDA memory after I closepopen
application won't work, and I thing here was my memory leak and general major program error.I hope someone will find it useful.