Skip to contentSkip to conversation

drm/amdgpu: no job timeout setting on compute queues

PATCH In review Evan Quan 4 participants 10 messages Mar 16, 2018 – Mar 27, 2018 8 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: no job timeout setting on compute queues

Under some heavy computing test(dgemm) environment, it may takes the asic over 50+ seconds to finish the dispatched single job which will trigger the timeout. It's quite annoying although it does not seem to bring any real problems.
As a quick workround, we choose to not enfoce the timeout setting on compute queues.

Change-Id I210011a90898617367e897a90e9f8fb2639281a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -1
index 008e198..455a81e 100644
@@ -435,7 +435,9 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
 		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
 				   num_hw_submission, amdgpu_job_hang_limit,
-				   msecs_to_jiffies(amdgpu_lockup_timeout), ring->name);
+				   (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
+				   MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),
+				   ring->name);
 		if (r) {
 			DRM_ERROR("Failed to create scheduler on ring %s.\n",
 				  ring->name);
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): 1521175952-21758-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Alex

________________________________
From: Evan Quan <[email protected]>
Sent: Friday, March 16, 2018 12:52:32 AM
To: [email protected]
Cc: Deucher, Alexander; Quan, Evan
Subject: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Under some heavy computing test(dgemm) environment, it may takes the asic over 50+ seconds to finish the dispatched single job which will trigger the timeout. It's quite annoying although it does not seem to bring any real problems.
As a quick workround, we choose to not enfoce the timeout setting on compute queues.

Change-Id I210011a90898617367e897a90e9f8fb2639281a3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +3 -1
index 008e198..455a81e 100644
@@ -435,7 +435,9 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
         if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
                 r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
                                    num_hw_submission, amdgpu_job_hang_limit,
-                                  msecs_to_jiffies(amdgpu_lockup_timeout), ring->name);
+                                  (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
+                                  MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),
+                                  ring->name);
                 if (r) {
                         DRM_ERROR("Failed to create scheduler on ring %s.\n",
                                   ring->name);

--
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): CY4PR12MB1653E72F547ABAECAC0A91A3F7D70-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw
Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): bc7b30b9-7230-fdfe-4fd1-0f4dcd26a38d-otUistvHUpPR7s880joybQ@public.gmane.org

#6 lore raw

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________
From: Michel Dänzer <[email protected]>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

_______________________________________________
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): CY4PR12MB16535036642155291C39F030F7D70-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author
#8 lore raw

That's fine for me. Will update the patch accordingly.

Regards,
Evan
From: Deucher, Alexander
Sent: Saturday, March 17, 2018 1:17 AM
To: Michel Dänzer <[email protected]>; Quan, Evan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________
From: Michel Dänzer <[email protected]<mailto:[email protected]>>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

_______________________________________________
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): DM5PR1201MB2489E0DEA55F61E4314CE1EEE4D40-grEf7a3NxMAAZHT/xKzwlGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]

#10 lore raw

Please don’t do it for SR-IOV

/Monk

From: amd-gfx [mailto:[email protected]] On Behalf Of Quan, Evan
Sent: 2018年3月19日 9:47
To: Deucher, Alexander <[email protected]>; Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That’s fine for me. Will update the patch accordingly.

Regards,
Evan
From: Deucher, Alexander
Sent: Saturday, March 17, 2018 1:17 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Quan, Evan <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________
From: Michel Dänzer <[email protected]<mailto:[email protected]>>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

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

#11 lore raw
In reply to a message not in the archive

Besides, if some compute shader takes time more them 50 seconds, you can just set lockuptime out to 50s Why change the logic in kmd side ?

I don’t think it’s a good idea to disable the time out message for compute ring, we have virtualization end-user Still want those message printed out

Can you do this way ?
In amdgpu_job_timeout, you can use DRM_WARN to replace DRM_ERROR for the job belongs to CPC engine ?

/Monk

From: amd-gfx [mailto:[email protected]] On Behalf Of Quan, Evan
Sent: 2018年3月19日 9:47
To: Deucher, Alexander <[email protected]>; Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That’s fine for me. Will update the patch accordingly.

Regards,
Evan
From: Deucher, Alexander
Sent: Saturday, March 17, 2018 1:17 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Quan, Evan <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________
From: Michel Dänzer <[email protected]<mailto:[email protected]>>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

_______________________________________________
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): BLUPR12MB0449F32EA2C9877B7C0BCA2984AD0-7LeqcoF/[email protected]

#13 lore raw

That's fine with me too. Or make them DRM_INFO.

Alex

________________________________
From: Liu, Monk
Sent: Monday, March 26, 2018 8:55:51 AM
To: Quan, Evan; Deucher, Alexander; Michel Dänzer
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Besides, if some compute shader takes time more them 50 seconds, you can just set lockuptime out to 50s

Why change the logic in kmd side ?

I don’t think it’s a good idea to disable the time out message for compute ring, we have virtualization end-user

Still want those message printed out

Can you do this way ?

In amdgpu_job_timeout, you can use DRM_WARN to replace DRM_ERROR for the job belongs to CPC engine ?

/Monk

From: amd-gfx [mailto:[email protected]] On Behalf Of Quan, Evan
Sent: 2018年3月19日 9:47
To: Deucher, Alexander <[email protected]>; Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That’s fine for me. Will update the patch accordingly.

Regards,

Evan

From: Deucher, Alexander
Sent: Saturday, March 17, 2018 1:17 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Quan, Evan <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________

From: Michel Dänzer <[email protected]<mailto:[email protected]>>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

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

author
#15 lore raw

Hi Monk,

That’s a fix reached after a long discussion(I believe you were in that mail thread). 50s is for the dgemm test. We are not sure whether it’s enough for other compute use case. If virtualization still needs these messages, I believe we can list that as an exception

-                                  (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
+                                  /* for non-sriov case, no timeout enforce on compute ring */
+                                  ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && !amdgpu_sriov_vf(ring->adev)) ?

Regards,
Evan
From: Deucher, Alexander
Sent: Monday, March 26, 2018 11:20 PM
To: Liu, Monk <[email protected]>; Quan, Evan <[email protected]>; Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That's fine with me too. Or make them DRM_INFO.

Alex

________________________________
From: Liu, Monk
Sent: Monday, March 26, 2018 8:55:51 AM
To: Quan, Evan; Deucher, Alexander; Michel Dänzer
Cc: [email protected]<mailto:[email protected]>
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Besides, if some compute shader takes time more them 50 seconds, you can just set lockuptime out to 50s

Why change the logic in kmd side ?

I don’t think it’s a good idea to disable the time out message for compute ring, we have virtualization end-user

Still want those message printed out

Can you do this way ?

In amdgpu_job_timeout, you can use DRM_WARN to replace DRM_ERROR for the job belongs to CPC engine ?

/Monk

From: amd-gfx [mailto:[email protected]] On Behalf Of Quan, Evan
Sent: 2018年3月19日 9:47
To: Deucher, Alexander <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That’s fine for me. Will update the patch accordingly.

Regards,

Evan

From: Deucher, Alexander
Sent: Saturday, March 17, 2018 1:17 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Quan, Evan <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________

From: Michel Dänzer <[email protected]<mailto:[email protected]>>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

_______________________________________________
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): DM5PR1201MB248935C8971B1D451391F294E4AC0-grEf7a3NxMAAZHT/xKzwlGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]

#17 lore raw

Ok, fine by me

/Monk
From: Quan, Evan
Sent: 2018年3月27日 9:34
To: Deucher, Alexander <[email protected]>; Liu, Monk <[email protected]>; Michel Dänzer <[email protected]>
Cc: [email protected]; Koenig, Christian <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Hi Monk,

That’s a fix reached after a long discussion(I believe you were in that mail thread). 50s is for the dgemm test. We are not sure whether it’s enough for other compute use case. If virtualization still needs these messages, I believe we can list that as an exception

-                                  (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
+                                  /* for non-sriov case, no timeout enforce on compute ring */
+                                  ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && !amdgpu_sriov_vf(ring->adev)) ?

Regards,
Evan
From: Deucher, Alexander
Sent: Monday, March 26, 2018 11:20 PM
To: Liu, Monk <[email protected]<mailto:[email protected]>>; Quan, Evan <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That's fine with me too. Or make them DRM_INFO.

Alex

________________________________
From: Liu, Monk
Sent: Monday, March 26, 2018 8:55:51 AM
To: Quan, Evan; Deucher, Alexander; Michel Dänzer
Cc: [email protected]<mailto:[email protected]>
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Besides, if some compute shader takes time more them 50 seconds, you can just set lockuptime out to 50s

Why change the logic in kmd side ?

I don’t think it’s a good idea to disable the time out message for compute ring, we have virtualization end-user

Still want those message printed out

Can you do this way ?

In amdgpu_job_timeout, you can use DRM_WARN to replace DRM_ERROR for the job belongs to CPC engine ?

/Monk

From: amd-gfx [mailto:[email protected]] On Behalf Of Quan, Evan
Sent: 2018年3月19日 9:47
To: Deucher, Alexander <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: RE: [PATCH] drm/amdgpu: no job timeout setting on compute queues

That’s fine for me. Will update the patch accordingly.

Regards,

Evan

From: Deucher, Alexander
Sent: Saturday, March 17, 2018 1:17 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Quan, Evan <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

How about something like this:

/* Disable timeout when GPU reset is disabled to avoid confusing timeout messages in the kernel log */

If (amdgpu_gpu_recovery == 0 || amdgpu_gpu_recovery == -1)

    amdgpu_lockup_timeout = MAX_SCHEDULE_TIMEOUT;

Alex

________________________________

From: Michel Dänzer <[email protected]<mailto:[email protected]>>
Sent: Friday, March 16, 2018 12:25:03 PM
To: Deucher, Alexander; Quan, Evan
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: no job timeout setting on compute queues

Quoted 3 lines · Alexander

Since GPU reset is not enabled yet anyway, a timeout will just print a message, can we just change amdgpu_lockup_timeout to MAX_SCHEDULE_TIMEOUT until we enable GPU reset?

Wouldn't that be rather surprising for somebody who sets amdgpu.gpu_recovery=1 ?

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

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