Skip to content

Commit b4c2bd3

Browse files
authored
Merge pull request #1116 from eero-t/gpu_fakedev
Add fake GPU device generator for scalability testing
2 parents 8bb5819 + ff5cc41 commit b4c2bd3

File tree

6 files changed

+379
-1
lines changed

6 files changed

+379
-1
lines changed

Diff for: .github/workflows/ci.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
image:
106106
- intel-fpga-admissionwebhook
107107
- intel-fpga-initcontainer
108+
- intel-gpu-fakedev
108109
- intel-gpu-initcontainer
109110
- intel-gpu-plugin
110111
- intel-fpga-plugin

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cmd/fpga_crihook/fpga_crihook
1111
cmd/dlb_plugin/dlb_plugin
1212
cmd/fpga_plugin/fpga_plugin
1313
cmd/fpga_tool/fpga_tool
14+
cmd/gpu_fakedev/gpu_fakedev
1415
cmd/gpu_nfdhook/gpu_nfdhook
1516
cmd/gpu_plugin/gpu_plugin
1617
cmd/iaa_plugin/iaa_plugin
@@ -32,4 +33,4 @@ _build
3233
_work
3334

3435
*.tgz
35-
charts/operator/crds
36+
charts/operator/crds
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#define _ENTRYPOINT_ /usr/local/bin/intel_gpu_fakedev
2+
ARG CMD=gpu_fakedev
3+
4+
#include "default_plugin.docker"
5+
6+
LABEL name='intel-gpu-fakedev'
7+
LABEL summary='Fake device file generator for Intel® GPU plugin'
8+
LABEL description='Fake device file generator provides fake sysfs+devfs content for Intel GPU plugin from its initcontainer, for scalability testing'

Diff for: cmd/gpu_fakedev/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Fake (GPU) device file generator
2+
3+
Table of Contents
4+
* [Introduction](#introduction)
5+
* [Configuration](#configuration)
6+
* [Potential improvements](#potential-improvements)
7+
* [Related tools](#related-tools)
8+
9+
## Introduction
10+
11+
This is a tool for generating (large number of) fake device files for
12+
k8s device scheduling scalability testing. But it can also be used
13+
just to test (GPU) device plugin functionality without having
14+
corresponding device HW.
15+
16+
Its "intel-gpu-fakedev" container is intended to be run as first init
17+
container in a device plugin pod, so that device plugin (and its NFD
18+
labeler) see the fake (sysfs + devfs) files generated by the tool,
19+
instead of real host sysfs and devfs content.
20+
21+
## Configuration
22+
23+
[Configs](configs/) subdirectory contains example JSON configuration
24+
file(s) for the generator. Currently there's only one example JSON
25+
file, but each new device variant adding feature(s) that have specific
26+
support in device plugin, could have their own fake device config.
27+
28+
## Potential improvements
29+
30+
If support for mixed device environment is needed, tool can be updated
31+
to use node / configuration file mapping. Such mappings could be e.g.
32+
in configuration files themselves as node name include / exlude lists,
33+
and tool would use first configuration file matching the node it's
34+
running on. For now, one would need to use different pod / config
35+
specs for different nodes to achieve that...
36+
37+
Currently JSON config file options and the generated files are tied to
38+
what GPU plugin uses, but if needed, they could be changed to fake
39+
also sysfs + devfs device files used by other plugins.
40+
41+
## Related tools
42+
43+
[fakedev-exporter](#https://github.com/intel/fakedev-exporter) project
44+
can be used to schedule suitably configured fake workloads on the fake
45+
devices, and to provide provide fake activity metrics for them to
46+
Prometheus, that look like they were reported by real Prometheus
47+
metric exporters for real workloads running on real devices.

Diff for: cmd/gpu_fakedev/configs/8x-DG1.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Info": "8x 4 GiB DG1 [Iris Xe MAX Graphics] GPUs",
3+
"DevCount": 8,
4+
"DevMemSize": 4294967296,
5+
"Capabilities": {
6+
"platform": "fake_DG1",
7+
}
8+
}

0 commit comments

Comments
 (0)