Skip to contentSkip to conversation

drm/amdgpu: Fix a bug that vm size is wrong on Raven

PATCH In review Yong Zhao 3 participants 4 messages Dec 14, 2017 – Dec 18, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Yong Zhao

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix a bug that vm size is wrong on Raven

Change-Id Id522c1cbadb8c069720f4e64a31cff42cd014733
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 709587d..93500e6 100644
@@ -2534,7 +2534,7 @@ void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t vm_size,
 	uint64_t tmp;
 
 	/* adjust vm size first */
-	if (amdgpu_vm_size != -1) {
+	if (amdgpu_vm_size != -1 && adev->asic_type != CHIP_RAVEN) {
 		unsigned max_size = 1 << (max_bits - 30);
 
 		vm_size = amdgpu_vm_size;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1513269904-3385-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Is there a way to override the VM size for KFD VMs only? Only they depend on ATS, so only they need to be forced to be 48-bits.

On the other hand, it could be argued that a user who manually sets the VM size with a module parameter knows what they're doing. So let them break ATS.

Regards,
  Felix

Am 14.12.2017 um 17:45 schrieb Yong Zhao:

Quoted 11 lines
Change-Id Id522c1cbadb8c069720f4e64a31cff42cd014733
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index 709587d..93500e6 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t vm_size, · line 2540

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -2534,7 +2534,7 @@ void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t vm_size,
 	uint64_t tmp;
 
 	/* adjust vm size first */
-	if (amdgpu_vm_size != -1) {
+	if (amdgpu_vm_size != -1 && adev->asic_type != CHIP_RAVEN) {
 		unsigned max_size = 1 << (max_bits - 30);
 
 		vm_size = amdgpu_vm_size;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 9ebd38b5-2b12-8797-65e5-3a920ce697aa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw

The problem was a merge conflict.

No idea what exactly went wrong, but Yong ended up with a branch where the vm_size was always overwritten with the value 64.

So we can completely drop this patch and yes when an user overrides the vm_size value he/she should know what the consequences are.

Regards,
Christian.

Am 17.12.2017 um 00:21 schrieb Felix Kühling:

Quoted 30 lines

Is there a way to override the VM size for KFD VMs only? Only they depend on ATS, so only they need to be forced to be 48-bits.

On the other hand, it could be argued that a user who manually sets the VM size with a module parameter knows what they're doing. So let them break ATS.

Regards,
  Felix

Am 14.12.2017 um 17:45 schrieb Yong Zhao:

Quoted 18 lines
Change-Id Id522c1cbadb8c069720f4e64a31cff42cd014733
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 709587d..93500e6 100644
@@ -2534,7 +2534,7 @@ void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t vm_size,
  	uint64_t tmp;
 
  	/* adjust vm size first */
-	if (amdgpu_vm_size != -1) {
+	if (amdgpu_vm_size != -1 && adev->asic_type != CHIP_RAVEN) {
  		unsigned max_size = 1 << (max_bits - 30);
 
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t vm_size, · line 2540

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
  		vm_size = amdgpu_vm_size;

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): e3d20771-df70-b9e5-345b-9914c54db292-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

author
#6 lore raw

Felix,

we ended up with this fix. http://git.amd.com:8080/#/c/122202/

I explored the option to override the VM size only for KFD VMs, but it was not easy as amdgpu_check_vm_size() and amdgpu_vm_adjust_size() come in during loading amdgpu, i. e. before KFD VMs are created. So to fix the problem quickly, we ended up to not overwrite the VM size for all Raven VMs.

Regards,

Yong

________________________________
From: Christian König <[email protected]>
Sent: Monday, December 18, 2017 4:22:43 AM
To: Felix Kühling; Zhao, Yong; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Fix a bug that vm size is wrong on Raven

The problem was a merge conflict.

No idea what exactly went wrong, but Yong ended up with a branch where the vm_size was always overwritten with the value 64.

So we can completely drop this patch and yes when an user overrides the vm_size value he/she should know what the consequences are.

Regards,
Christian.

Am 17.12.2017 um 00:21 schrieb Felix Kühling:

Is there a way to override the VM size for KFD VMs only? Only they depend on ATS, so only they need to be forced to be 48-bits.

On the other hand, it could be argued that a user who manually sets the VM size with a module parameter knows what they're doing. So let them break ATS.

Regards,
Felix

Am 14.12.2017 um 17:45 schrieb Yong Zhao:

Change-Id Id522c1cbadb8c069720f4e64a31cff42cd014733
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 709587d..93500e6 100644
@@ -2534,7 +2534,7 @@ void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t vm_size,
        uint64_t tmp;
 
        /* adjust vm size first */
-       if (amdgpu_vm_size != -1) {
+       if (amdgpu_vm_size != -1 && adev->asic_type != CHIP_RAVEN) {
                unsigned max_size = 1 << (max_bits - 30);
 
                vm_size = amdgpu_vm_size;

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx