[PATCH 3/3] drm/amdgpu: Workaround IOMMU driver bug
Felix Kuehling
Felix.Kuehling at amd.com
Wed May 19 05:45:36 UTC 2021
The intel IOMMU driver causes kernel oopses or internal errors flooding
kernel log when mapping larger SG tables. Limiting the size of userptr BOs
to 6GB seems to avoid this.
Signed-off-by: Felix Kuehling <Felix.Kuehling at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 2856ca1032db..a82ca85a2d6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1408,6 +1408,9 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
domain = alloc_domain = AMDGPU_GEM_DOMAIN_GTT;
alloc_flags = 0;
} else if (flags & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {
+ /* workaround IOMMU driver bug */
+ if (size >= (6ULL << 30))
+ return -ENOMEM;
domain = AMDGPU_GEM_DOMAIN_PREEMPT;
alloc_domain = AMDGPU_GEM_DOMAIN_CPU;
alloc_flags = 0;
--
2.31.1
More information about the amd-gfx
mailing list