Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/2] drmtest changes for running tests on multi-gpu
@ 2023-09-27  9:55 Kamil Konieczny
  2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 1/2] lib/drmtest: allow out of order device opening Kamil Konieczny
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kamil Konieczny @ 2023-09-27  9:55 UTC (permalink / raw)
  To: igt-dev

Allow to open other cards out of order with __drm_open_driver_another()
and also introduce helper for multi-gpu scenarios. There is still a problem
left when opening first device because it is useally already opened at
first fixture but I will leave that for later. With that it works
on four GPUs board, when first card is non-Intel one with no render
device:

sudo IGT_DEVICE=pci:vendor=Intel,device=discrete,card=all build/tests/xe_create --r multigpu-create-massive-size

Opened device: /dev/dri/card1
Starting subtest: multigpu-create-massive-size
<g:1> Opened device: /dev/dri/card2
<g:2> Opened device: /dev/dri/card3
<g:3> Opened device: /dev/dri/card4
Subtest multigpu-create-massive-size: SUCCESS (0.209s)

v3: fixes in test (Zbigniew)
  fixes in drmlib functions (Zbigniew, Kamil)

Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Kamil Konieczny (2):
  lib/drmtest: allow out of order device opening
  tests/intel/xe_create: extend massive subtest to multi-gpu

 lib/drmtest.c           | 26 ++++++++++++++++++++------
 tests/intel/xe_create.c | 25 +++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 6 deletions(-)

-- 
2.42.0

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

* [igt-dev] [PATCH i-g-t v3 1/2] lib/drmtest: allow out of order device opening
  2023-09-27  9:55 [igt-dev] [PATCH i-g-t 0/2] drmtest changes for running tests on multi-gpu Kamil Konieczny
@ 2023-09-27  9:55 ` Kamil Konieczny
  2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 2/2] tests/intel/xe_create: extend massive subtest to multi-gpu Kamil Konieczny
  2023-09-27 10:00 ` [igt-dev] ✗ Fi.CI.BUILD: failure for drmtest changes for running tests on multi-gpu (rev2) Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Kamil Konieczny @ 2023-09-27  9:55 UTC (permalink / raw)
  To: igt-dev

Allow to open cards with filters out of order, not in
the sequence 0...N. This will fix problem found out with test
gem_exec_gttfill@multigpu-basic with three discrete GPUs:

Opened device: /dev/dri/card1
Starting subtest: multigpu-basic
<g:1> Opened device: /dev/dri/card2
gem_exec_gttfill: ../lib/drmtest.c:313: _is_already_opened: Assertion `as_idx <= _opened_fds_count' failed.

Added also some debug prints for diagnosing problems with
multi-GPU tests.

v2: fix setting opened count in _set_opened_fd()
v3: search all already opened fds in _is_already_opened()

Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 lib/drmtest.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index e1da66c87..2d9e6c497 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -296,13 +296,18 @@ static int _opened_fds_count;
 static void _set_opened_fd(int idx, int fd)
 {
 	assert(idx < ARRAY_SIZE(_opened_fds));
-	assert(idx <= _opened_fds_count);
+
+	if (idx >= _opened_fds_count) {
+		for (int i = _opened_fds_count; i < idx; ++i)
+			_opened_fds[i].fd = -1;
+	}
 
 	_opened_fds[idx].fd = fd;
 
 	assert(fstat(fd, &_opened_fds[idx].stat) == 0);
 
-	_opened_fds_count = idx+1;
+	if (idx >= _opened_fds_count)
+		_opened_fds_count = idx + 1;
 }
 
 static bool _is_already_opened(const char *path, int as_idx)
@@ -310,16 +315,20 @@ static bool _is_already_opened(const char *path, int as_idx)
 	struct stat new;
 
 	assert(as_idx < ARRAY_SIZE(_opened_fds));
-	assert(as_idx <= _opened_fds_count);
 
 	/*
 	 * we cannot even stat the device, so it's of no use - let's claim it's
 	 * already opened
 	 */
-	if (igt_debug_on(stat(path, &new) != 0))
+	if (igt_debug_on(stat(path, &new) != 0)) {
+		igt_debug("cannot stat device: %s\n", path);
 		return true;
+	}
+
+	for (int i = 0; i < _opened_fds_count; ++i) {
+		if (_opened_fds[i].fd == -1)
+			continue;
 
-	for (int i = 0; i < as_idx; ++i) {
 		/* did we cross filesystem boundary? */
 		assert(_opened_fds[i].stat.st_dev == new.st_dev);
 
@@ -484,6 +493,7 @@ int __drm_open_driver_another(int idx, int chipset)
 {
 	int fd = -1;
 
+	igt_debug("card idx: %d chipset: %d\n", idx, chipset);
 	if (chipset != DRIVER_VGEM && igt_device_filter_count() > idx) {
 		struct igt_device_card card;
 		bool found;
@@ -491,6 +501,7 @@ int __drm_open_driver_another(int idx, int chipset)
 		found = __get_card_for_nth_filter(idx, &card);
 
 		if (!found) {
+			igt_debug("cannot find card idx: %d, loading module\n", idx);
 			drm_load_module(chipset);
 			found = __get_card_for_nth_filter(idx, &card);
 		}
@@ -500,11 +511,14 @@ int __drm_open_driver_another(int idx, int chipset)
 				 igt_device_filter_get(idx));
 		else if (_is_already_opened(card.card, idx))
 			igt_warn("card maching filter %d is already opened\n", idx);
-		else
+		else {
+			igt_debug("card idx: %d found: %s\n", idx, card.card);
 			fd = __open_driver_exact(card.card, chipset);
+		}
 
 	} else {
 		/* no filter for device idx, let's open whatever is available */
+		igt_debug("No filter for device idx: %d\n", idx);
 		fd = __open_driver("/dev/dri/card", 0, chipset, idx);
 	}
 
-- 
2.42.0

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

* [igt-dev] [PATCH i-g-t v3 2/2] tests/intel/xe_create: extend massive subtest to multi-gpu
  2023-09-27  9:55 [igt-dev] [PATCH i-g-t 0/2] drmtest changes for running tests on multi-gpu Kamil Konieczny
  2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 1/2] lib/drmtest: allow out of order device opening Kamil Konieczny
@ 2023-09-27  9:55 ` Kamil Konieczny
  2023-09-27 10:00 ` [igt-dev] ✗ Fi.CI.BUILD: failure for drmtest changes for running tests on multi-gpu (rev2) Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Kamil Konieczny @ 2023-09-27  9:55 UTC (permalink / raw)
  To: igt-dev

Sample code extends existing create-massive-size subtest to run
on multi-GPUs boards. This will currently work only with
--drivers or IGT_DRIVERS options selecting at least two dGPU
cards.

v2: Fixed bug in opening wrong multi-gpu device (Zbigniew)
v3: revert to use filter count, add require for xe, change
    subtest description

Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tests/intel/xe_create.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index 8d845e5c8..437c04df3 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -12,6 +12,7 @@
 #include <string.h>
 
 #include "igt.h"
+#include "igt_device_scan.h"
 #include "xe_drm.h"
 #include "xe/xe_ioctl.h"
 #include "xe/xe_query.h"
@@ -191,6 +192,13 @@ static void create_execqueues(int fd, enum exec_queue_destroy ed)
  * Test category: functionality test
  * Description: Verifies xe bo create returns expected error code on massive
  *              buffer sizes.
+ *
+ * SUBTEST: multigpu-create-massive-size
+ * Functionality: ioctl
+ * Test category: functionality test
+ * Test sub-category: multi gpu
+ * Description: Verifies xe bo create with massive buffer sizes runs correctly
+ *		on two or more GPUs.
  */
 static void create_massive_size(int fd)
 {
@@ -228,6 +236,23 @@ igt_main
 		create_massive_size(xe);
 	}
 
+	igt_subtest("multigpu-create-massive-size") {
+		int gpu_filter_count = igt_device_filter_count();
+
+		igt_require(xe > 0);
+		igt_require(gpu_filter_count >= 2);
+		igt_multi_fork(child, gpu_filter_count) {
+			int gpu_fd;
+
+			gpu_fd = child ? __drm_open_driver_another(child, DRIVER_XE) : drm_reopen_driver(xe);
+			igt_assert_f(gpu_fd > 0, "cannot open gpu-%d, errno=%d\n", child, errno);
+
+			create_massive_size(gpu_fd);
+			drm_close_driver(gpu_fd);
+		}
+		igt_waitchildren();
+	}
+
 	igt_fixture
 		drm_close_driver(xe);
 }
-- 
2.42.0

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

* [igt-dev] ✗ Fi.CI.BUILD: failure for drmtest changes for running tests on multi-gpu (rev2)
  2023-09-27  9:55 [igt-dev] [PATCH i-g-t 0/2] drmtest changes for running tests on multi-gpu Kamil Konieczny
  2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 1/2] lib/drmtest: allow out of order device opening Kamil Konieczny
  2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 2/2] tests/intel/xe_create: extend massive subtest to multi-gpu Kamil Konieczny
@ 2023-09-27 10:00 ` Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2023-09-27 10:00 UTC (permalink / raw)
  To: Kamil Konieczny; +Cc: igt-dev

== Series Details ==

Series: drmtest changes for running tests on multi-gpu (rev2)
URL   : https://patchwork.freedesktop.org/series/123991/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
8d12be0387d5b80076b7d67db7831292bb34f6df tests/amdgpu: add pstate test

Tail of build.log:
[1593/1641] Linking target tools/intel_gvtg_test.
[1594/1641] Generating gem_stress.testlist with a meson_exe.py custom command.
[1595/1641] Linking target tools/lsgpu.
[1596/1641] Linking target tools/intel_vbt_decode.
[1597/1641] Linking target tools/intel_perf_counters.
[1598/1641] Linking target tools/intel_gem_info.
[1599/1641] Linking target tools/xe_reg.
[1600/1641] Linking target tools/intel_dp_compliance.
[1601/1641] Linking target tools/intel_reg.
[1602/1641] Linking target tools/amd_hdmi_compliance.
[1603/1641] Linking target tools/msm_dp_compliance.
[1604/1641] Linking target runner/testdata/abort.
[1605/1641] Linking target runner/testdata/no-subtests.
[1606/1641] Linking target runner/igt_comms_decoder.
[1607/1641] Linking target tools/intel_l3_parity.
[1608/1641] Linking target runner/testdata/successtest.
[1609/1641] Linking target runner/igt_resume.
[1610/1641] Linking target runner/testdata/skippers.
[1611/1641] Linking target runner/runner_json_test.
[1612/1641] Linking target runner/testdata/abort-fixture.
[1613/1641] Linking target runner/testdata/dynamic.
[1614/1641] Linking target runner/testdata/abort-dynamic.
[1615/1641] Linking target runner/igt_results.
[1616/1641] Linking target runner/testdata/abort-simple.
[1617/1641] Linking target runner/igt_runner.
[1618/1641] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_mtlgt3.c.o'.
[1619/1641] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
[1620/1641] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt1.c.o'.
[1621/1641] Linking target runner/runner_test.
[1622/1641] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt2.c.o'.
[1623/1641] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt3.c.o'.
[1624/1641] Linking target lib/libi915_perf.so.1.5.
[1625/1641] Generating symbol file 'lib/76b5a35@@i915_perf@sha/libi915_perf.so.1.5.symbols'.
[1626/1641] Linking target tools/i915-perf/i915-perf-configs.
[1627/1641] Linking target tools/i915-perf/i915-perf-recorder.
[1628/1641] Linking target tools/i915-perf/i915-perf-reader.
[1629/1641] Linking target tests/gem_barrier_race.
[1630/1641] Linking target tests/core_hotunplug.
[1631/1641] Linking target tests/perf.
[1632/1641] Generating gem_barrier_race.testlist with a meson_exe.py custom command.
[1633/1641] Generating core_hotunplug.testlist with a meson_exe.py custom command.
[1634/1641] Generating perf.testlist with a meson_exe.py custom command.
[1635/1641] Generating xe_tests.rst with a custom command.
FAILED: docs/testplan/xe_tests.rst 
/usr/src/igt-gpu-tools/scripts/igt_doc.py --config /usr/src/igt-gpu-tools/tests/intel/xe_test_config.json --rest docs/testplan/xe_tests.rst --check-testlist --igt-build-path /opt/igt/build
/usr/src/igt-gpu-tools/tests/intel/xe_create.c:199: Error: unrecognized line. Need to add field at /usr/src/igt-gpu-tools/tests/intel/xe_test_config.json?
	==> Test sub-category: multi gpu
[1636/1641] Generating i915_tests.rst with a custom command.
[1637/1641] Generating kms_tests.rst with a custom command.
ninja: build stopped: subcommand failed.


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

end of thread, other threads:[~2023-09-27 10:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27  9:55 [igt-dev] [PATCH i-g-t 0/2] drmtest changes for running tests on multi-gpu Kamil Konieczny
2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 1/2] lib/drmtest: allow out of order device opening Kamil Konieczny
2023-09-27  9:55 ` [igt-dev] [PATCH i-g-t v3 2/2] tests/intel/xe_create: extend massive subtest to multi-gpu Kamil Konieczny
2023-09-27 10:00 ` [igt-dev] ✗ Fi.CI.BUILD: failure for drmtest changes for running tests on multi-gpu (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox