NVIDIA / NVIDIA/cuda-python

cuda.core: VirtualMemoryResourceOptions accepts values the driver rejects, and modify_allocation mishandles edge inputs

Open
#2,910 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cuda.core
Dominant language
Cython
Stars
3.4k
Forks
329
Avg merge
1d 23h
Merged PRs (30d)
116

Description

Validation gaps found while analyzing #2882, each a small change: (1) addr_align larger than the granularity makes the adjacent-reservation probe fail with a misaligned hint, which is treated as fatal instead of falling back to the slow path; (2) new_size < buf.size is silently treated as an access-only update; (3) allocation_type=MANAGED is exposed but current drivers reject it in cuMemCreate; (4) modify_allocation guards a user-reachable condition with assert; (5) allocate(0) reaches the driver and fails while sibling resources return an empty Buffer; (6) the default handle_type=POSIX_FD fails on native Windows WDDM devices and on location_type="host"; (7) for host locations device_id is validated and ignored, HOST_NUMA_CURRENT can never allocate, and a host resource with peers reports is_device_accessible=False. Related: #2694.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the cuda.core VirtualMemoryResourceOptions, modify_allocation, and allocate entry points, then compare their behavior with sibling resources. Check each of the seven listed edge cases, including host locations and Windows WDDM, and add or update coverage so accepted inputs match driver behavior and zero-size allocation matches sibling resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.