Re: [PATCH 13/15] drm/amdgpu: adapt vm size for multi vmpt
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 --- 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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 13/15] drm/amdgpu: adapt vm size for multi vmpt
On 2017年03月28日 11:19, Zhang, Jerry (Junwei) wrote: On 03/27/2017 01:53 PM, Chunming Zhou wrote: Change-Id: I17b40aec68404e46961a9fda22dfadd1ae9d6f2c Signed-off-by: Chunming Zhou --- 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. block size is 9 means 512 entries each PDB/PTB. then one PDE of 4 levels is 512* 512 *512*4KB = 512GB. will send another patch to correct this typo. Thanks, David Zhou Then it looks 1T is minimum size. Please confirm it. 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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 13/15] drm/amdgpu: adapt vm size for multi vmpt
On 03/27/2017 01:53 PM, Chunming Zhou wrote: Change-Id: I17b40aec68404e46961a9fda22dfadd1ae9d6f2c Signed-off-by: Chunming Zhou --- 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. 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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 13/15] drm/amdgpu: adapt vm size for multi vmpt
Change-Id: I17b40aec68404e46961a9fda22dfadd1ae9d6f2c Signed-off-by: Chunming Zhou --- 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 (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); -- 1.9.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx