简体   繁体   中英

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

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

  • Physical allocations
  • Virtual address range reservations
  • Mappings between the above

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? ie will they be kept alive until the mappings are gone? The documentation doesn't say.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM