From: Francois Dugast <francois.dugast@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 2/2] tests/xe_compute_preempt: add compute preempt on vram bos
Date: Thu, 5 Jun 2025 14:33:26 +0200 [thread overview]
Message-ID: <aEGOlgaEpixCuIjB@fdugast-desk> (raw)
In-Reply-To: <20250604115024.117036-6-zbigniew.kempczynski@intel.com>
On Wed, Jun 04, 2025 at 01:50:27PM +0200, Zbigniew Kempczyński wrote:
> Add 'vram' and 'vram-evict' subtests which exercise preemption
> scenarios on objects allocated in vram. First subtest uses half
> of vram whereas second one allocates more than available vram
> causing eviction.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Francois Dugast <francois.dugast@intel.com>
> ---
> tests/intel/xe_compute_preempt.c | 86 ++++++++++++++++++++++++++++----
> 1 file changed, 76 insertions(+), 10 deletions(-)
>
> diff --git a/tests/intel/xe_compute_preempt.c b/tests/intel/xe_compute_preempt.c
> index 3a3d7847ca..d4b6198a65 100644
> --- a/tests/intel/xe_compute_preempt.c
> +++ b/tests/intel/xe_compute_preempt.c
> @@ -35,16 +35,27 @@
> * Exercise multiple walker mid thread preemption scenario consuming
> * whole ram only when there's swap on the machine
> *
> + * SUBTEST: compute-preempt-many-vram
> + * GPU requirement: LNL, PTL
> + * Description:
> + * Exercise multiple walker mid thread preemption scenario on half of vram
> + *
> + * SUBTEST: compute-preempt-many-vram-evict
> + * GPU requirement: LNL, PTL
> + * Description:
> + * Exercise multiple walker mid thread preemption scenario on 120% of vram size
> + *
> * SUBTEST: compute-threadgroup-preempt
> * GPU requirement: LNL, PTL
> * Description:
> * Exercise compute walker threadgroup preemption scenario
> */
> static void
> -test_compute_preempt(int fd, struct drm_xe_engine_class_instance *hwe, bool threadgroup_preemption)
> +test_compute_preempt(int fd, struct drm_xe_engine_class_instance *hwe, bool threadgroup_preemption,
> + enum execenv_alloc_prefs alloc_prefs)
> {
> igt_require_f(run_intel_compute_kernel_preempt(fd, hwe, threadgroup_preemption,
> - EXECENV_PREF_SYSTEM),
> + alloc_prefs),
> "GPU not supported\n");
> }
>
> @@ -54,12 +65,13 @@ igt_main
> {
> int xe;
> struct drm_xe_engine_class_instance *hwe;
> - uint64_t ram_mb, swap_mb;
> + uint64_t ram_mb, swap_mb, vram_mb;
>
> igt_fixture {
> xe = drm_open_driver(DRIVER_XE);
> ram_mb = igt_get_avail_ram_mb();
> swap_mb = igt_get_total_swap_mb();
> + vram_mb = xe_visible_vram_size(xe, 0) >> 20;
> }
>
> igt_subtest_with_dynamic("compute-preempt") {
> @@ -68,7 +80,7 @@ igt_main
> continue;
>
> igt_dynamic_f("engine-%s", xe_engine_class_string(hwe->engine_class))
> - test_compute_preempt(xe, hwe, false);
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_SYSTEM);
> }
> }
>
> @@ -81,7 +93,7 @@ igt_main
> int child_count;
>
> /*
> - * Get half of ram / 2, then divide by
> + * Get half of ram, then divide by
> * CONTEXT_MB * 2 (long and short) job
> */
> child_count = ram_mb / 2 / CONTEXT_MB / 2;
> @@ -89,9 +101,9 @@ igt_main
> igt_debug("RAM: %zd, child count: %d\n",
> ram_mb, child_count);
>
> - test_compute_preempt(xe, hwe, false);
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_SYSTEM);
> igt_fork(child, child_count)
> - test_compute_preempt(xe, hwe, false);
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_SYSTEM);
> igt_waitchildren();
> }
> }
> @@ -116,9 +128,63 @@ igt_main
> igt_debug("RAM: %zd, child count: %d\n",
> ram_mb, child_count);
>
> - test_compute_preempt(xe, hwe, false);
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_SYSTEM);
> igt_fork(child, child_count)
> - test_compute_preempt(xe, hwe, false);
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_SYSTEM);
> + igt_waitchildren();
> + }
> + }
> + }
> +
> + igt_subtest_with_dynamic("compute-preempt-many-vram") {
> + igt_require(xe_has_vram(xe));
> +
> + xe_for_each_engine(xe, hwe) {
> + if (hwe->engine_class != DRM_XE_ENGINE_CLASS_COMPUTE)
> + continue;
> +
> + igt_dynamic_f("engine-%s", xe_engine_class_string(hwe->engine_class)) {
> + int child_count;
> +
> + /*
> + * Get half of vram, then divide by
> + * CONTEXT_MB * 2 (long and short) job
> + */
> + child_count = vram_mb / 2 / CONTEXT_MB / 2;
> +
> + igt_debug("VRAM: %zd, child count: %d\n",
> + vram_mb, child_count);
> +
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_VRAM);
> + igt_fork(child, child_count)
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_VRAM);
> + igt_waitchildren();
> + }
> + }
> + }
> +
> + igt_subtest_with_dynamic("compute-preempt-many-vram-evict") {
> + igt_require(xe_has_vram(xe));
> +
> + xe_for_each_engine(xe, hwe) {
> + if (hwe->engine_class != DRM_XE_ENGINE_CLASS_COMPUTE)
> + continue;
> +
> + igt_dynamic_f("engine-%s", xe_engine_class_string(hwe->engine_class)) {
> + int child_count;
> +
> + /*
> + * Get all vram + 20%, then divide by
> + * CONTEXT_MB * 2 (long and short) job
> + */
> + child_count = vram_mb * 1.2 / 2 / CONTEXT_MB;
> +
> + igt_info("VRAM: %zd, child count: %d\n",
> + vram_mb, child_count);
> +
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_VRAM);
> + igt_fork(child, child_count)
> + test_compute_preempt(xe, hwe, false, EXECENV_PREF_VRAM);
> igt_waitchildren();
> }
> }
> @@ -130,7 +196,7 @@ igt_main
> continue;
>
> igt_dynamic_f("engine-%s", xe_engine_class_string(hwe->engine_class))
> - test_compute_preempt(xe, hwe, true);
> + test_compute_preempt(xe, hwe, true, EXECENV_PREF_SYSTEM);
> }
> }
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2025-06-05 12:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 11:50 [PATCH i-g-t 0/2] Control compute-preempt bo allocation Zbigniew Kempczyński
2025-06-04 11:50 ` [PATCH i-g-t 1/2] lib/intel_compute: add alloc preference for objects used in compute Zbigniew Kempczyński
2025-06-05 12:24 ` Francois Dugast
2025-06-04 11:50 ` [PATCH i-g-t 2/2] tests/xe_compute_preempt: add compute preempt on vram bos Zbigniew Kempczyński
2025-06-05 12:33 ` Francois Dugast [this message]
2025-06-04 13:01 ` ✓ i915.CI.BAT: success for Control compute-preempt bo allocation Patchwork
2025-06-04 13:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-04 15:12 ` ✓ i915.CI.Full: " Patchwork
2025-06-05 7:00 ` ✓ Xe.CI.Full: " Patchwork
2025-06-05 8:38 ` Zbigniew Kempczyński
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=aEGOlgaEpixCuIjB@fdugast-desk \
--to=francois.dugast@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=zbigniew.kempczynski@intel.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.