CUDA-GDB not work on debian

Hi

I try complete this tutorials:
https://docs.nvidia.com/nsight-visual-studio-code-edition/cuda-debugger/index.html
and

And all work, but not CUDA-GDB. If i press F5 i see this:

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
2
warning: `/lib64/ld-linux-x86-64.so.2': Shared library architecture unknown is not compatible with target architecture i386:x86-64.
BFD: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
BFD: /lib/x86_64-linux-gnu/libc.so.6: unknown type [0x13] section `.relr.dyn'
warning: `/lib/x86_64-linux-gnu/libc.so.6': Shared library architecture unknown is not compatible with target architecture i386:x86-64.
warning: `/lib/x86_64-linux-gnu/libm.so.6': Shared library architecture unknown is not compatible with target architecture i386:x86-64.
BFD: /lib/x86_64-linux-gnu/libm.so.6: unknown type [0x13] section `.relr.dyn'

Breakpoint 1,  

and it not work. How solve this problem?

My setup:
Debian 12 (bookworm)
GPU GeForce MX 230
NVIDIA Driver Version: 545.23.08
CUDA Version 12.3
cuda-gdb 11.8

CUDA and CUDA Toolkit installed from https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Debian&target_version=12.

Hi, @07734

Sorry for the issue you met. But why your cuda-gdb is not consistent with your cuda version.

CUDA Version 12.3
cuda-gdb 11.8

Can you please check cuda-gdb separately ?

  1. cuda-gdb --version
  2. cuda-gdb ./sample (You can use any CUDA sample here), set breakpoint and debug to see if cuda-gdb works.
> cuda-gdb --version
NVIDIA (R) CUDA Debugger
11.8 release
Portions Copyright (C) 2007-2022 NVIDIA Corporation
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

When I install cuda toolkit, cuda-gdb 11.8 is installed there. I don`t know how.
When I try to solve my problem I reinstall cuda-gdb sudo apt-get install nvidia-cuda-gdb.

Ok, how install correctly version cuda-gdb for CUDA 12.3?

If you successfully installed cuda toolkit 12.3, then cuda-gdb should already been installed.
Please check your cuda installation path. It should be /usr/local/cuda-12.3 in your machine. Then you can find cuda-gdb under /usr/local/cuda-12.3/bin/.

Please try to use cuda-gdb under this path.

Yes, /usr/local/cuda-12.3/ contains cuda-gdb 12.1. It works.
I create a copy in usr/bin/ and VS Code starts working in debug mode.
Thanks!

I have a question.
Why doesn`t the cuda-toolkit create this cuda-gdb automatically, but nvcc created automatically?

I’m not sure about settings in your machine. But if you want to call cuda-gdb directly, you need to add /usr/local/cuda/bin in the $PATH.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.