Skip to contentSkip to conversation

drm/amdgpu: set default noretry=1 to fix kfd SVM issues for raven

PATCH In review Changfeng 3 participants 5 messages Jul 28, 2021 – Aug 5, 2021

Subsystems (2)
lore
Share & tools
lore

Changfeng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: set default noretry=1 to fix kfd SVM issues for raven

From: changzhu <[email protected]>

From: Changfeng <[email protected]>

It can't find any issues with noretry=1 except two SVM migrate issues. Oppositely, it will cause most SVM cases fail with noretry=0. The two SVM migrate issues also happen with noretry=0. So it can set default noretry=1 for raven firstly to fix most SVM fails.

Change-Id Idb5cb3c1a04104013e4ab8aed2ad4751aaec4bbc
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -7
index 09edfb64cce0..d7f69dbd48e6 100644
@@ -606,19 +606,20 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
 		 */
+	case CHIP_RAVEN:
+		/*
+		 * TODO: Raven currently can fix most SVM issues with
+		 * noretry =1. However it has two issues with noretry = 1
+		 * on kfd migrate tests. It still needs to root causes
+		 * with these two migrate fails on raven with noretry = 1.
+		 */
 		if (amdgpu_noretry == -1)
 			gmc->noretry = 1;
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;
-	case CHIP_RAVEN:
 	default:
-		/* Raven currently has issues with noretry
-		 * regardless of what we decide for other
-		 * asics, we should leave raven with
-		 * noretry = 0 until we root cause the
-		 * issues.
-		 *
+		/*
 		 * default this to 0 for now, but we may want
 		 * to change this in the future for certain
 		 * GPUs as it can increase performance in
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 5 lines · Changfeng

From: changzhu <[email protected]>

From: Changfeng <[email protected]>

Quoted 7 lines

It can't find any issues with noretry=1 except two SVM migrate issues. Oppositely, it will cause most SVM cases fail with noretry=0. The two SVM migrate issues also happen with noretry=0. So it can set default noretry=1 for raven firstly to fix most SVM fails.

Change-Id Idb5cb3c1a04104013e4ab8aed2ad4751aaec4bbc

I would suggest testing this on a wide variety of raven systems, including some OEM ones if possible. Last time we did this it caused tons of stability issues with raven systems.

Alex

Quoted 39 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -8
index 09edfb64cce0..d7f69dbd48e6 100644
@@ -606,19 +606,20 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
                 * noretry = 0 will cause kfd page fault tests fail
                 * for some ASICs, so set default to 1 for these ASICs.
                 */
+       case CHIP_RAVEN:
+               /*
+                * TODO: Raven currently can fix most SVM issues with
+                * noretry =1. However it has two issues with noretry = 1
+                * on kfd migrate tests. It still needs to root causes
+                * with these two migrate fails on raven with noretry = 1.
+                */
                if (amdgpu_noretry == -1)
                        gmc->noretry = 1;
                else
                        gmc->noretry = amdgpu_noretry;
                break;
-       case CHIP_RAVEN:
        default:
-               /* Raven currently has issues with noretry
-                * regardless of what we decide for other
-                * asics, we should leave raven with
-                * noretry = 0 until we root cause the
-                * issues.
-                *
+               /*
                 * default this to 0 for now, but we may want
                 * to change this in the future for certain
                 * GPUs as it can increase performance in
--

2.17.1

Quoted 4 lines

_______________________________________________
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

#2 lore raw
In reply to Changfeng

Doesn't this break IOMMUv2? Applications that run using IOMMUv2 for system memory access depend on correct retry handling in the SQ. Therefore noretry must be 0 on Raven.

I believe the reason that SVM has trouble with retry enabled is, that IOMMUv2 is catching the page faults, so the driver never gets to handle the page fault interrupts. That breaks page-fault based migration in the SVM code. I think the better solution is to disable SVM on APUs where IOMMUv2 is enabled.

Alternatively, we could give up on IOMMUv2 entirely and always rely on SVM to provide that functionality. But that requires more changes in the amdgpu_vm code.

Regards,
  Felix

Am 2021-07-28 um 2:36 a.m. schrieb Changfeng:

Quoted 37 lines

From: changzhu <[email protected]>

From: Changfeng <[email protected]>

It can't find any issues with noretry=1 except two SVM migrate issues. Oppositely, it will cause most SVM cases fail with noretry=0. The two SVM migrate issues also happen with noretry=0. So it can set default noretry=1 for raven firstly to fix most SVM fails.

Change-Id Idb5cb3c1a04104013e4ab8aed2ad4751aaec4bbc
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +7 -1
index 09edfb64cce0..d7f69dbd48e6 100644
@@ -606,19 +606,20 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
 		 */
+	case CHIP_RAVEN:
+		/*
+		 * TODO: Raven currently can fix most SVM issues with
+		 * noretry =1. However it has two issues with noretry = 1
+		 * on kfd migrate tests. It still needs to root causes
+		 * with these two migrate fails on raven with noretry = 1.
+		 */
 		if (amdgpu_noretry == -1)
 			gmc->noretry = 1;
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;
-	case CHIP_RAVEN:
 	default:

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 625

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -6
-		/* Raven currently has issues with noretry
-		 * regardless of what we decide for other
-		 * asics, we should leave raven with
-		 * noretry = 0 until we root cause the
-		 * issues.
-		 *
+		/*
 		 * default this to 0 for now, but we may want
 		 * to change this in the future for certain
 		 * GPUs as it can increase performance in

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

#3 lore raw

[AMD Official Use Only]

Hi Felix,

Can we set noretry=1 for dgpu path(ignore_crat=1) which doesn’t to through iommuv2 path on raven as below:

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +7 -0
+	case CHIP_RAVEN:
+		/*
+		 * TODO: Raven currently can fix most SVM issues with
+		 * noretry =1. However it has two issues with noretry = 1
+		 * on kfd migrate tests. It still needs to root causes
+		 * with these two migrate fails on raven with noretry = 1.
+		 */
 		if (amdgpu_noretry == -1) {

If(ignore_crat)

 				gmc->noretry = 1;
			else
				gmc->noretry = 0;
		}

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 620

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;

BR,
Changfeng.

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 28, 2021 10:22 PM
To: Zhu, Changfeng <[email protected]>; [email protected]; Huang, Ray <[email protected]>; Zhang, Yifan <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: set default noretry=1 to fix kfd SVM issues for raven

Doesn't this break IOMMUv2? Applications that run using IOMMUv2 for system memory access depend on correct retry handling in the SQ. Therefore noretry must be 0 on Raven.

I believe the reason that SVM has trouble with retry enabled is, that
IOMMUv2 is catching the page faults, so the driver never gets to handle the page fault interrupts. That breaks page-fault based migration in the SVM code. I think the better solution is to disable SVM on APUs where IOMMUv2 is enabled.

Alternatively, we could give up on IOMMUv2 entirely and always rely on SVM to provide that functionality. But that requires more changes in the amdgpu_vm code.

Regards,
  Felix

Am 2021-07-28 um 2:36 a.m. schrieb Changfeng:

Quoted 48 lines

From: changzhu <[email protected]>

From: Changfeng <[email protected]>

It can't find any issues with noretry=1 except two SVM migrate issues. Oppositely, it will cause most SVM cases fail with noretry=0. The two SVM migrate issues also happen with noretry=0. So it can set default noretry=1 for raven firstly to fix most SVM fails.

Change-Id Idb5cb3c1a04104013e4ab8aed2ad4751aaec4bbc
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -7
index 09edfb64cce0..d7f69dbd48e6 100644
@@ -606,19 +606,20 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
 		 */
+	case CHIP_RAVEN:
+		/*
+		 * TODO: Raven currently can fix most SVM issues with
+		 * noretry =1. However it has two issues with noretry = 1
+		 * on kfd migrate tests. It still needs to root causes
+		 * with these two migrate fails on raven with noretry = 1.
+		 */
 		if (amdgpu_noretry == -1)
 			gmc->noretry = 1;
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;
-	case CHIP_RAVEN:
 	default:
-		/* Raven currently has issues with noretry
-		 * regardless of what we decide for other
-		 * asics, we should leave raven with
-		 * noretry = 0 until we root cause the
-		 * issues.
-		 *
+		/*
 		 * default this to 0 for now, but we may want
 		 * to change this in the future for certain
 		 * GPUs as it can increase performance in
#4 lore raw

Am 2021-08-05 um 4:51 a.m. schrieb Zhu, Changfeng:

Quoted 5 lines

[AMD Official Use Only]

Hi Felix,

Can we set noretry=1 for dgpu path(ignore_crat=1) which doesn’t to through iommuv2 path on raven as below:

There are other possible reasons than ignore_crat for Raven to work in dGPU mode (broken CRAT, disabled IOMMU). However, those are not known until later in the initialization.

Regards,
  Felix

Quoted 87 lines
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +7 -0
+	case CHIP_RAVEN:
+		/*
+		 * TODO: Raven currently can fix most SVM issues with
+		 * noretry =1. However it has two issues with noretry = 1
+		 * on kfd migrate tests. It still needs to root causes
+		 * with these two migrate fails on raven with noretry = 1.
+		 */
 		if (amdgpu_noretry == -1) {

If(ignore_crat)

 				gmc->noretry = 1;
			else
				gmc->noretry = 0;
		}

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 620

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;

BR,
Changfeng.

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 28, 2021 10:22 PM
To: Zhu, Changfeng <[email protected]>; [email protected]; Huang, Ray <[email protected]>; Zhang, Yifan <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: set default noretry=1 to fix kfd SVM issues for raven

Doesn't this break IOMMUv2? Applications that run using IOMMUv2 for system memory access depend on correct retry handling in the SQ. Therefore noretry must be 0 on Raven.

I believe the reason that SVM has trouble with retry enabled is, that
IOMMUv2 is catching the page faults, so the driver never gets to handle the page fault interrupts. That breaks page-fault based migration in the SVM code. I think the better solution is to disable SVM on APUs where IOMMUv2 is enabled.

Alternatively, we could give up on IOMMUv2 entirely and always rely on SVM to provide that functionality. But that requires more changes in the amdgpu_vm code.

Regards,
  Felix

Am 2021-07-28 um 2:36 a.m. schrieb Changfeng:

Quoted 48 lines

From: changzhu <[email protected]>

From: Changfeng <[email protected]>

It can't find any issues with noretry=1 except two SVM migrate issues. Oppositely, it will cause most SVM cases fail with noretry=0. The two SVM migrate issues also happen with noretry=0. So it can set default noretry=1 for raven firstly to fix most SVM fails.

Change-Id Idb5cb3c1a04104013e4ab8aed2ad4751aaec4bbc
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -7
index 09edfb64cce0..d7f69dbd48e6 100644
@@ -606,19 +606,20 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
 		 */
+	case CHIP_RAVEN:
+		/*
+		 * TODO: Raven currently can fix most SVM issues with
+		 * noretry =1. However it has two issues with noretry = 1
+		 * on kfd migrate tests. It still needs to root causes
+		 * with these two migrate fails on raven with noretry = 1.
+		 */
 		if (amdgpu_noretry == -1)
 			gmc->noretry = 1;
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;
-	case CHIP_RAVEN:
 	default:
-		/* Raven currently has issues with noretry
-		 * regardless of what we decide for other
-		 * asics, we should leave raven with
-		 * noretry = 0 until we root cause the
-		 * issues.
-		 *
+		/*
 		 * default this to 0 for now, but we may want
 		 * to change this in the future for certain
 		 * GPUs as it can increase performance in