Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

cuda.core: grown VMM buffers record the requested size, not the aligned size

未关闭
#2,907 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

从 modify_allocation 开始,将 slow path 中 Buffer.from_handle 的大小与 fast path 中的 buf._size 以及 allocate() 的对齐大小进行比较。测试未对齐的增长和大小相等的分支,然后验证 close() 能够到达 cuMemUnmap 和 cuMemSetAccess,且没有 CUDA 警告或泄漏。考虑 epic #2906 中的所有权重设计,并为这些情况添加回归测试覆盖。

由索引模型根据 Issue 内容生成。

描述

bug cuda.core

modify_allocation records new_size on the returned Buffer (slow path: Buffer.from_handle(ptr=new_ptr, size=new_size); fast path: buf._size = new_size), while allocate() records the granularity-aligned size. For a grow to a size that is not a multiple of the granularity (2 MiB on current GPUs), close() calls cuMemUnmap with an end inside the last mapping, which the driver rejects, so the reservation, the mappings, and the physical memory leak and the Buffer deleter reports a CUDAWarning. The equal-size branch hits the same alignment rule in cuMemSetAccess and raises. Reachable today through the slow path. No test grows to an unaligned size. Fix belongs to the ownership redesign (epic #2906).

主要语言
Cython
星标
3.4k
派生
329
平均合并
1 天 22 小时
30 天内合并 PR
117

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/cuda-python 的其他 Issue

查看 NVIDIA/cuda-python 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。