All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simona Vetter <simona.vetter@ffwll.ch>
To: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: "Simona Vetter" <simona.vetter@ffwll.ch>,
	"Boris Brezillon" <boris.brezillon@collabora.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Steven Price" <steven.price@arm.com>,
	"Liviu Dudau" <liviu.dudau@arm.com>,
	"Adrián Larumbe" <adrian.larumbe@collabora.com>,
	lima@lists.freedesktop.org, "Qiang Yu" <yuq825@gmail.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org,
	"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
	kernel@collabora.com,
	"Faith Ekstrand" <faith.ekstrand@collabora.com>
Subject: Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem
Date: Fri, 11 Apr 2025 20:16:47 +0200	[thread overview]
Message-ID: <Z_lcj9pgunJFuj_4@phenom.ffwll.local> (raw)
In-Reply-To: <Z_kenr95QUq9rFpt@blossom>

On Fri, Apr 11, 2025 at 09:52:30AM -0400, Alyssa Rosenzweig wrote:
> > 2. Device Lost
> > --------------
> > 
> > At this point we're left with no other choice than to kill the context.
> > And userspace should be able to cope with VK_DEVICE_LOST (hopefully zink
> > does), but it will probably not cope well with an entire strom of these
> > just to get the first frame out.
> > 
> > Here comes the horrible trick:
> > 
> > We'll keep rendering the entire frame by just smashing one single reserve
> > page (per context) into the pte every time there's a fault. It will result
> > in total garbage, and we probably want to shot the context the moment the
> > VS stages have finished, but it allows us to collect an accurate estimate
> > of how much memory we'd have needed. We need to pass that to the vulkan
> > driver as part of the device lost processing, so that it can keep that as
> > the starting point for the userspace dynamic memory requirement
> > guesstimate as a lower bound. Together with the (scaled to that
> > requirement) gpu driver memory pool and the core mm watermarks, that
> > should allow us to not hit a device lost again hopefully.
> 
> This doesn't work if vertex stages are allowed to have side effects
> (which is required for adult-level APIs and can effectively get hit with
> streamout on panfrost). Once you have anything involving side effects,
> you can't replay work, there's no way to cope with that. No magic Zink
> can do either.

Yeah no attempts at reply, it's just standard gl error handling. So either
tossing the context and reporting that through arb_robustness. Or tossing
the context, "transparently" creating a new one and a mix of recreating
some internal driver objects and thoughts&prayers to give the new context
the best chances possible.

You really want all the tricks in step 1 and the quirks in 3 to make sure
this doesn't ever happen. Or at most once per app, hopefully.

I promised terrible after all :-P

Cheers, Sima
-- 
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2025-04-11 18:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04  9:26 [PATCH v3 0/8] drm: Introduce sparse GEM shmem Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 1/8] drm/gem: Add helpers to request a range of pages on a GEM Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 2/8] drm/gem-shmem: Support sparse backing Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 3/8] drm/panfrost: Switch to sparse gem shmem to implement our alloc-on-fault Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 4/8] drm/panthor: Add support for alloc-on-fault buffers Boris Brezillon
2025-04-04 12:17   ` Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 5/8] drm/panthor: Allow kernel BOs to pass DRM_PANTHOR_BO_ALLOC_ON_FAULT Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 6/8] drm/panthor: Add a panthor_vm_pre_fault_range() helper Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 7/8] drm/panthor: Make heap chunk allocation non-blocking Boris Brezillon
2025-04-04  9:26 ` [PATCH v3 8/8] drm/lima: Use drm_gem_shmem_sparse_backing for heap buffers Boris Brezillon
2025-04-10 14:48 ` [PATCH v3 0/8] drm: Introduce sparse GEM shmem Boris Brezillon
2025-04-10 15:05   ` Christian König
2025-04-10 15:53     ` Boris Brezillon
2025-04-10 16:43       ` Christian König
2025-04-10 17:20         ` Boris Brezillon
2025-04-10 18:01           ` Alyssa Rosenzweig
2025-04-10 18:41             ` Boris Brezillon
2025-04-11  8:04               ` Christian König
2025-04-11  8:38                 ` Boris Brezillon
2025-04-11 10:55                   ` Christian König
2025-04-11 12:02                     ` Boris Brezillon
2025-04-11 12:45                       ` Christian König
2025-04-11 13:00                         ` Boris Brezillon
2025-04-11 13:13                           ` Christian König
2025-04-11 14:39                             ` Boris Brezillon
2025-04-14 12:47                               ` Boris Brezillon
2025-04-14 15:34                                 ` Steven Price
2025-04-15  9:47                                   ` Boris Brezillon
2025-04-16 15:16                                     ` Steven Price
2025-04-16 15:53                                       ` Boris Brezillon
2025-04-15 12:39                                   ` Daniel Stone
2025-04-11 18:24                     ` Simona Vetter
2025-04-11 12:01               ` Simona Vetter
2025-04-11 12:50                 ` Christian König
2025-04-11 18:18                   ` Simona Vetter
2025-04-11 13:52                 ` Alyssa Rosenzweig
2025-04-11 18:16                   ` Simona Vetter [this message]
2025-04-14 11:22                 ` Boris Brezillon
2025-04-14 13:03                   ` Alyssa Rosenzweig
2025-04-14 13:31                     ` Boris Brezillon
2025-04-14 13:42                       ` Alyssa Rosenzweig
2025-04-14 13:08                   ` Liviu Dudau
2025-04-14 14:34                     ` Simona Vetter
2025-04-14 15:15                       ` Boris Brezillon
2025-04-14 14:46                   ` Simona Vetter
2025-04-10 18:52           ` Christian König
2025-04-11  8:08             ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_lcj9pgunJFuj_4@phenom.ffwll.local \
    --to=simona.vetter@ffwll.ch \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=alyssa@rosenzweig.io \
    --cc=boris.brezillon@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=faith.ekstrand@collabora.com \
    --cc=kernel@collabora.com \
    --cc=lima@lists.freedesktop.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    --cc=yuq825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.