[PATCH 13/15] drm/amdgpu: adapt vm size for multi vmpt
Christian König
deathsimple at vodafone.de
Tue Mar 28 08:38:36 UTC 2017
Am 28.03.2017 um 05:19 schrieb Zhang, Jerry (Junwei):
> On 03/27/2017 01:53 PM, Chunming Zhou wrote:
>> Change-Id: I17b40aec68404e46961a9fda22dfadd1ae9d6f2c
>> Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
>> index 6625a2f..613c8f6 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
>> @@ -508,6 +508,12 @@ static int gmc_v9_0_vm_init(struct amdgpu_device
>> *adev)
>> * amdkfd will use VMIDs 8-15
>> */
>> adev->vm_manager.num_ids = AMDGPU_NUM_OF_VMIDS;
>> + /* Because of four level VMPTs, vm size at least is 256GB.
>> + 256TB is OK as well */
>
> If each PT size is 9, and contains 3 levels PT + 1 PD.
> 9 * 3 + 12(page size) + 1(at least 1 bit for PD) = 40 bits here.
>
> Then it looks 1T is minimum size.
> Please confirm it.
I would rather say completely ignore the setting of amdgpu_vm_size here
and always use 256TB for GFX9.
Allocating a PD smaller than 4K doesn't make much sense cause you don't
save anything.
So the only valid approach would be to switch between 1, 2, 3 and 4
levels when the VM size changes and that doesn't make to much sense to
me because the saved memory is minimal (4K for each level).
Christian.
>
> Jerry.
>
>> + if (amdgpu_vm_size < 256) {
>> + DRM_WARN("vm size at least is 256GB!\n");
>> + amdgpu_vm_size = 256;
>> + }
>> adev->vm_manager.num_level = 1;
>> amdgpu_vm_manager_init(adev);
>>
>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list