linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gvt: print actionable error message when gm runs out
@ 2020-06-03 12:33 Julian Stecklina
  2020-06-05  4:54 ` Zhenyu Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Stecklina @ 2020-06-03 12:33 UTC (permalink / raw)
  To: intel-gvt-dev
  Cc: dri-devel, linux-kernel, Julian Stecklina, Thomas Prescher, Zhenyu Wang

When a user tries to allocate too many or too big vGPUs and runs out
of graphics memory, the resulting error message is not actionable and
looks like an internal error.

Change the error message to clearly point out what actions a user can
take to resolve this situation.

Cc: Thomas Prescher <thomas.prescher@cyberus-technology.de>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
---
 drivers/gpu/drm/i915/gvt/aperture_gm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/aperture_gm.c b/drivers/gpu/drm/i915/gvt/aperture_gm.c
index 0d6d598713082..5c5c8e871dae2 100644
--- a/drivers/gpu/drm/i915/gvt/aperture_gm.c
+++ b/drivers/gpu/drm/i915/gvt/aperture_gm.c
@@ -69,9 +69,12 @@ static int alloc_gm(struct intel_vgpu *vgpu, bool high_gm)
 				  start, end, flags);
 	mmio_hw_access_post(gt);
 	mutex_unlock(&gt->ggtt->vm.mutex);
-	if (ret)
-		gvt_err("fail to alloc %s gm space from host\n",
-			high_gm ? "high" : "low");
+	if (ret) {
+		gvt_err("vgpu%d: failed to allocate %s gm space from host\n",
+			vgpu->id, high_gm ? "high" : "low");
+		gvt_err("vgpu%d: destroying vGPUs, decreasing vGPU memory size or increasing GPU aperture size may resolve this\n",
+			vgpu->id);
+	}
 
 	return ret;
 }
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915/gvt: print actionable error message when gm runs out
  2020-06-03 12:33 [PATCH] drm/i915/gvt: print actionable error message when gm runs out Julian Stecklina
@ 2020-06-05  4:54 ` Zhenyu Wang
  2020-06-05 11:08   ` Julian Stecklina
  0 siblings, 1 reply; 3+ messages in thread
From: Zhenyu Wang @ 2020-06-05  4:54 UTC (permalink / raw)
  To: Julian Stecklina; +Cc: intel-gvt-dev, Thomas Prescher, linux-kernel, dri-devel

[-- Attachment #1: Type: text/plain, Size: 2069 bytes --]

On 2020.06.03 14:33:21 +0200, Julian Stecklina wrote:
> When a user tries to allocate too many or too big vGPUs and runs out
> of graphics memory, the resulting error message is not actionable and
> looks like an internal error.
> 
> Change the error message to clearly point out what actions a user can
> take to resolve this situation.
> 
> Cc: Thomas Prescher <thomas.prescher@cyberus-technology.de>
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
> ---
>  drivers/gpu/drm/i915/gvt/aperture_gm.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/aperture_gm.c b/drivers/gpu/drm/i915/gvt/aperture_gm.c
> index 0d6d598713082..5c5c8e871dae2 100644
> --- a/drivers/gpu/drm/i915/gvt/aperture_gm.c
> +++ b/drivers/gpu/drm/i915/gvt/aperture_gm.c
> @@ -69,9 +69,12 @@ static int alloc_gm(struct intel_vgpu *vgpu, bool high_gm)
>  				  start, end, flags);
>  	mmio_hw_access_post(gt);
>  	mutex_unlock(&gt->ggtt->vm.mutex);
> -	if (ret)
> -		gvt_err("fail to alloc %s gm space from host\n",
> -			high_gm ? "high" : "low");
> +	if (ret) {
> +		gvt_err("vgpu%d: failed to allocate %s gm space from host\n",
> +			vgpu->id, high_gm ? "high" : "low");
> +		gvt_err("vgpu%d: destroying vGPUs, decreasing vGPU memory size or increasing GPU aperture size may resolve this\n",
> +			vgpu->id);

Currently we can't decrease vGPU mem size as defined by mdev type,
so actually you may try different vGPU type. And aperture size is
also handled for supported vGPU mdev types, so assume user should
already be awared of that too. I just don't want us to be too chatty. :)

> +	}
>  
>  	return ret;
>  }
> -- 
> 2.26.2
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915/gvt: print actionable error message when gm runs out
  2020-06-05  4:54 ` Zhenyu Wang
@ 2020-06-05 11:08   ` Julian Stecklina
  0 siblings, 0 replies; 3+ messages in thread
From: Julian Stecklina @ 2020-06-05 11:08 UTC (permalink / raw)
  To: Zhenyu Wang; +Cc: intel-gvt-dev, Thomas Prescher, linux-kernel, dri-devel

On Fri, 2020-06-05 at 12:54 +0800, Zhenyu Wang wrote:
> On 2020.06.03 14:33:21 +0200, Julian Stecklina wrote:
> > +		gvt_err("vgpu%d: failed to allocate %s gm space from host\n",
> > +			vgpu->id, high_gm ? "high" : "low");
> > +		gvt_err("vgpu%d: destroying vGPUs, decreasing vGPU memory size
> > or increasing GPU aperture size may resolve this\n",
> > +			vgpu->id);
> 
> Currently we can't decrease vGPU mem size as defined by mdev type,
> so actually you may try different vGPU type.

Yes, that's what I meant.

>  And aperture size is
> also handled for supported vGPU mdev types, so assume user should
> already be awared of that too. I just don't want us to be too chatty. :)

Our users typically hit this particular error message when they haven't
configured the GPU aperture size in the system BIOS correctly. Many laptops we
see have the aperture set to 256MB and this is simply not enough.

I don't cling to the specific wording of the error message, but any hint in the
error message that this is not an obscure, internal error or bug, but something
that the user can actually fix, would be helpful.

Julian


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-05 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 12:33 [PATCH] drm/i915/gvt: print actionable error message when gm runs out Julian Stecklina
2020-06-05  4:54 ` Zhenyu Wang
2020-06-05 11:08   ` Julian Stecklina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).