From GPU Debugging: Challenges and Opportunities presented at the International Workshop on OpenCL (IWOCL) 2017.
GPU debugging support matches the OpenCL™ 2.0 GPU/CPU driver package for Linux* (64-bit) from OpenCL™ Drivers and Runtimes for Intel® Architecture with the notable exception of processors based on the Broadwell architecture.
KMD - Kernel Mode Driver
RT = OpenCL Runtime
DCD – Debug Companion Driver
DSL – Debug Support Library
DSL <--> DCD
The simplest option is to use ssh for steps 1,2, and 3. However, gdb can be run locally as well. The target steps (1 and 2) should be run remotely because GPU breakpoints can cause rendering hangs.
1. launch gdbserver
/usr/bin/gdbserver-igfx :1234 --attach 123
2. launch the application
export IGFXDBG_OVERRIDE_CLIENT_PID=123 ./gemm
Note: there is an automatic breakpoint at the first kernel launch
3. launch GDB
source /opt/intel/opencl-sdk/gt_debugger_2016.0/bin/debuggervars.sh /opt/intel/opencl-sdk/gt_debugger_2016.0/bin/launch_gdb.sh –tui
target remote :1234 continue x/i $pc
GDB should now be able to step through the kernel code.
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804