Cuda-gdb does not work in wsl2

hello everyone,i have some trouble with cuda-gdb,here is my environment:
win 11
Ubuntu18.04 on wsl2
RTX4060 laptop
nvidia driver 531.61 on windows
cudatoolkit 12.1 on wsl2

https://forums.developer.nvidia.com/t/debugger-for-python-c-c-cuda/67966

I want to debug cuda file and python file like the link above ,now i can sussfully attach my cuda-gdb on python process,but something is wrong when jump to the .cu file ,here is the log.

NVIDIA (R) CUDA Debugger
CUDA Toolkit 12.1 release
Portions Copyright (C) 2007-2023 NVIDIA Corporation
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type “show copying” and “show warranty” for details.
This GDB was configured as “x86_64-pc-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:

Find the GDB manual and other documentation resources online at:

For help, type “help”.
Type “apropos word” to search for commands related to “word”.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
[New LWP 2531]
[New LWP 2532]
[New LWP 2533]
[New LWP 2534]
[New LWP 2535]
[New LWP 2536]
[New LWP 2537]
[New LWP 2538]
[New LWP 2539]
[New LWP 2540]
[New LWP 2541]
[New LWP 2542]
[New LWP 2543]
[New LWP 2544]
[New LWP 2545]
[New LWP 2546]
[New LWP 2547]
[New LWP 2548]
[New LWP 2549]
[New LWP 2550]
[New LWP 2551]
[New LWP 2552]
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
0x00007fa74da03d1f in select () from /lib/x86_64-linux-gnu/libc.so.6
[Detaching after fork from child process 2782]
fatal: One or more CUDA devices cannot be used for debugging. Please consult the list of
supported CUDA devices for more details. (error code = CUDBG_ERROR_INVALID_DEVICE(0xb)

It prompt my devices can not for debugging,I only have one device ,what can i do?
Looking forward to your reply.

Hi @waitting33
Please take a look at this topic: Cuda-gdb report internal error while using under wsl2 - #7 by hiao do you experience similar problem?

I’m sorry,My question seems different from his,the error is different,my error is:
fatal: One or more CUDA devices cannot be used for debugging. Please consult the list of
supported CUDA devices for more details. (error code = CUDBG_ERROR_INVALID_DEVICE(0xb)

Could you also check whether you have the correct reg key?

DS9AWAZ6SJSUXZ858OSD84W

I don not have a GPUDebugger path,it’s really strange

Could you tell me Is my modification correct? If it is correct, I will restart my computer and wsl,thank you.


This time i think I made the correct modifications to this reg key,but it seems do not work.

Hi @waitting33
We were able to reproduce this issue on our side. Unfortunately there is no workaround for it in the current release, it will be fixed in one of the upcoming CUDA releases. I will update the topic when the fixed version is released.

OK,thanks for help

Hello!

Could you please try the latest CUDA 12.2 release (CUDA Toolkit 12.2 Downloads | NVIDIA Developer)?

Now it can work well,thanks!