diff --git a/projects/rocr-runtime/src/fmm.c b/projects/rocr-runtime/src/fmm.c index bb9b7ca8bf..3dc51ab6e8 100644 --- a/projects/rocr-runtime/src/fmm.c +++ b/projects/rocr-runtime/src/fmm.c @@ -1139,6 +1139,11 @@ static void* fmm_allocate_host_gpu(uint32_t node_id, uint64_t MemorySizeInBytes, return NULL; } + /* Mappings in the DGPU aperture don't need to be copied on + * fork. This avoids MMU notifiers and evictions due to user + * memory mappings on fork. */ + madvise(mem, MemorySizeInBytes, MADV_DONTFORK); + /* Create userptr BO */ mmap_offset = (uint64_t)mem; ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_USERPTR;