Method and device for detecting GPU memory competition based on CPU end
CN122019311BActive Publication Date: 2026-08-28SHENZHEN XIAOMA YIXING TECH CO LTD
Patent Information
- Application Number
- CN202610494761.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-15
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-04-15
AI Technical Summary
Technical Problem
[0013]本发明实施例提供了一种基于CPU端检测GPU端显存竞争的方法及装置,以至少解决相关技术中在GPU并行计算场景中,当多个核函数(kernel)通过不同流(stream)并发访问同一显存地址引发数据竞争时,无法有效定位和诊断此类竞争,导致程序不稳定的技术问题
Benefits of technology
[0030]根据本发明实施例的另外一个方面,还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述中任意一项所述的基于CPU端检测GPU端显存竞争的方法。
✦ Generated by Eureka AI based on patent content.
Smart Images

Figure CN122019311B_ABST
Abstract
This invention discloses a method and apparatus for detecting GPU memory contention on the CPU side. The method includes: embedding a callback function at the API entry point of a GPU application during runtime to dynamically capture the context information corresponding to each GPU call initiated by the GPU application; constructing a CPU simulation execution environment on the CPU side that is semantically equivalent to parallel execution on the GPU side based on the context information; enabling TSAN in this environment to monitor the concurrent access behavior of multiple CPU threads to the same mapped memory address; and when the monitoring results indicate that TSAN has detected data contention, mapping the contention information associated with the contention event back to the context information to complete the detection of GPU memory contention. This invention solves the technical problem in related technologies where, in GPU parallel computing scenarios, when multiple kernel functions concurrently access the same memory address through different streams, causing data contention, it is impossible to effectively locate and diagnose such contention, leading to program instability.
Need to check novelty before this filing date? Find Prior Art
Citation Information
Patent Citations
GPU resource testing method and device, medium and electronic equipment
CN119396530A
GPU memory access simulation system and method, storage medium and electronic equipment
CN120872503A