Skip to contentSkip to conversation

drm/amdgpu: do not execute 0-sized IBs

PATCH NAK Pelloux-prayer, Pierre-eric 3 participants 5 messages Oct 3, 2019 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: do not execute 0-sized IBs

This can be safely skipped entirely.
This seems to help with https://bugs.freedesktop.org/show_bug.cgi?id=111481.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +5 -0
index 60655834d649..aa163e679f1f 100644
@@ -227,6 +227,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 		    !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */
 			continue;
 
+		if (ib->length_dw == 0) {
+			/* On Navi gmc_v10_0_flush_gpu_tlb emits 0 sized IB */
+			continue;
+		}
+
 		amdgpu_ring_emit_ib(ring, job, ib, status);
 		status &= ~AMDGPU_HAVE_CTX_SWITCH;
 	}
Signature · 6 lines
2.23.0.rc1

_______________________________________________
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): 20191003080306.3514-1-pierre-eric.pelloux-prayer-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 03.10.19 um 10:03 schrieb Pelloux-prayer, Pierre-eric:

Quoted 2 lines

This can be safely skipped entirely.
This seems to help with https://bugs.freedesktop.org/show_bug.cgi?id=111481.

NAK, please instead fix gmc_v10_0_flush_gpu_tlb to include at least some NOP in the submitted IBs.

Christian.

Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -0
index 60655834d649..aa163e679f1f 100644
@@ -227,6 +227,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
  		    !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · line 237

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +5 -0
  			continue;
 
+		if (ib->length_dw == 0) {
+			/* On Navi gmc_v10_0_flush_gpu_tlb emits 0 sized IB */
+			continue;
+		}
+
  		amdgpu_ring_emit_ib(ring, job, ib, status);
  		status &= ~AMDGPU_HAVE_CTX_SWITCH;
  	}

_______________________________________________
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): 12e0b546-faaf-38c3-c0fc-1e713348b62e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw
Quoted 5 lines · Christian König

Am 03.10.19 um 10:03 schrieb Pelloux-prayer, Pierre-eric:

Quoted 2 lines

This can be safely skipped entirely.
This seems to help with https://bugs.freedesktop.org/show_bug.cgi?id=111481.

NAK, please instead fix gmc_v10_0_flush_gpu_tlb to include at least some NOP in the submitted IBs.

Is there any interest in executing an empty (or only filled with NOPs) IB?

Anyway I can modify the patch to do this.

Thanks,
Pierre-Eric

Quoted 9 lines

Christian.

Quoted 6 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +++++

  1 file changed, 5 insertions(+)
Quoted 16 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -0
index 60655834d649..aa163e679f1f 100644
@@ -227,6 +227,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,

              !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */ continue;

Quoted 8 lines

  +        if (ib->length_dw == 0) {
+            /* On Navi gmc_v10_0_flush_gpu_tlb emits 0 sized IB */ +            continue;
+        }
+
          amdgpu_ring_emit_ib(ring, job, ib, status); status &= ~AMDGPU_HAVE_CTX_SWITCH;
      }

_______________________________________________
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): a8d4871c-4b00-3a72-1cff-50878e1d8818-5C7GfCeVMHo@public.gmane.org

#6 lore raw

Does some variant of the patch on this thread help?
https://patchwork.freedesktop.org/patch/333068/

Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Pelloux-prayer, Pierre-eric <[email protected]>
Sent: Thursday, October 3, 2019 4:25 AM
To: Koenig, Christian <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: do not execute 0-sized IBs

Quoted 5 lines · Christian König

Am 03.10.19 um 10:03 schrieb Pelloux-prayer, Pierre-eric:

Quoted 2 lines

This can be safely skipped entirely.
This seems to help with https://bugs.freedesktop.org/show_bug.cgi?id=111481.

NAK, please instead fix gmc_v10_0_flush_gpu_tlb to include at least some NOP in the submitted IBs.

Is there any interest in executing an empty (or only filled with NOPs) IB?

Anyway I can modify the patch to do this.

Thanks,
Pierre-Eric

Quoted 9 lines

Christian.

Quoted 6 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +++++
  1 file changed, 5 insertions(+)
Quoted 16 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -0
index 60655834d649..aa163e679f1f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · line 236

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +4 -0
@@ -227,6 +227,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
              !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */
              continue;
  +        if (ib->length_dw == 0) {
+            /* On Navi gmc_v10_0_flush_gpu_tlb emits 0 sized IB */
+            continue;
+        }
+
          amdgpu_ring_emit_ib(ring, job, ib, status);
          status &= ~AMDGPU_HAVE_CTX_SWITCH;
      }

_______________________________________________
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): BN6PR12MB1809256856DE153A35FD7EF6F79F0-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#8 lore raw
Quoted 2 lines · Alexander

Does some variant of the patch on this thread help?
https://patchwork.freedesktop.org/patch/333068/

Hi Alex,

The added condition in this patch is:

   !(adev->asic_type >= CHIP_NAVI10 && adev->asic_type <= CHIP_NAVI12) ||

which will evaluate to "false ||" on Navi10 so I don't think it'll help.

I'll send an updated version of my patch that will only modify gmc_v10_0_flush_gpu_tlb to not send a 0-sized IB.

Thanks,
Pierre-Eric

Quoted 49 lines

Alex

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Pelloux-prayer, Pierre-eric <[email protected]> *Sent:* Thursday, October 3, 2019 4:25 AM
*To:* Koenig, Christian <[email protected]>; [email protected] <[email protected]> *Subject:* Re: [PATCH] drm/amdgpu: do not execute 0-sized IBs

Quoted 5 lines · Christian König

Am 03.10.19 um 10:03 schrieb Pelloux-prayer, Pierre-eric:

Quoted 2 lines

This can be safely skipped entirely.
This seems to help with https://bugs.freedesktop.org/show_bug.cgi?id=111481.

NAK, please instead fix gmc_v10_0_flush_gpu_tlb to include at least some NOP in the submitted IBs.

Is there any interest in executing an empty (or only filled with NOPs) IB?

Anyway I can modify the patch to do this.

Thanks,
Pierre-Eric

Quoted 9 lines

Christian.

Quoted 6 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +++++

  1 file changed, 5 insertions(+)
Quoted 16 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -0
index 60655834d649..aa163e679f1f 100644
@@ -227,6 +227,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,

              !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */ continue;

Quoted 8 lines

  +        if (ib->length_dw == 0) {
+            /* On Navi gmc_v10_0_flush_gpu_tlb emits 0 sized IB */ +            continue;
+        }
+
          amdgpu_ring_emit_ib(ring, job, ib, status); status &= ~AMDGPU_HAVE_CTX_SWITCH;
      }

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