Skip to contentSkip to conversation

drm/amdkfd: enable heavy-weight TLB flush on Vega20

PATCH In review Eric Huang 3 participants 4 messages Jan 21, 2022 – Feb 7, 2022

Subsystems (3)
lore
Share & tools
lore

Eric Huang

author
#0 lore raw

PATCH 1/1 drm/amdkfd: enable heavy-weight TLB flush on Vega20

It is to meet the requirement for memory allocation optimization on MI50.

---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -1
index 5b8ae0795c0a..d708f1a502cf 100644
@@ -1582,7 +1582,8 @@ static int kfd_ioctl_free_memory_of_gpu(struct file *filep,
 static bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev) {
 	return KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) ||
 	       (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) &&
-	        dev->adev->sdma.instance[0].fw_version >= 18);
+	        dev->adev->sdma.instance[0].fw_version >= 18) ||
+	        KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0);
 }
 
 static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Eric Huang

It is to meet the requirement for memory allocation optimization on MI50.

Assuming there is no firmware version requirement, the patch is:

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -2
index 5b8ae0795c0a..d708f1a502cf 100644
@@ -1582,7 +1582,8 @@ static int kfd_ioctl_free_memory_of_gpu(struct file *filep,
 static bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev) {
        return KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) ||
               (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) &&
-               dev->adev->sdma.instance[0].fw_version >= 18);
+               dev->adev->sdma.instance[0].fw_version >= 18) ||
+               KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0);
 }
 
 static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
--

2.25.1

Acked-by Alex Deucher
#2 lore raw

[Public]

Hi Eric,

Are you sure that there is no FW requirement for this patch on Vega20? KFDMemory test failed by this commit.

Regards,
Guchun

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, January 25, 2022 4:08 AM
To: Huang, JinHuiEric <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Vega20

Quoted 5 lines · Eric Huang

It is to meet the requirement for memory allocation optimization on MI50.

Assuming there is no firmware version requirement, the patch is:

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -2
index 5b8ae0795c0a..d708f1a502cf 100644
@@ -1582,7 +1582,8 @@ static int kfd_ioctl_free_memory_of_gpu(struct 
 file *filep,  static bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev) {
        return KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) ||
               (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) &&
-               dev->adev->sdma.instance[0].fw_version >= 18);
+               dev->adev->sdma.instance[0].fw_version >= 18) ||
+               KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0);
 }
 
 static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
--

2.25.1

author
#3 lore raw

Hi Guchun,

SDMA FW team confirms MI50/VG20 doesn't have the same bug as MI100, which cases asic hang issue when running RVS test. If this change makes KFDMemoryTest failed, please fill a Jira and assign to me.

Thanks,
Eric

Quoted 46 lines · Guchun

[Public]

Hi Eric,

Are you sure that there is no FW requirement for this patch on Vega20? KFDMemory test failed by this commit.

Regards,
Guchun

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, January 25, 2022 4:08 AM
To: Huang, JinHuiEric <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Vega20

Quoted 4 lines · Eric Huang

It is to meet the requirement for memory allocation optimization on MI50.

Assuming there is no firmware version requirement, the patch is:

Quoted 22 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -2
index 5b8ae0795c0a..d708f1a502cf 100644
@@ -1582,7 +1582,8 @@ static int kfd_ioctl_free_memory_of_gpu(struct
 file *filep,  static bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev) {
         return KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) ||
                (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) &&
-               dev->adev->sdma.instance[0].fw_version >= 18);
+               dev->adev->sdma.instance[0].fw_version >= 18) ||
+               KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0);
  }
 
  static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
--

2.25.1