[BUG]: VirtualMemoryResource `host_numa` allocations always fail
維護者通常 1 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 70/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
從 cuda_core/cuda/core/_memory/_virtual_memory_resource.py 開始,重點查看 VirtualMemoryResource.init 和 allocate,並檢查 cuda_core/cuda/core/typing.py 中的 HOST_NUMA 定義。執行 cuda_core/tests/test_memory.py,並擴充主機位置涵蓋範圍以測試配置,包括回報的 host_numa 和 host_numa_current 情況。完成標準是:已測試受支援的主機位置行為,且配置不再因缺少位置 ID 而失敗。
由索引模型根據 Issue 內容生成。
描述
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Runtime Error
Component
cuda.core
Describe the bug
Every VirtualMemoryResource allocation with location_type="host_numa" fails with CUDA_ERROR_INVALID_VALUE, on a system that reports host_numa_id 0 and host_numa_virtual_memory_management_supported True. VirtualMemoryResource.allocate passes prop.location.id = -1 whenever the resource has no device, which __init__ sets for every host location type, and cuMemCreate rejects CU_MEM_LOCATION_TYPE_HOST_NUMA with that id. cuda_core/cuda/core/typing.py documents HOST_NUMA as "host memory pinned to a specific NUMA node", and VirtualMemoryResourceOptions has no field that carries a node id.
location_type="host_numa_current" also fails, for a separate reason: cuMemCreate rejects CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT for every node id I passed it, including 0.
test_vmm_host_location_types_report_host_accessible in cuda_core/tests/test_memory.py parametrizes over host, host_numa and host_numa_current, but it only checks mr.device and mr.is_host_accessible, so it stays green without ever calling allocate.
How to Reproduce
from cuda.core import Device, VirtualMemoryResource, VirtualMemoryResourceOptions
dev = Device()
dev.set_current()
print("host_numa_id =", dev.properties.host_numa_id)
for location_type in ("host", "host_numa"):
opts = VirtualMemoryResourceOptions(location_type=location_type, handle_type=None)
buf = VirtualMemoryResource(dev, config=opts).allocate(4096)
print(location_type, "allocated", buf.size, "bytes")
buf.close()
host_numa_id = 0
host allocated 2097152 bytes
Traceback (most recent call last):
File "/tmp/vmm_host_numa.py", line 8, in <module>
buf = VirtualMemoryResource(dev, config=opts).allocate(4096)
File "/home/vyron-vasileiadis/projects/forks/cuda-python/cuda_core/cuda/core/_memory/_virtual_memory_resource.py", line 555, in allocate
raise_if_driver_error(res)
~~~~~~~~~~~~~~~~~~~~~^^^^^
File "cuda/core/_utils/cuda_utils.pyx", line 134, in cuda.core._utils.cuda_utils._check_driver_error
File "cuda/core/_utils/cuda_utils.pyx", line 145, in cuda.core._utils.cuda_utils._check_driver_error
cuda.core._utils.cuda_utils.CUDAError: CUDA_ERROR_INVALID_VALUE: This indicates that one or more of the parameters passed to the API call is not within an acceptable range of values.
Expected behavior
allocate should either return a buffer pinned to a NUMA node, the way location_type="host" and location_type="device" already do, or fail at construction with an error naming the missing node id. Driving cuMemCreate directly on this system, CU_MEM_LOCATION_TYPE_HOST_NUMA returns CUDA_SUCCESS at location.id = 0 and CUDA_ERROR_INVALID_VALUE at location.id = -1, so the location id is the only thing standing between the current behaviour and a working allocation.
Operating System
Ubuntu 26.04 LTS
nvidia-smi output
Tue Aug 25 11:22:23 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.84 Driver Version: 595.84 CUDA Version: 13.2 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3050 ... Off | 00000000:01:00.0 Off | N/A |
| N/A 46C P8 3W / 30W | 11MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
- 主要語言
- Cython
- 星號
- 3.4k
- 分支
- 335
- 平均合併
- 1 天 18 小時
- 30 天內合併 PR
- 125
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NVIDIA/cuda-python 的其他 Issue
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRs可能已有人在做 @rwgk 於 12 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
NVIDIA/cuda-python#2952 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[DOC]: cuda.core 1.1.1 note misstates program cache permissions可能已有人在做 @leofang 於 27 天前認領。 未關閉documentation P1
難度 1/5 1 小時以內 新手友好度 88/100
NVIDIA/cuda-python#2717 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[DOC]: `PinnedMemoryResource.allocate` documents no parameters可能已有人在做 @Andy-Jost 於 27 天前認領。 未關閉cuda.core documentation P1
難度 1/5 1-3 小時 新手友好度 90/100
NVIDIA/cuda-python#2712 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookup可能已有人在做 @rwgk 於 27 天前認領。 未關閉triage
難度 2/5 1-3 小時 新手友好度 82/100
NVIDIA/cuda-python#2646 · 1 個 reaction ·
維護者通常 1 天內回覆
-
[FEA]: Support inheritance from Buffer可能已有人在做 @leofang 於 27 天前認領。 未關閉cuda.core triage
難度 2/5 1-3 小時 新手友好度 62/100
NVIDIA/cuda-python#2435 · 1 則留言 ·
維護者通常 1 天內回覆
查看 NVIDIA/cuda-python 的全部 Issue
相似的 Issue
-
bug p2
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
anthropics/anthropic-sdk-typescript#1273 ·
維護者通常 10 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
CopilotKit/OpenBot#815 ·
維護者通常 1 天內回覆
-
comp/tui-gateway P2 type/bug
難度 1/5 1 小時以內 新手友好度 90/100
NousResearch/hermes-agent#142379 · 1 則留言 ·
維護者通常 1 天內回覆
-
priority: low
難度 2/5 1-3 小時 新手友好度 76/100
melodic-software/claude-code-plugins#8831 · 1 則留言 ·
維護者通常 1 天內回覆