From f898ceecf66a68027f6c09e67c8492e61b51cfe3 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 1 Jun 2021 12:07:56 +1000 Subject: [PATCH 1/2] Add details about compute sanitizer memcheck support --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index ae7bc2040..ecc480104 100644 --- a/README.md +++ b/README.md @@ -556,6 +556,21 @@ Note that debug logging is different from the CSV memory allocation logging prov `rmm::mr::logging_resource_adapter`. The latter is for logging a history of allocation / deallocation actions which can be useful for replay with RMM's replay benchmark. +## RMM and CUDA Memory Bounds Checking + +Memory allocations taken from a memory resource that allocates a pool of memory (such as +`pool_memory_resource`) are part of the same low-level CUDA memory allocation. Therefore, +out-of-bounds or misaligned accesses to these allocations are not likely to be detected by CUDA +tools such as [CUDA Compute Sanitizer](https://docs.nvidia.com/cuda/compute-sanitizer/index.html) +memcheck. + +An exception to this is `cuda_async_memory_resource`, which uses `cudaMallocAsync` with CUDA's +built-in memory pool functionality (CUDA 11.2 or later required). Illegal memory accesses to memory +allocated by this resource are detectable with Compute Sanitizer Memcheck. + +It may be possible in the future to add support for memory bounds checking with other memory +resources using NVTX APIs. + ## Using RMM in Python Code There are two ways to use RMM in Python code: From 2ec4ead01747179837b6b0dd1e59d15f371a226b Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 1 Jun 2021 12:12:39 +1000 Subject: [PATCH 2/2] Include `arena_memory_resource` and `cuda_memory_resource` in docs about memcheck. --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ecc480104..586529711 100644 --- a/README.md +++ b/README.md @@ -559,14 +559,15 @@ deallocation actions which can be useful for replay with RMM's replay benchmark. ## RMM and CUDA Memory Bounds Checking Memory allocations taken from a memory resource that allocates a pool of memory (such as -`pool_memory_resource`) are part of the same low-level CUDA memory allocation. Therefore, -out-of-bounds or misaligned accesses to these allocations are not likely to be detected by CUDA -tools such as [CUDA Compute Sanitizer](https://docs.nvidia.com/cuda/compute-sanitizer/index.html) -memcheck. - -An exception to this is `cuda_async_memory_resource`, which uses `cudaMallocAsync` with CUDA's -built-in memory pool functionality (CUDA 11.2 or later required). Illegal memory accesses to memory -allocated by this resource are detectable with Compute Sanitizer Memcheck. +`pool_memory_resource` and `arena_memory_resource`) are part of the same low-level CUDA memory +allocation. Therefore, out-of-bounds or misaligned accesses to these allocations are not likely to +be detected by CUDA tools such as +[CUDA Compute Sanitizer](https://docs.nvidia.com/cuda/compute-sanitizer/index.html) memcheck. + +Exceptions to this are `cuda_memory_resource`, which wraps `cudaMalloc`, and +`cuda_async_memory_resource`, which uses `cudaMallocAsync` with CUDA's built-in memory pool +functionality (CUDA 11.2 or later required). Illegal memory accesses to memory allocated by these +resources are detectable with Compute Sanitizer Memcheck. It may be possible in the future to add support for memory bounds checking with other memory resources using NVTX APIs.