如何调试只有一个运行X11的显卡的CUDA库 [英] How do I debug a CUDA library with only 1 graphics card running X11
问题描述
我正在运行一个CUDA库,我需要调试内存问题和其他问题。但是当我将cuda-gdb附加到进程时,会出现错误
I'm running a CUDA library that I need to debug for memory problems and other issues. But when I attach cuda-gdb to the process I get the error
错误:所有CUDA设备都用于X11,调试。
error: All CUDA devices are used for X11 and cannot be used while debugging.
我理解错误,但有一种方法,我可以调试的问题。因为我只有1个GPU,关闭X11真的不切实际。
I understand the error, but there has to be a way that I can debug the issues. Since I only have 1 GPU, it really isn't practical to turn off X11.
在非Nvidia硬件上,我认为有一种方法来模拟cuda gpu。
On non Nvidia hardware I thought there was a way to emulate a cuda gpu. could this be setup for debugging even though I have an NVIDIA gpu?
推荐答案
首先,因为你使用的是Linux,重新在幸运的位置,你可以杀死X很容易只是为了调试的时间。
First of all, as you are using Linux you're in a lucky position as you can kill X pretty easily just for the time of debugging.
但是,如果你真的想在调试时坚持运行X,那么运气不好,因为这不是一个非常好的 原因:显示驱动器具有称为看门狗定时器的保护机制,当使用中的GPU还驱动显示器时启用该保护机制。看门狗定时器中断任何运行时间更长的AFAIR 5s的内核。这是为了防止GPU锁定。
However, if you really want to stick to running X while debugging you are out of luck, as this is not possible for a very good reason: the display driver has a protection mechanism called watchdog timer which is enabled when the GPU in use also drives a display. The watchdog timer interrupts any kernel that runs for longer AFAIR 5s. This is intended to prevent GPU lockups.
或者,您也可以尝试使用 ocelot ,但我不知道它提供的调试功能有多好。
Alternatively, you could try using ocelot, but I am not sure how good are the debugging features it provides.
这篇关于如何调试只有一个运行X11的显卡的CUDA库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!