Skip to contentSkip to conversation

drmtest changes for running tests on multi-gpu

PATCH Superseded Kamil Konieczny 2 participants 6 messages Oct 3, 2023 Library code

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v7 cover drmtest changes for running tests on multi-gpu

Allow to open other cards out of order with __drm_open_driver_another() There is still a problem left when there is non-matched first device and no filters are used, it will not work with legacy opening but I will leave that for later. With filters it now 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)

v2: dropped additional patch 2/3 ("lib/drmtest: add multigpu helpers")
changed 3/3 RFC patch as additional subtest
v3: fixes in test (Zbigniew)
fixes in drmlib functions (Zbigniew, Kamil)
v4: corrected test description (Kamil)
v5: restore boundary index for already opened device (Kamil)
v6: fixes in libdrm: start searching for driver from requested index,
limit checks for already opened drivers to currently opened count (Kamil)
v7: drop checks for already opened device with filters,
change a place for igt_debug message, improve debugs (Kamil)

Cc Zbigniew Kempczyński <[email protected]>
Cc Petri Latvala <[email protected]>
Cc Arkadiusz Hiler <[email protected]>

Kamil Konieczny (3):
lib/drmtest: allow out of order device opening tests/intel/xe_create: extend massive subtest to multi-gpu lib/drmtest: drop checks for opened device for filters

 lib/drmtest.c           | 42 ++++++++++++++++++++++++++++-------------
 tests/intel/xe_create.c | 25 ++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 13 deletions(-)
Signature · 1 line
2.42.0
#1 lore raw

PATCH v7 1/3 lib/drmtest: allow out of order device opening

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()
v4: revert change in v3, this will cause treating zero as
special index (no checks) as some test depend on it
v5: start searching for driver from requested index,
limit checks for already opened drivers to currently opened count (Kamil)

Cc Zbigniew Kempczyński <[email protected]>
---
 lib/drmtest.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)
lib/drmtest.c +23 -5
index e1da66c87..43524c5ad 100644
@@ -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,23 @@ 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;
+	}
+
+	if (as_idx > _opened_fds_count)
+		as_idx = _opened_fds_count;
 
 	for (int i = 0; i < as_idx; ++i) {
+		if (_opened_fds[i].fd == -1)
+			continue;
+
 		/* did we cross filesystem boundary? */
 		assert(_opened_fds[i].stat.st_dev == new.st_dev);
 
@@ -338,6 +350,7 @@ static int __search_and_open(const char *base, int offset, unsigned int chipset,
 	if (forced)
 		igt_debug("Force option used: Using driver %s\n", forced);
 
+	offset += as_idx;
 	for (int i = 0; i < 16; i++) {
 		char name[80];
 		int fd;
@@ -484,6 +497,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 +505,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 +515,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);
 	}
 
Signature · 1 line
2.42.0
#2 lore raw

PATCH v7 2/3 tests/intel/xe_create: extend massive subtest to multi-gpu

In reply to Kamil Konieczny

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
v4: correct description

Cc Zbigniew Kempczyński <[email protected]>
---
 tests/intel/xe_create.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
tests/intel/xe_create.c +25 -0
index 8d845e5c8..ee970450f 100644
@@ -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
+ * Feature: multigpu
+ * 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);
 }
Signature · 1 line
2.42.0
#3 lore raw

PATCH v7 3/3 lib/drmtest: drop checks for opened device for filters

In reply to Kamil Konieczny

When using filters honor user choice and don't restrict opens to non-opened devices. This will allow a user to test some multiGPU tests with repeated filter for card zero:

--device=pci:vendor=Intel,device=discrete,card=0\;pci:vendor=Intel,device=discrete,card=0

If the user want it just allow this. Also while at this, move debug print into filter loop as there is already one for non-filter.

Cc Zbigniew Kempczyński <[email protected]>
Cc Petri Latvala <[email protected]>
Cc Arkadiusz Hiler <[email protected]>
---
 lib/drmtest.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
lib/drmtest.c +9 -11
index 43524c5ad..dbfa0282d 100644
@@ -454,8 +454,8 @@ static bool __get_card_for_nth_filter(int idx, struct igt_device_card *card)
  *   * device scanning is executed,
  *   * idx-th filter (starting with 0, filters are semicolon separated) is used
  *   * if there is no idx-th filter, goto 2
- *   * first device maching the filter is selected
- *   * if it's already opened (for indexes = 0..idx-1) we fail with -1
+ *   * device maching the requested filter is selected
+ *   * if it's not matched we fail with -1
  *   * otherwise open the device and return the fd
  *
  * 2. compatibility mode - open the first DRM device we can find that is not
@@ -497,11 +497,11 @@ 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;
 
+		igt_debug("card idx: %d chipset: %d\n", idx, chipset);
 		found = __get_card_for_nth_filter(idx, &card);
 
 		if (!found) {
@@ -510,16 +510,14 @@ int __drm_open_driver_another(int idx, int chipset)
 			found = __get_card_for_nth_filter(idx, &card);
 		}
 
-		if (!found || !strlen(card.card))
-			igt_warn("No card matches the filter! [%s]\n",
-				 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 {
-			igt_debug("card idx: %d found: %s\n", idx, card.card);
+		if (!found || !strlen(card.card)) {
+			igt_warn("No card matches the filter! [%s]%s\n",
+				 igt_device_filter_get(idx),
+				 found && !strlen(card.card) ? " (card empty)" : "");
+		} else {
+			igt_debug("card %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);
Signature · 1 line
2.42.0
#4 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for drmtest changes for running tests on multi-gpu (rev6)

In reply to Kamil Konieczny
== Series Details ==

== Series Details ==

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

== Summary ==

CI Bug Log - changes from CI_DRM_13705 -> IGTPW_9911
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_9911 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_9911, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/index.html

Participating hosts (39 -> 40)
------------------------------

Additional (2): fi-kbl-soraka fi-pnv-d510
Missing (1): fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_9911:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@hangcheck:
- fi-skl-guc: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13705/fi-skl-guc/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/fi-skl-guc/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in IGTPW_9911 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s0@smem:
- bat-dg2-9: [PASS][3] -> [INCOMPLETE][4] ([i915#9275])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13705/bat-dg2-9/igt@gem_exec_suspend@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/bat-dg2-9/igt@gem_exec_suspend@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#2190])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/fi-kbl-soraka/igt@[email protected]

* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#4613]) +3 other tests skip
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/fi-kbl-soraka/igt@[email protected]

* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][7] ([i915#1886] / [i915#7913])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

* igt@kms_dsc@dsc-basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][8] ([fdo#109271]) +9 other tests skip
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/fi-kbl-soraka/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
- bat-dg2-11: NOTRUN -> [SKIP][9] ([i915#1845]) +3 other tests skip
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/bat-dg2-11/igt@[email protected]

* igt@kms_psr@primary_page_flip:
- fi-pnv-d510: NOTRUN -> [SKIP][10] ([fdo#109271]) +31 other tests skip
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/fi-pnv-d510/igt@kms_psr@primary_page_flip.html

#### Possible fixes ####

* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
- bat-rplp-1: [ABORT][11] ([i915#8668]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13705/bat-rplp-1/igt@kms_pipe_crc_basic@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/bat-rplp-1/igt@kms_pipe_crc_basic@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7510 -> IGTPW_9911

CI-20190529: 20190529
CI_DRM_13705: c7379e9ad81bca56e268003928cd81a04c3b10d0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_9911: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/index.html
IGT_7510: a4b4a33d8312e4e30ca23d26bbd1758e56540e1d @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

Testlist changes
----------------

+igt@xe_create@multigpu-create-massive-size

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/index.html

#5 lore raw

[igt-dev] ✓ CI.xeBAT: success for drmtest changes for running tests on multi-gpu (rev6)

In reply to Kamil Konieczny
== Series Details ==

== Series Details ==

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

== Summary ==

CI Bug Log - changes from XEIGT_7510_BAT -> XEIGTPW_9911_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (4 -> 4)
------------------------------

No changes in participating hosts

Known issues
------------

Here are the changes found in XEIGTPW_9911_BAT that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@xe_exec_store@basic-store:
- bat-adlp-7: [PASS][1] -> [FAIL][2] ([Intel XE#761])
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7510/bat-adlp-7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9911/bat-adlp-7/igt@[email protected]

* igt@xe_live_ktest@bo:
- bat-dg2-oem2: [PASS][3] -> [INCOMPLETE][4] ([Intel XE#695])
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7510/bat-dg2-oem2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9911/bat-dg2-oem2/igt@[email protected]

#### Possible fixes ####

* igt@kms_flip@basic-flip-vs-wf_vblank@d-edp1:
- bat-adlp-7: [FAIL][5] ([Intel XE#480]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7510/bat-adlp-7/igt@kms_flip@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9911/bat-adlp-7/igt@kms_flip@[email protected]

[Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
[Intel XE#695]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/695
[Intel XE#761]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/761

Build changes
-------------

* IGT: IGT_7510 -> IGTPW_9911

IGTPW_9911: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9911/index.html
IGT_7510: a4b4a33d8312e4e30ca23d26bbd1758e56540e1d @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-410-02ab43e36623665d8644d46162bd4ec5eeb68489: 02ab43e36623665d8644d46162bd4ec5eeb68489

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9911/index.html