arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.26889cs.PF
收藏

揭示NVIDIA闭源驱动命令流以获取CPU-GPU运行时行为洞察

Revealing NVIDIA Closed-Source Driver Command Streams for CPU-GPU Runtime Behavior Insight

Queen’s University(女王大学)

Yuang Yan, Ian Karlin, Ryan Grant

AI总结:

本文通过揭示NVIDIA闭源驱动的命令流,分析CUDA数据传输和CUDA Graphs的执行行为,为GPU中间件优化提供实践基础。

摘要:

对于NVIDIA GPU,CUDA是应用程序调度GPU执行的主要接口,但大部分实现CUDA操作的逻辑位于NVIDIA闭源用户空间驱动中。因此,从高级CUDA API到低级硬件命令的转换仍不透明,限制了软件理解和性能归因。本文使该命令路径可见。我们通过利用最近开源的内核驱动,利用内存映射路径,并在GPU门铃寄存器的用户空间映射上安装硬件监视点,完整恢复NVIDIA闭源用户空间驱动发出的硬件命令流。通过此方法,本文展示了两个案例研究。对于CUDA数据传输,我们识别了驱动选择的DMA提交模式,并通过CUDA绕过受控命令发布来独立于驱动开销表征其原始硬件性能。对于CUDA Graphs,我们表明新版本CUDA中减少的启动开销与更小的命令足迹和更高效的提交模式相关。这些结果表明,命令级可见性为理解并优化GPU中间件行为提供了实践基础,提高了性能解释,并为CUDA及相关加速器堆栈的未来硬件-软件协同设计提供了信息。

英文摘要:

For NVIDIA GPUs, CUDA is the primary interface through which applications orchestrate GPU execution, yet much of the logic that realizes CUDA operations resides in NVIDIA's closed-source userspace driver. As a result, the translation from high-level CUDA APIs to low-level hardware commands remains opaque, limiting both software understanding and performance attribution. This paper makes that command path visible. We recover the hardware command streams emitted by NVIDIA's closed-source userspace driver with full integrity by leveraging the recently open-sourced kernel driver, instrumenting the memory-mapping path, and installing a hardware watchpoint on the userspace mapping of the GPU doorbell register. This lets us capture complete command submissions at the moment they are committed. Using this methodology, we present two case studies. For CUDA data movement, we identify the DMA submission modes selected by the driver and characterize their raw hardware performance independently of driver overhead through CUDA-bypassing controlled command issuance. For CUDA Graphs, we show that the reduced launch overhead in newer CUDA releases is associated with a smaller command footprint and a more efficient submission pattern. Together, these results show that command-level visibility provides a practical basis for understanding and optimizing GPU middleware behavior, improving performance interpretation, and informing future hardware--software co-design for CUDA and related accelerator stacks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑