einpoklum
einpoklum

Reputation: 131547

Must I keep a virtual address range reservation if it has active mappings?

CUDA's low-level virtual memory management mechanism involves:

Conveniently, if you map a physical allocation to some address range - you can "free" the physical allocation and keep using it until it is unmapped.

Can we also do this for virtual address range reservations? i.e. will they be kept alive until the mappings are gone? The documentation doesn't say.

Upvotes: 0

Views: 22

Answers (1)

einpoklum
einpoklum

Reputation: 131547

You can't early-free reserved address ranges.

Virtual memory address range reservations apparently don't have the reference-counting mechanism which physical allocations have; the driver expects them to be released when they are no longer in use, period. An attempt to free the reservation will fail with CUDA_ERROR_INVALID_VALUE.

Upvotes: 0

Related Questions