Skip to content

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

Description

@Andy-Jost

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcuda.coreEverything related to the cuda.core module

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions