fatal: All CUDA devices are used for display and cannot be used while debugging. (error code = CUDBG_ERROR_ALL_DEVICES_WATCHDOGGED(0x18)
似乎我的X-Server似乎阻止了我的NVIDIA GPU,因为如果我切换到另一个虚拟控制台(CTRL + ALT + F1),我可以使用cuda-gdb运行我的代码。没有显示器电缆插入NVIDIA卡...
" lsof / dev / nvidia *"没有给出任何输出。我正在使用Xubuntu 14.04。
有谁知道如何解决这个问题?
答案 0 :(得分:8)
在计算能力至少为SM35的设备中,我们显然可以通过设置环境变量来解决这个问题
CUDA_DEBUGGER_SOFTWARE_PREEMPTION=1
我们可以在cuda-gdb文档页面上看到它:http://docs.nvidia.com/cuda/cuda-gdb/#axzz4BrMPoaoW
这是测试。我在Maxwell Quadro GPU上运行:
nvidia-smi
Fri Jun 17 10:59:47 2016
+------------------------------------------------------+
| NVIDIA-SMI 352.63 Driver Version: 352.63 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro M4000M Off | 0000:01:00.0 On | N/A |
| N/A 37C P8 9W / 100W | 158MiB / 4087MiB | 1% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 2981 G /usr/bin/X 57MiB |
| 0 9186 G ...ves-passed-by-fd --v8-snapshot-passed-by- 85MiB |
+-----------------------------------------------------------------------------+
构建并运行应用程序
nvcc -g -G foo.cu
cuda-gdb ./a.out
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
fatal: All CUDA devices are used for display and cannot be used while debugging. (error code = CUDBG_ERROR_ALL_DEVICES_WATCHDOGGED(0x18)
现在设置环境变量。
export CUDA_DEBUGGER_SOFTWARE_PREEMPTION=1
cuda-gdb ./a.out
(cuda-gdb) r
...
warning: Cuda API error detected: cudaMemcpy returned (0xb)
warning: Cuda API error detected: cudaFree returned (0x11)
[Thread 0x7fffed3ff700 (LWP 10302) exited]
[Thread 0x7ffff7fc6780 (LWP 10293) exited]
答案 1 :(得分:1)
对我而言,它有助于改变块
Section "ServerLayout"
Identifier "layout"
Screen 0 "intel"
EndSection
从'nvidia'到'intel'的标识符。