Skip to contentSkip to conversation

drm/amdgpu: make compute timeouts consistent

PATCH In review Alex Deucher 3 participants 3 messages Jun 25, 2025 – Jul 15, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH v2 1/1 drm/amdgpu: make compute timeouts consistent

For kernel compute queues, align the timeout with other kernel queues (10 sec). This had previously been set higher for OpenCL when it used kernel queues, but now OpenCL uses KFD user queues which don't have a timeout limitation. This also aligns with SR-IOV which already used a shorter timeout.

Additionally the longer timeout negatively impacts the user experience with kernel queues for interactive applications.

---

V2: fix documentation as well

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 10 +++++-----
 2 files changed, 7 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -10
index c8a6b3689deae..58a0ee99eb2f8 100644
@@ -4171,18 +4171,10 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	int ret = 0;
 
 	/*
-	 * By default timeout for non compute jobs is 10000
-	 * and 60000 for compute jobs.
-	 * In SR-IOV or passthrough mode, timeout for compute
-	 * jobs are 60000 by default.
+	 * By default timeout for jobs is 10 sec
 	 */
-	adev->gfx_timeout = msecs_to_jiffies(10000);
+	adev->compute_timeout = adev->gfx_timeout = msecs_to_jiffies(10000);
 	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
-	if (amdgpu_sriov_vf(adev))
-		adev->compute_timeout = amdgpu_sriov_is_pp_one_vf(adev) ?
-					msecs_to_jiffies(60000) : msecs_to_jiffies(10000);
-	else
-		adev->compute_timeout =  msecs_to_jiffies(60000);
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) {
 		while ((timeout_setting = strsep(&input, ",")) &&
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -5
index 7e3fa76227033..7bc326d0b4000 100644
@@ -362,12 +362,12 @@ module_param_named(svm_default_granularity, amdgpu_svm_default_granularity, uint
  *   The second one is for Compute. The third and fourth ones are
  *   for SDMA and Video.
  *
- * By default(with no lockup_timeout settings), the timeout for all non-compute(GFX, SDMA and Video)
- * jobs is 10000. The timeout for compute is 60000.
+ * By default(with no lockup_timeout settings), the timeout for all jobs is 10000.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and 60000 for compute jobs; "
-		"for passthrough or sriov, 10000 for all jobs. 0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
-		"for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
+MODULE_PARM_DESC(lockup_timeout,
+		 "GPU lockup timeout in ms (default: 10000 for all jobs. "
+		 "0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
+		 "for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
 module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
 /**
Signature · 1 line
2.49.0
#1 lore raw

Ping?

Quoted 71 lines · Alex Deucher

For kernel compute queues, align the timeout with other kernel queues (10 sec). This had previously been set higher for OpenCL when it used kernel queues, but now OpenCL uses KFD user queues which don't have a timeout limitation. This also aligns with SR-IOV which already used a shorter timeout.

Additionally the longer timeout negatively impacts the user experience with kernel queues for interactive applications.

---

V2: fix documentation as well

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 10 +++++-----
 2 files changed, 7 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -10
index c8a6b3689deae..58a0ee99eb2f8 100644
@@ -4171,18 +4171,10 @@ static int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
        int ret = 0;
 
        /*
-        * By default timeout for non compute jobs is 10000
-        * and 60000 for compute jobs.
-        * In SR-IOV or passthrough mode, timeout for compute
-        * jobs are 60000 by default.
+        * By default timeout for jobs is 10 sec
         */
-       adev->gfx_timeout = msecs_to_jiffies(10000);
+       adev->compute_timeout = adev->gfx_timeout = msecs_to_jiffies(10000);
        adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
-       if (amdgpu_sriov_vf(adev))
-               adev->compute_timeout = amdgpu_sriov_is_pp_one_vf(adev) ?
-                                       msecs_to_jiffies(60000) : msecs_to_jiffies(10000);
-       else
-               adev->compute_timeout =  msecs_to_jiffies(60000);
 
        if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) {
                while ((timeout_setting = strsep(&input, ",")) &&
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -6
index 7e3fa76227033..7bc326d0b4000 100644
@@ -362,12 +362,12 @@ module_param_named(svm_default_granularity, amdgpu_svm_default_granularity, uint
  *   The second one is for Compute. The third and fourth ones are
  *   for SDMA and Video.
  *
- * By default(with no lockup_timeout settings), the timeout for all non-compute(GFX, SDMA and Video)
- * jobs is 10000. The timeout for compute is 60000.
+ * By default(with no lockup_timeout settings), the timeout for all jobs is 10000.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and 60000 for compute jobs; "
-               "for passthrough or sriov, 10000 for all jobs. 0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
-               "for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
+MODULE_PARM_DESC(lockup_timeout,
+                "GPU lockup timeout in ms (default: 10000 for all jobs. "
+                "0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
+                "for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
 module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 
 /**
--

2.49.0

Reviewed-by
#2 lore raw

[Public]

Quoted 93 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, July 15, 2025 9:45 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH V2] drm/amdgpu: make compute timeouts consistent

Ping?

Quoted 15 lines · Alex Deucher

For kernel compute queues, align the timeout with other kernel queues (10 sec). This had previously been set higher for OpenCL when it used kernel queues, but now OpenCL uses KFD user queues which don't have a timeout limitation. This also aligns with SR-IOV which already used a shorter timeout.

Additionally the longer timeout negatively impacts the user experience with kernel queues for interactive applications.

---

Review

Quoted 7 lines

V2: fix documentation as well

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++----------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 10 +++++-----
 2 files changed, 7 insertions(+), 15 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int

Quoted 4 lines

index c8a6b3689deae..58a0ee99eb2f8 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
@@ -4171,18 +4171,10 @@ static int

amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)

Review

Quoted 21 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -10
        int ret = 0;
 
        /*
-        * By default timeout for non compute jobs is 10000
-        * and 60000 for compute jobs.
-        * In SR-IOV or passthrough mode, timeout for compute
-        * jobs are 60000 by default.
+        * By default timeout for jobs is 10 sec
         */
-       adev->gfx_timeout = msecs_to_jiffies(10000);
+       adev->compute_timeout = adev->gfx_timeout = msecs_to_jiffies(10000);
        adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
-       if (amdgpu_sriov_vf(adev))
-               adev->compute_timeout = amdgpu_sriov_is_pp_one_vf(adev) ?
-                                       msecs_to_jiffies(60000) : msecs_to_jiffies(10000);
-       else
-               adev->compute_timeout =  msecs_to_jiffies(60000);
 
        if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENGTH)) {
                while ((timeout_setting = strsep(&input, ",")) &&
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(svm_default_granularity,

Quoted 4 lines

index 7e3fa76227033..7bc326d0b4000 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
@@ -362,12 +362,12 @@ module_param_named(svm_default_granularity,

amdgpu_svm_default_granularity, uint

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(svm_default_granularity, amdgpu_svm_default_granularity, uint

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
  *   The second one is for Compute. The third and fourth ones are
  *   for SDMA and Video.
  *
- * By default(with no lockup_timeout settings), the timeout for all non-

compute(GFX, SDMA and Video)

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(svm_default_granularity, amdgpu_svm_default_granularity, uint

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -2
- * jobs is 10000. The timeout for compute is 60000.
+ * By default(with no lockup_timeout settings), the timeout for all jobs is 10000.
  */
-MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for

bare metal 10000 for non-compute jobs and 60000 for compute jobs; "

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(svm_default_granularity, · line 369

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
-               "for passthrough or sriov, 10000 for all jobs. 0: keep default value.

negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(svm_default_granularity, amdgpu_svm_default_granularity, uint

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -1
-               "for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
+MODULE_PARM_DESC(lockup_timeout,
+                "GPU lockup timeout in ms (default: 10000 for all jobs. "
+                "0: keep default value. negative: infinity timeout), format: for bare metal

[Non-Compute] or [GFX,Compute,SDMA,Video]; "

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c module_param_named(svm_default_granularity, · line 371

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
+                "for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
 module_param_string(lockup_timeout, amdgpu_lockup_timeout,

sizeof(amdgpu_lockup_timeout), 0444);

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
 /**
--

2.49.0