All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org,
	"Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
	"Janusz Krzysztofik" <janusz.krzysztofik@linux.intel.com>
Subject: Re: [PATCH i-g-t v9 3/7] lib/intel_multigpu: Introduce library for multi-GPU scenarios
Date: Mon, 19 Feb 2024 18:37:54 +0100	[thread overview]
Message-ID: <20240219173754.tgfmzdeh6bdyilne@kamilkon-desk.igk.intel.com> (raw)
In-Reply-To: <20240219111104.53sdorfempz6tp6i@zkempczy-mobl2>

Hi Zbigniew,
On 2024-02-19 at 12:11:04 +0100, Zbigniew Kempczyński wrote:
> On Thu, Feb 15, 2024 at 05:10:10PM +0100, Kamil Konieczny wrote:
> > From: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>
> > 
> > Implemented gem_require_multigpu in order to replace
> > igt_require(gpu_count > 1), as well as printing available
> > PCI devices if requirement fails.
> > 
> > Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
> > Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> > Signed-off-by: "Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>
> > [Kamil: fixed whitespace and tabs, moved to lib/intel_multigpu.*]
> > Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > ---
> >  lib/intel_multigpu.c | 28 ++++++++++++++++++++++++++++
> >  lib/intel_multigpu.h | 11 +++++++++++
> >  lib/meson.build      |  1 +
> >  3 files changed, 40 insertions(+)
> >  create mode 100644 lib/intel_multigpu.c
> >  create mode 100644 lib/intel_multigpu.h
> > 
> > diff --git a/lib/intel_multigpu.c b/lib/intel_multigpu.c
> > new file mode 100644
> > index 000000000..34c9f936d
> > --- /dev/null
> > +++ b/lib/intel_multigpu.c
> > @@ -0,0 +1,28 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2023 Intel Corporation
> > + */
> > +
> > +#include "igt_core.h"
> > +#include "igt_device_scan.h"
> > +#include "intel_multigpu.h"
> > +
> > +void gem_require_multigpu(int count)
> > +{
> > +	struct igt_devices_print_format fmt = {
> > +		.type = IGT_PRINT_SIMPLE,
> > +		.option = IGT_PRINT_PCI,
> > +	};
> > +	int devices;
> > +
> > +	if (igt_device_filter_count() >= count)
> > +		return;
> 
> If we have 2 filters and count == 2 we return?
> 

For two or more GPUs one can write:

gem_require_multigpu(2);

Regards,
Kamil

> --
> Zbigniew
> 
> > +
> > +	igt_info("PCI devices available in the system:\n");
> > +
> > +	igt_devices_scan(true);
> > +	devices = igt_device_filter_pci();
> > +	igt_devices_print(&fmt);
> > +
> > +	igt_skip("Test requires at least %d GPUs, %d available.\n", count, devices);
> > +}
> > diff --git a/lib/intel_multigpu.h b/lib/intel_multigpu.h
> > new file mode 100644
> > index 000000000..98dc5a4ce
> > --- /dev/null
> > +++ b/lib/intel_multigpu.h
> > @@ -0,0 +1,11 @@
> > +/* SPDX-License-Identifier: MIT */
> > +/*
> > + * Copyright © 2023 Intel Corporation
> > + */
> > +
> > +#ifndef __INTEL_MULTIGPU_H
> > +#define __INTEL_MULTIGPU_H
> > +
> > +void gem_require_multigpu(int count);
> > +
> > +#endif /* __INTEL_MULTIGPU_H */
> > diff --git a/lib/meson.build b/lib/meson.build
> > index 6122861d8..8251695e1 100644
> > --- a/lib/meson.build
> > +++ b/lib/meson.build
> > @@ -65,6 +65,7 @@ lib_sources = [
> >  	'intel_device_info.c',
> >  	'intel_mmio.c',
> >  	'intel_mocs.c',
> > +	'intel_multigpu.c',
> >  	'intel_pat.c',
> >  	'ioctl_wrappers.c',
> >  	'media_spin.c',
> > -- 
> > 2.42.0
> > 

  reply	other threads:[~2024-02-19 17:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 16:10 [PATCH i-g-t v9 0/7] introduce Xe multigpu and other multi-GPU helpers Kamil Konieczny
2024-02-15 16:10 ` [PATCH i-g-t v9 1/7] lib/igt_device_scan: Introduce filtering out non-PCI devices Kamil Konieczny
2024-02-15 16:10 ` [PATCH i-g-t v9 2/7] lib/drmtest: Introduced drm_open_driver_another Kamil Konieczny
2024-02-16 10:23   ` Janusz Krzysztofik
2024-02-19 17:42     ` Kamil Konieczny
2024-02-20  9:32       ` Janusz Krzysztofik
2024-02-20 18:33         ` Kamil Konieczny
2024-02-21 10:04           ` Janusz Krzysztofik
2024-02-15 16:10 ` [PATCH i-g-t v9 3/7] lib/intel_multigpu: Introduce library for multi-GPU scenarios Kamil Konieczny
2024-02-19 11:11   ` Zbigniew Kempczyński
2024-02-19 17:37     ` Kamil Konieczny [this message]
2024-02-15 16:10 ` [PATCH i-g-t v9 4/7] lib/intel_multigpu: Introduced gem_multigpu_count_class and igt_multi_fork_foreach_gpu Kamil Konieczny
2024-02-19 11:20   ` Zbigniew Kempczyński
2024-02-19 17:40     ` Kamil Konieczny
2024-02-19 17:45     ` Kamil Konieczny
2024-02-15 16:10 ` [PATCH i-g-t v9 5/7] lib/intel_multigpu: Add xe_multi_fork_foreach_gpu Kamil Konieczny
2024-02-19 11:22   ` Zbigniew Kempczyński
2024-02-19 11:26   ` Zbigniew Kempczyński
2024-02-15 16:10 ` [PATCH i-g-t v9 6/7] tests/intel/xe_exec_basic: add multigpu subtests Kamil Konieczny
2024-02-15 16:10 ` [PATCH i-g-t v9 7/7] tests/intel/gem_exec_gttfill: simplify multiGPU subtest Kamil Konieczny
2024-02-19 11:29   ` Zbigniew Kempczyński
2024-02-15 18:03 ` ✓ CI.xeBAT: success for introduce Xe multigpu and other multi-GPU helpers (rev9) Patchwork
2024-02-15 18:20 ` ✓ Fi.CI.BAT: " Patchwork
2024-02-16 14:41 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20240219173754.tgfmzdeh6bdyilne@kamilkon-desk.igk.intel.com \
    --to=kamil.konieczny@linux.intel.com \
    --cc=dominik.karol.piatkowski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --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.