* [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu
@ 2023-10-20 13:00 Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 1/8] lib/drmtest: allow out of order device opening Kamil Konieczny
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
Allow to open other cards out of order with __drm_open_driver_another()
Here is a proposed solution for non-matched first device and additional
one when no filters are used but it may be re-worked later. It should
now work with three or more GPUs on board, also 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
IGT-Version: 1.28-g24b5fbcb5 (x86_64) (Linux: 6.6.0-rc3-xe-public-37b2d042c23a+ x86_64)
Opened device: /dev/dri/card1
Starting subtest: multigpu-create-massive-size
<g:0> Opened device: /dev/dri/card1
<g:1> Opened device: /dev/dri/card2
<g:2> Opened device: /dev/dri/card3
Subtest multigpu-create-massive-size: SUCCESS (0.202s)
With new helper and without filters:
sudo build/tests/xe_create --r multigpu-create-massive-size
IGT-Version: 1.28-g24b5fbcb5 (x86_64) (Linux: 6.6.0-rc3-xe-public-37b2d042c23a+ x86_64)
Opened device: /dev/dri/card1
Starting subtest: multigpu-create-massive-size
<g:0> Opened device: /dev/dri/card1
<g:1> Opened device: /dev/dri/card2
<g:2> Opened device: /dev/dri/card3
Subtest multigpu-create-massive-size: SUCCESS (0.268s)
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)
v8: add drm helper for the case when no filters are used,
use this helper in xe_create multi-gpu subtest (Kamil)
v9: add helper for dropping logged opended cards, now it shows
as <g:0> Opened device: /dev/dri/cardN (Kamil)
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <adrinael@adrinael.net>
Cc: Arkadiusz Hiler <arek@hiler.eu>
Kamil Konieczny (8):
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: save skip offset for first opened device
lib/drmtest: create helper for countig number of GPUs
tests/intel/xe_create: use drm helper for GPUs count
lib/drmtest: create helper for dropping opened paths
tests/intel/xe_create: print first opened card
lib/drmtest.c | 151 +++++++++++++++++++++++++++++++++++-----
lib/drmtest.h | 3 +
tests/intel/xe_create.c | 26 +++++++
3 files changed, 163 insertions(+), 17 deletions(-)
--
2.42.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 1/8] lib/drmtest: allow out of order device opening
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 2/8] tests/intel/xe_create: extend massive subtest to multi-gpu Kamil Konieczny
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 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()
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)
v6: remove if condition in _set_opened_fd (Zbigniew)
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
lib/drmtest.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index e1da66c87..baff82b25 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -296,13 +296,16 @@ 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);
+
+ 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 +313,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 +348,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 +495,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 +503,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 +513,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] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 2/8] tests/intel/xe_create: extend massive subtest to multi-gpu
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 1/8] lib/drmtest: allow out of order device opening Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 3/8] lib/drmtest: drop checks for opened device for filters Kamil Konieczny
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 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_DEVICE 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 <zbigniew.kempczynski@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@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 d99bd51cf..d74c2140d 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
+ * 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);
}
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 3/8] lib/drmtest: drop checks for opened device for filters
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 1/8] lib/drmtest: allow out of order device opening Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 2/8] tests/intel/xe_create: extend massive subtest to multi-gpu Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 4/8] lib/drmtest: save skip offset for first opened device Kamil Konieczny
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
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 and add debug print before open.
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <adrinael@adrinael.net>
Cc: Arkadiusz Hiler <arek@hiler.eu>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
lib/drmtest.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index baff82b25..7c2fd7c56 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -452,8 +452,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
@@ -495,11 +495,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) {
@@ -508,16 +508,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);
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 4/8] lib/drmtest: save skip offset for first opened device
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (2 preceding siblings ...)
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 3/8] lib/drmtest: drop checks for opened device for filters Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 5/8] lib/drmtest: create helper for countig number of GPUs Kamil Konieczny
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
On some boards with many discrete GPU cards it may happen that
on-board one is integrated and will be skipped during opening
a first device. With out-of-order try and open it may result
with off-by-one error opening wrong card. Fixed this with saving
skip offset for first device name.
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/drmtest.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 7c2fd7c56..89d045200 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -292,6 +292,8 @@ static struct {
}_opened_fds[64];
static int _opened_fds_count;
+static int _opened_fds0_skip;
+static int _opened_fds0_chipset;
static void _set_opened_fd(int idx, int fd)
{
@@ -348,7 +350,11 @@ 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;
+ if (offset == 0 && as_idx != 0 && _opened_fds0_chipset == chipset)
+ offset += as_idx + _opened_fds0_skip;
+ else
+ offset += as_idx;
+
for (int i = 0; i < 16; i++) {
char name[80];
int fd;
@@ -359,8 +365,15 @@ static int __search_and_open(const char *base, int offset, unsigned int chipset,
continue;
fd = open_device(name, chipset);
- if (fd != -1)
+ if (fd != -1) {
+ if (i != 0 && offset == as_idx && as_idx == 0
+ && chipset != DRIVER_VGEM && chipset != DRIVER_ANY) {
+ _opened_fds0_skip = i;
+ _opened_fds0_chipset = chipset;
+ }
+
return fd;
+ }
}
return -1;
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 5/8] lib/drmtest: create helper for countig number of GPUs
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (3 preceding siblings ...)
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 4/8] lib/drmtest: save skip offset for first opened device Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 6/8] tests/intel/xe_create: use drm helper for GPUs count Kamil Konieczny
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
Create a function for counting number of GPUs present on system.
When no filters used this will count discrete GPUs, otherwise
will count them using given filters.
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/drmtest.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++
lib/drmtest.h | 2 ++
2 files changed, 74 insertions(+)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 89d045200..2cdeb8e3b 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -804,6 +804,78 @@ int drm_reopen_driver(int fd)
return fd;
}
+/**
+ * drm_open_driver_render:
+ * @chipset: flag for one chipset to search, eg. #DRIVER_INTEL
+ *
+ * Get number of GPUs for given chipset. If used --device option or IGT_DEVICE
+ * environment variable, perform countig based on supplied filters.
+ *
+ * Returns:
+ * Number of GPUs for given chipset or filters.
+ */
+int drm_get_gpu_count(int chipset)
+{
+ struct igt_device_card card;
+ int gpu_count;
+ bool found;
+ char v[16];
+
+ if (chipset == DRIVER_VGEM || chipset == DRIVER_ANY) {
+ igt_debug("No multi-gpu for chipset %d\n", chipset);
+ return 0;
+ }
+
+ gpu_count = igt_device_filter_count();
+ if (!gpu_count) {
+ char gpu_filter[256];
+
+ if (chipset == DRIVER_INTEL || chipset == DRIVER_XE)
+ strncpy(v, "Intel", sizeof(v) - 1);
+ else
+ strncpy(v, chipset_to_str(chipset), sizeof(v) - 1);
+ igt_debug("Counting GPUs for chipset: %d vendor: %s\n", chipset, v);
+ for (int i = 0; i < 64; i++) {
+ igt_assert(snprintf(gpu_filter, sizeof(gpu_filter),
+ "pci:vendor=%s,device=discrete,card=%d",
+ v, i) < sizeof(gpu_filter));
+
+ memset(&card, 0, sizeof(card));
+ found = igt_device_card_match(gpu_filter, &card);
+ if (found && strlen(card.card)) {
+ igt_debug("Found gpu %d with %s\n", i, card.card);
+ ++gpu_count;
+ } else {
+ igt_debug("Counted GPUs number: %d\n", gpu_count);
+ break;
+ }
+ }
+ } else {
+ int count = 0;
+
+ for (int i = 0; i < gpu_count; i++) {
+ const char *filter;
+
+ filter = igt_device_filter_get(i);
+ memset(&card, 0, sizeof(card));
+ found = igt_device_card_match(filter, &card);
+ if (found && strlen(card.card)) {
+ igt_debug("Found gpu %d with %s\n", i, card.card);
+ ++count;
+ } else {
+ break;
+ }
+ }
+
+ if (count < gpu_count)
+ igt_debug("Counted GPUs %d lower than number of filters %d\n", count, gpu_count);
+
+ gpu_count = count;
+ }
+
+ return gpu_count;
+}
+
void igt_require_amdgpu(int fd)
{
igt_require(is_amdgpu_device(fd));
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 97ab6e759..7db2292cb 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -109,6 +109,8 @@ int drm_close_driver(int fd);
int drm_reopen_driver(int fd);
+int drm_get_gpu_count(int chipset);
+
void igt_require_amdgpu(int fd);
void igt_require_intel(int fd);
void igt_require_i915(int fd);
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 6/8] tests/intel/xe_create: use drm helper for GPUs count
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (4 preceding siblings ...)
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 5/8] lib/drmtest: create helper for countig number of GPUs Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 7/8] lib/drmtest: create helper for dropping opened paths Kamil Konieczny
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
Instead of counting filter use more general method supported
by new function from drmtest, drm_get_gpu_count().
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/intel/xe_create.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index d74c2140d..d17ebeb65 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -237,14 +237,14 @@ igt_main
}
igt_subtest("multigpu-create-massive-size") {
- int gpu_filter_count = igt_device_filter_count();
+ int gpu_filter_count = drm_get_gpu_count(DRIVER_XE);
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);
+ gpu_fd = __drm_open_driver_another(child, DRIVER_XE);
igt_assert_f(gpu_fd > 0, "cannot open gpu-%d, errno=%d\n", child, errno);
create_massive_size(gpu_fd);
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 7/8] lib/drmtest: create helper for dropping opened paths
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (5 preceding siblings ...)
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 6/8] tests/intel/xe_create: use drm helper for GPUs count Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 8/8] tests/intel/xe_create: print first opened card Kamil Konieczny
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
Create helper for cleaning all cached opened paths for drivers.
This may be used when we want to test multi-GPU scenarios and in
them inform user about each opened GPU card including first one.
Currently almost all tests open first card at start for
performing checks for it but that cause a lost possibilty to
inform user later about opening this first card.
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/drmtest.c | 24 +++++++++++++++++++++---
lib/drmtest.h | 1 +
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 2cdeb8e3b..8eeb11976 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -221,16 +221,17 @@ struct _opened_device_path {
struct igt_list_head link;
};
+static IGT_LIST_HEAD(_opened_paths);
+
/*
* Logs path of opened device. Device path opened for the first time is logged at info level,
* subsequent opens (if any) are logged at debug level.
*/
static void log_opened_device_path(const char *device_path)
{
- static IGT_LIST_HEAD(opened_paths);
struct _opened_device_path *item;
- igt_list_for_each_entry(item, &opened_paths, link) {
+ igt_list_for_each_entry(item, &_opened_paths, link) {
if (!strcmp(item->path, device_path)) {
igt_debug("Opened previously opened device: %s\n", device_path);
return;
@@ -241,10 +242,27 @@ static void log_opened_device_path(const char *device_path)
igt_assert(item);
item->path = strdup(device_path);
igt_assert(item->path);
- igt_list_add(&item->link, &opened_paths);
+ igt_list_add(&item->link, &_opened_paths);
igt_info("Opened device: %s\n", item->path);
}
+/**
+ * __drm_invalidate_opened:
+ *
+ * Invalidate cached opened paths.
+ */
+void __drm_invalidate_opened(void)
+{
+ struct _opened_device_path *item, *tmp;
+
+ if (!igt_list_empty(&_opened_paths))
+ igt_list_for_each_entry_safe(item, tmp, &_opened_paths, link) {
+ free(item->path);
+ igt_list_del(&item->link);
+ free(item);
+ }
+}
+
static int open_device(const char *name, unsigned int chipset)
{
const char *forced;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 7db2292cb..f516412a0 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -110,6 +110,7 @@ int drm_close_driver(int fd);
int drm_reopen_driver(int fd);
int drm_get_gpu_count(int chipset);
+void __drm_invalidate_opened(void);
void igt_require_amdgpu(int fd);
void igt_require_intel(int fd);
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t v9 8/8] tests/intel/xe_create: print first opened card
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (6 preceding siblings ...)
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 7/8] lib/drmtest: create helper for dropping opened paths Kamil Konieczny
@ 2023-10-20 13:00 ` Kamil Konieczny
2023-10-24 0:23 ` [igt-dev] ✓ Fi.CI.BAT: success for drmtest changes for running tests on multi-gpu (rev8) Patchwork
2023-10-24 1:22 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
9 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-10-20 13:00 UTC (permalink / raw)
To: igt-dev
Use helper and allow to print message about first opened
card, so it will be coherent with messages for other opened
cards. Before this log for multi-gpu test:
IGT-Version: 1.28-g24b5fbcb5 (x86_64) (Linux: 6.6.0-rc3-xe-public)
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
Subtest multigpu-create-massive-size: SUCCESS
After using helper we can see first GPU with <g:0> like:
Opened device: /dev/dri/card1
Starting subtest: multigpu-create-massive-size
<g:0> Opened device: /dev/dri/card1
<g:1> Opened device: /dev/dri/card2
<g:2> Opened device: /dev/dri/card3
Subtest multigpu-create-massive-size: SUCCESS
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/intel/xe_create.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index d17ebeb65..640afebc0 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -244,6 +244,7 @@ igt_main
igt_multi_fork(child, gpu_filter_count) {
int gpu_fd;
+ __drm_invalidate_opened();
gpu_fd = __drm_open_driver_another(child, DRIVER_XE);
igt_assert_f(gpu_fd > 0, "cannot open gpu-%d, errno=%d\n", child, errno);
--
2.42.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for drmtest changes for running tests on multi-gpu (rev8)
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (7 preceding siblings ...)
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 8/8] tests/intel/xe_create: print first opened card Kamil Konieczny
@ 2023-10-24 0:23 ` Patchwork
2023-10-24 1:22 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
9 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-10-24 0:23 UTC (permalink / raw)
To: Kamil Konieczny; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 3873 bytes --]
== Series Details ==
Series: drmtest changes for running tests on multi-gpu (rev8)
URL : https://patchwork.freedesktop.org/series/123991/
State : success
== Summary ==
CI Bug Log - changes from IGT_7551 -> IGTPW_10040
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/index.html
Participating hosts (36 -> 37)
------------------------------
Additional (1): fi-kbl-soraka
Known issues
------------
Here are the changes found in IGTPW_10040 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#2190])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#4613]) +3 other tests skip
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][3] ([i915#1886])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@kms_dsc@dsc-basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271]) +9 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/fi-kbl-soraka/igt@kms_dsc@dsc-basic.html
* igt@kms_pipe_crc_basic@suspend-read-crc:
- bat-dg2-9: NOTRUN -> [SKIP][5] ([i915#1845] / [i915#9197])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/bat-dg2-9/igt@kms_pipe_crc_basic@suspend-read-crc.html
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s0@smem:
- bat-dg2-9: [INCOMPLETE][6] ([i915#9275]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7551/bat-dg2-9/igt@gem_exec_suspend@basic-s0@smem.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/bat-dg2-9/igt@gem_exec_suspend@basic-s0@smem.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
- bat-rplp-1: [ABORT][8] ([i915#8668]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7551/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
{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#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#8981]: https://gitlab.freedesktop.org/drm/intel/issues/8981
[i915#9197]: https://gitlab.freedesktop.org/drm/intel/issues/9197
[i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7551 -> IGTPW_10040
CI-20190529: 20190529
CI_DRM_13777: 1b4fd688d213556268c50f853746c94c9a0cfee7 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10040: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/index.html
IGT_7551: 15e7d92ca5f98d10feffa27a76724c33cbd68da5 @ 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_10040/index.html
[-- Attachment #2: Type: text/html, Size: 4706 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [igt-dev] ✓ CI.xeBAT: success for drmtest changes for running tests on multi-gpu (rev8)
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
` (8 preceding siblings ...)
2023-10-24 0:23 ` [igt-dev] ✓ Fi.CI.BAT: success for drmtest changes for running tests on multi-gpu (rev8) Patchwork
@ 2023-10-24 1:22 ` Patchwork
9 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-10-24 1:22 UTC (permalink / raw)
To: Kamil Konieczny; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]
== Series Details ==
Series: drmtest changes for running tests on multi-gpu (rev8)
URL : https://patchwork.freedesktop.org/series/123991/
State : success
== Summary ==
CI Bug Log - changes from XEIGT_7551_BAT -> XEIGTPW_10040_BAT
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (4 -> 4)
------------------------------
No changes in participating hosts
Known issues
------------
Here are the changes found in XEIGTPW_10040_BAT that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- bat-adlp-7: [FAIL][1] ([Intel XE#480]) -> [PASS][2] +2 other tests pass
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7551/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10040/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html
* {igt@xe_create@create-execqueues-noleak}:
- bat-adlp-7: [FAIL][3] ([Intel XE#524]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7551/bat-adlp-7/igt@xe_create@create-execqueues-noleak.html
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10040/bat-adlp-7/igt@xe_create@create-execqueues-noleak.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
[Intel XE#524]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/524
Build changes
-------------
* IGT: IGT_7551 -> IGTPW_10040
IGTPW_10040: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10040/index.html
IGT_7551: 15e7d92ca5f98d10feffa27a76724c33cbd68da5 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-442-a0a80950176b39dbc76f8faa92fddf6caaa06191: a0a80950176b39dbc76f8faa92fddf6caaa06191
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10040/index.html
[-- Attachment #2: Type: text/html, Size: 2676 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-10-24 1:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 13:00 [igt-dev] [PATCH i-g-t v9 0/8] drmtest changes for running tests on multi-gpu Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 1/8] lib/drmtest: allow out of order device opening Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 2/8] tests/intel/xe_create: extend massive subtest to multi-gpu Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 3/8] lib/drmtest: drop checks for opened device for filters Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 4/8] lib/drmtest: save skip offset for first opened device Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 5/8] lib/drmtest: create helper for countig number of GPUs Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 6/8] tests/intel/xe_create: use drm helper for GPUs count Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 7/8] lib/drmtest: create helper for dropping opened paths Kamil Konieczny
2023-10-20 13:00 ` [igt-dev] [PATCH i-g-t v9 8/8] tests/intel/xe_create: print first opened card Kamil Konieczny
2023-10-24 0:23 ` [igt-dev] ✓ Fi.CI.BAT: success for drmtest changes for running tests on multi-gpu (rev8) Patchwork
2023-10-24 1:22 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox