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 avoid this error, remove previously installed packages using Add/Remove Programs on the Control Panel.

Cannot Connect to Target

Error message: Target is not available. GDB Server cannot be run automatically.

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

    gdbserver-gt.exe --hostpid=1 --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 host PID 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. The only argument you can change is the port number :1234. Please, do not change other arguments in gdbserver-gt command.

  2. Now, there are two options:
    • 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.
    • 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 whether in Tools > Options > Intel oneAPI > Intel® Distribution for GDB*, the Enable Debugging field is set to True.

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 the 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 --hostpid=1 --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 can 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.