Contents
Get Started with Debugging on a CPU
Start using the Intel® Distribution for GDB* for debugging Data Parallel C++ (DPC++), OpenMP™, and OpenCL™ applications. Follow the instructions below 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 oneAPI toolkits, visit the product page.
Visit the Release Notes page for the Known Issues and most up-to-date information.
You can use a DPC++ sample code, Array Transform, to get started with the Intel® Distribution for GDB*. The sample does not generate errors and aims to be minimal for illustrating debugger features. The code processes elements of the input array depending on whether they are even or odd, and produces an output array. You can use the sample to debug on both the CPU or GPU. Note though that GPU debugging requires two machines and additional configuration for remote debugging.
Ensure that the Intel® oneAPI Base Toolkit for Windows* OS is installed.
If you aim to debug on GPU, install the latest GPU drivers and configure your system to use them.
In Microsoft Visual Studio* 2017 or 2019, go to File > New > Browse Intel oneAPI Samples and select Array Transform.
If you have already fetched the sample or you have your own sample, simply open the solution file with Microsoft Visual Studio.
Go to Tools > Options > Debugging > General and uncheck the Require source files to exactly match the original version box.
Select General and set Platform Toolset to Intel® oneAPI DPC++ Compiler.
Set Command Arguments to cpu
To disable kernel optimizations for a smooth debug experience, select Linker and set the Pass additional options to device compilers field to /Od.
To build the solution, select Build > Build Solution. In the Output window, verify that the build is successful.
You are ready to debug your project.
Refer to the tutorial to learn more about using Intel® Distribution for GDB*.
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.
Make sure that run-time dependencies on shared libraries from Intel® oneAPI Toolkits are available on the target system. You can choose one of the following ways:
If you use the sample program, Array Transform, add the following compiler paths to the PATH variable:
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. You can use %ONEAPI_ROOT% variable, specifying the debugger latest version: %ONEAPI_ROOT%\debugger\latest.
Run the installer on the target. After the installation, reboot the system.
The installer sets the following registry keys to 0:
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.
Document |
Description |
---|---|
This document describes the basic scenarios to follow while debugging DPC++ and OpenCL with Intel® Distribution for GDB*. |
|
This document describes all common tasks that you can complete with Intel® Distribution for GDB* and provides necessary technical details.. |
|
The notes contain the most up-to-date information about Intel® Distribution for GDB* as part of the Intel® oneAPI Base Toolkit. |
|
This page contains brief introduction on oneAPI toolkits and links to useful resources. |
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.