Tutorial: Debugging with Intel® Distribution for GDB*

Troubleshooting

Target Installation Fails

Error message: Another version of this product is already installed.

You see this error when Intel® Distribution for GDB* Target from previous Beta releases or Intel® Debugger for Heterogeneous Compute Target included in Intel® System Studio are installed on your system.

To remove incompatible programs, use Add/Remove Programs on the Control Panel.

Cannot Connect to Target

Error message: target is not available. gdbserver cannot be run automatically.

  1. On the target system, check that gdbserver-gt can be start successfully from the command prompt:

    gdbserver-gt.exe --attach 127.0.0.1:1234 1

    where:

    • the port number 1234 is used to establish the TCP connection between gdbserver-gt and gdb;
    • the session id 1 is used by GPU runtime to find the debugger.

    CAUTION

    Do not omit the hostname or set it to localhost as it may result in connection problems between gdb and gdbserver-gt.

    If gdbserver-gt starts successfully, restart the application in Microsoft Visual Studio*. To debug the code offloaded to GPU device, you must start the gdbserver manually each time before launching the application.

  2. If gdbserver-gt fails to start, the following error message appears:

    failed to initialize GT; result: Failure
    Exiting

    1. Check the status of DCD:
      sc query igfxdcd
    2. If the status is RUNNING, reboot the machine. If the status is not RUNNING, restart the service by opening the command prompt as Administrator and using the following command:
      sc start igfxdcd
      The output must look as follows:
      SERVICE_NAME: igfxdcd
             TYPE               : 1  KERNEL_DRIVER
             STATE              : 4  RUNNING
                                     (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
             WIN32_EXIT_CODE    : 0  (0x0)
             SERVICE_EXIT_CODE  : 0  (0x0)
             CHECKPOINT         : 0x0
             WAIT_HINT          : 0x0
             PID                : 0
             FLAGS              :
    3. Restart the debugger from Microsoft Visual Studio. If the problem persists, go to step 1.

Breakpoint Is Not Hit

No error messages are displayed but a breakpoint inside the kernel is not hit.

Check the following settings:

Set Secure Connection

  1. Start gdbserver-gt via SSH connection with SSL tunnel from the host to the target.

    Note

    You can also start gdbserver-gt via Intel® oneAPI command prompt on the target system but here the recommended way is described.

    ssh remote-server -L 1234:127.0.0.1:1234
    gdbserver-gt.exe --attach 127.0.0.1:1234 1
  2. Go to Tools > Options > Intel oneAPI > Intel® Distribution for GDB* and set the Server field to localhost

This ensures that you have a secure connection. Additionally, starting the gdbserver-gt under SSH allows you to stop the server during the debugging session when the graphics output is frozen.

Unhandled exception in igc64.so

You get an unhandled exception coming from IGC at the runtime when the Debug information format is set. To resolve this issue, set Property pages > Linker > Pass additional options to device compilers to /Od.