[PATCH 1/2] drm/amdgpu: always allocate cleared VRAM for KFD allocations

Felix Kuehling felix.kuehling at amd.com
Tue Mar 26 18:21:57 UTC 2024


On 2024-03-26 11:52, Alex Deucher wrote:
> This adds allocation latency, but aligns better with user
> expectations.  The latency should improve with the drm buddy
> clearing patches that Arun has been working on.

If we submit this before the clear-page-tracking patches are in, this 
will cause unacceptable performance regressions for ROCm applications.

Regards,
   Felix


>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 0ae9fd844623..f9a4ea082821 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -1709,7 +1709,8 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
>   			alloc_domain = AMDGPU_GEM_DOMAIN_GTT;
>   			alloc_flags = 0;
>   		} else {
> -			alloc_flags = AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE;
> +			alloc_flags = AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE |
> +				AMDGPU_GEM_CREATE_VRAM_CLEARED;
>   			alloc_flags |= (flags & KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC) ?
>   			AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED : 0;
>   		}


More information about the amd-gfx mailing list