This guide is designed to help you start using Intel® Distribution for GDB* for debugging Data Parallel C++ (DPC++), OpenMP™, and OpenCL™ applications. It describes how to set up the debugger to debug applications with kernels offloaded to CPU and GPU devices.

Intel® Distribution for GDB* is available as part of the Intel® oneAPI Base Toolkit. For more information on Intel® oneAPI Toolkits, visit the product page.

Visit the Release Notes page for the Known Issues and most up-to-date information.

Prerequisites

Ensure that the Intel® oneAPI Base Toolkit for Windows* OS is installed.

Get Started with Debugging on a CPU

Build the Application

  1. In Microsoft Visual Studio* 2017 or 2019, go to File > New > Browse Intel oneAPI Samples and choose Array Transform.

    If you have already fetched the sample or you have your own sample, simply open the solution file with Microsoft Visual Studio.

  2. Go to Tools > Options > Debugging > General and uncheck the Require source files to exactly match the original version box.

  3. Go to Project > Properties

    1. Select General and set  Platform Toolset to Intel® oneAPI DPC++ Compiler.

    2. Select Debugging
      • Set Command Arguments to cpu

      • Set the Environment filed to CL_CONFIG_USE_NATIVE_DEBUGGER=1
    3. For a smooth debug experience, disable kernel optimizations by selecting Linker and setting the Pass additional options to device compilers field to /Od.

  4. Build the solution by selecting Build > Build Solution. In the Output window, verify that the build is successful.

Debug the Application

You are ready to debug your project.

  • From the Debug menu, select Start Debugging.
  • Click the Local Windows Debugger menu.

Refer to the tutorial to learn more about using Intel® Distribution for GDB*.

Get Started with Debugging on a GPU

For debugging on a GPU using Intel® Distribution for GDB*, you must complete the remote setup of Microsoft Visual Studio * remote debugger . Debugging and running an application on the same machine is not supported yet.

Configure the Target System

  1. Make sure that run-time dependencies on shared libraries from Intel® oneAPI Toolkits are available on the target system outside the Intel® OneAPI environment. You can choose one of the following ways:

    • Install Intel® oneAPI Toolkit on the target system
    • Install run-time dependencies on the target system
    • Copy run-time dependencies from the host to the target
  2. Add the run-time dependencies to the PATH variable.

    If you use the sample program, Array Transform, add the following compiler parts to the PATH variable:

    • Path to Intel\oneapi\compiler\latest\windows\bin
    • Path to Intel\oneapi\compiler\latest\windows\redist\intel64_win\compiler.
    Note: You do not need to add these settings to the Environment field in the Property Pages > Debugging tab in Microsoft Visual Studio. Otherwise, this value substitutes the original PATH variable on the remote system.
    Note: Additional Files to Deploy feature of Microsoft Visual Studio does not support deploying entire directories, so it is inconvenient to use this option for deploying Intel® oneAPI libraries.
  3. Copy the installer of Microsoft Visual Studio remote debugger (gen_debugger_target.msi) from the host system to the target one. The installer is located at <install_dir>\target. The default install path is C:\Program Files (x86)\Intel\oneapi\debugger\latest.

  4. Run the installer on the target. After the installation, reboot the system.

    Note:

    The installer sets the following registry keys to 0:

    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Scheduler\EnablePreemption
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\TdrLevel

    These settings disable Timeout Detection and Recovery (TDR) and preemption requests from the GPU scheduler.

For further instructions on setting up the Intel® Distribution for GDB* debugging session, refer to the tutorial.

Learn More

Document

Description

Tutorial: Debugging with Intel® Distribution for GDB*

This document describes the basic scenarios to follow while debugging DPC++ and OpenCL with Intel® Distribution for GDB*.

Intel® Distribution for GDB* User Guide

This document describes all common tasks that you can complete with Intel® Distribution for GDB* and provides necessary technical details..

Intel® Distribution for GDB* Release Notes

The notes contain the most up-to-date information about Intel® Distribution for GDB* as part of the Intel® oneAPI Base Toolkit.

Intel® oneAPI product page

This page contains brief introduction on Intel® oneAPI Toolkits and links to useful resources.

Notices and Disclaimers

Intel technologies may require enabled hardware, software or service activation.

No product or component can be absolutely secure.

Your costs and results may vary.

© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.

No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.

The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.

Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.

OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.