* [PATCH i-g-t v1] test/intel/xe_vm: Add multi-GPU VRAM overcommit test
@ 2026-09-24 18:37 Sobin Thomas
0 siblings, 0 replies; only message in thread
From: Sobin Thomas @ 2026-09-24 18:37 UTC (permalink / raw)
To: igt-dev; +Cc: kamil.konieczny, Sobin Thomas
Extend the VRAM overcommit test to cover all available Xe GPUs
independently. Run each existing overcommit scenarios on every
physical GPU and use the VRAM capacity of the respective GPU
when calculating the overcommit size.
Signed-off-by: Sobin Thomas <sobin.thomas@intel.com>
---
tests/intel/xe_vm.c | 56 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index 545350894..6588baa75 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -22,6 +22,11 @@
#include <string.h>
#define USER_FENCE_VALUE 0xdeadbeefdeadbeefull
+struct overcommit_gpu {
+ int fd;
+ struct drm_xe_engine_class_instance *hwe_non_copy;
+};
+
enum overcommit_stage {
EXPECT_NONE,
EXPECT_CREATE,
@@ -35,6 +40,40 @@ addr_low(uint64_t addr)
return addr;
}
+/* Get the number of the GPUs */
+static int get_overcommit_gpus(struct overcommit_gpu **gpus)
+{
+ struct overcommit_gpu *tmp = NULL;
+ int num_gpus = 0, i;
+
+ for (i = 0; ; i++) {
+ int gpu_fd;
+ struct drm_xe_engine *engine;
+ struct drm_xe_engine_class_instance *eci;
+
+ gpu_fd = __drm_open_driver_another(i, DRIVER_XE);
+ if (gpu_fd < 0)
+ break;
+ if (!xe_has_vram(gpu_fd) || !xe_visible_vram_size(gpu_fd, 0)) {
+ drm_close_driver(gpu_fd);
+ continue;
+ }
+ engine = xe_engine(gpu_fd, 0);
+ if (!engine) {
+ drm_close_driver(gpu_fd);
+ continue;
+ }
+ eci = &engine->instance;
+ tmp = realloc(tmp, (num_gpus + 1) * sizeof(*tmp));
+ igt_assert(tmp);
+ tmp[num_gpus].fd = gpu_fd;
+ tmp[num_gpus].hwe_non_copy = eci;
+ num_gpus++;
+ }
+ *gpus = tmp;
+ return num_gpus;
+}
+
static uint32_t
addr_high(int fd, uint64_t addr)
{
@@ -3539,6 +3578,23 @@ int igt_main()
}
}
+ igt_subtest("overcommit-multigpu") {
+ struct overcommit_gpu *gpus = NULL;
+ int num_gpus = get_overcommit_gpus(&gpus);
+
+ for (int i = 0; i < num_gpus; i++) {
+ for (int j = 0; overcommit_cases[j].name; j++) {
+ const struct vm_overcommit_case *c = &overcommit_cases[j];
+
+ test_vm_overcommit(gpus[i].fd, gpus[i].hwe_non_copy, c,
+ igt_get_avail_ram_mb() << 20,
+ xe_visible_vram_size(gpus[i].fd, 0));
+ }
+ drm_close_driver(gpus[i].fd);
+ }
+ free(gpus);
+ }
+
igt_fixture()
drm_close_driver(fd);
}
--
2.52.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-24 18:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 18:37 [PATCH i-g-t v1] test/intel/xe_vm: Add multi-GPU VRAM overcommit test Sobin Thomas
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.