0

I am trying to set up cuda programming in vs code and ran into this problem where cuda-gdb just returns an error. I tried running it with regular gdb and that works. I am using wsl.

running the "CUDA C++: Launch" outputs this in the debug console:

warning: File "/usr/lib/debug/.build-id/45/87364908de169dec62ffa538170118c1c3a078.debug" has no build-id, file skipped
warning: File "/usr/lib/debug/.build-id/ce/016c975d94bc4770ed8c62d45dea6b71405a2c.debug" has no build-id, file skipped
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: File "/usr/lib/debug/.build-id/c0/f40155b3f8bf8c494fa800f9ab197ebe20ed6e.debug" has no build-id, file skipped
warning: File "/usr/lib/debug/.build-id/18/78e6b475720c7c51969e69ab2d276fae6d1dee.debug" has no build-id, file skipped
warning: File "/usr/lib/debug/.build-id/fe/91b4090ea04c1559ff71dd9290062776618891.debug" has no build-id, file skipped
Cannot find user-level thread for LWP 4949: generic error

Just running Cuda-gdb in the terminal outputs this:

BFD: /usr/lib/debug/.build-id/45/87364908de169dec62ffa538170118c1c3a078.debug: unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/45/87364908de169dec62ffa538170118c1c3a078.debug: unable to initialize decompress status for section .debug_aranges
warning: File "/usr/lib/debug/.build-id/45/87364908de169dec62ffa538170118c1c3a078.debug" has no build-id, file skipped
BFD: /usr/lib/debug/.build-id/ce/016c975d94bc4770ed8c62d45dea6b71405a2c.debug: unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/ce/016c975d94bc4770ed8c62d45dea6b71405a2c.debug: unable to initialize decompress status for section .debug_aranges
warning: File "/usr/lib/debug/.build-id/ce/016c975d94bc4770ed8c62d45dea6b71405a2c.debug" has no build-id, file skipped
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
BFD: /usr/lib/debug/.build-id/c0/f40155b3f8bf8c494fa800f9ab197ebe20ed6e.debug: unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/c0/f40155b3f8bf8c494fa800f9ab197ebe20ed6e.debug: unable to initialize decompress status for section .debug_aranges
warning: File "/usr/lib/debug/.build-id/c0/f40155b3f8bf8c494fa800f9ab197ebe20ed6e.debug" has no build-id, file skipped
BFD: /usr/lib/debug/.build-id/18/78e6b475720c7c51969e69ab2d276fae6d1dee.debug: unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/18/78e6b475720c7c51969e69ab2d276fae6d1dee.debug: unable to initialize decompress status for section .debug_aranges
warning: File "/usr/lib/debug/.build-id/18/78e6b475720c7c51969e69ab2d276fae6d1dee.debug" has no build-id, file skipped
BFD: /usr/lib/debug/.build-id/fe/91b4090ea04c1559ff71dd9290062776618891.debug: unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/fe/91b4090ea04c1559ff71dd9290062776618891.debug: unable to initialize decompress status for section .debug_aranges
warning: File "/usr/lib/debug/.build-id/fe/91b4090ea04c1559ff71dd9290062776618891.debug" has no build-id, file skipped
Hello World1
Hello World2
Hello World3
Cannot find user-level thread for LWP 4077: generic error
(cuda-gdb) 

My tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: nvcc build active file",
            "command": "/usr/bin/nvcc",
            "args": [
                "-g",
                "-G",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "compiler: /usr/bin/nvcc"
        }
    ]
}

My launch.json:

{
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/maintest",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },

        {
            "name": "CUDA C++: Launch",
            "type": "cuda-gdb",
            "request": "launch",
            "program": "${workspaceFolder}/maintest"
        }
    ]
}

1 Answers1

0

Updating wsl and changing to wsl version 2 fixed it however cuda specific functions are not debuggable as cuda-gdb is not supporting wsl yet :(