惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园_首页
有赞技术团队
有赞技术团队
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题

Chino's Studio

LLVM Backend Practices - Part 1 · Mars Studio 一篇不知道多久前翻译的译文--30年之后,QBasic依然是最棒的编程启蒙语言 · Mars Studio Instruction Selection In LLVM · Mars Studio REPL技术分析——Python的交互式 · Mars Studio REPL技术分析——Swift REPL模式 · Mars Studio 基于Hexo和github page搭建个人博客 · Mars Studio
How to support debug on GPU
Chino Mars · 2025-02-14 · via Chino's Studio

How to support debug on GPU - WIP

Before the Sharing

First time to write a blog in English, worthy to memorize.

Recently I’m interested by the debugging tech on heterogeneous computing system, CPU with GPU for example, especially the micro-arch design. I’m lucky that I was part of a developper toolchain team, I know a bunch of guys who are really familiar with debugging tech.

In the beginning of 2018, our team were involved in the first NPU chip project of HUAWEI and we developed logging system(focusing on the software implementation), trace tool, IDE and the prototype of the debugger. Why was just a prototype, which is complicated and no comments here. Anyway, some guys were experts in that team, like my memtor Zheng. We communicated these days and concluded a brief design about the debugging system on GPU/NPU system.

Background of Debugging

Basic debug actions include: setting breakpoints, running by step, veiwing variables information(type, address, temporary value). In this blog, I will focus on the hardware support requirements to the “breakpoint setting” and “running by step”.

In CPU system, OS provides various of system interruptions to support debugging user’s applications. For example INT3 instruction of X86 help trigger a interrupt for the debugger, debugger will catch the signal and process following debugging action, like viewing the value of temporary variable. This is a software level breakpoint. And also there is a hardware way to set a breakpoint. Hardware may design several register for storing breakpoint address, which is the PC address. When polling the breakpoint registers and meeting the PC is equal to the value stored in the breakpoint register, the PC issue module will stop issuing, which implements break action of user’s program.

GPU Design for supporting Debugging

Both software and hardware ways to set a breakpoint, the hardware should support instruction level interrupt in the micro arch design.