Nvidia-gpu: Create GPU Inventory device
GPU device class implements Item.accelerator interface to get identified
as as GPU device. This will be used in Redfish to populate the GPU
processor schema.
Tested -
```
root@gb200nvl-obmc:~# busctl introspect xyz.openbmc_project.GpuSensor /xyz/openbmc_project/inventory/NVIDIA_GB200_GPU_0
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
xyz.openbmc_project.Inventory.Item.Accelerator interface - - -
.Type property s "GPU" emits-change
```
Change-Id: I20434529860cb37889e63651bbcd97cadfa9d54e
Signed-off-by: Rohit PAI <ropai@nvidia.com>
diff --git a/src/nvidia-gpu/NvidiaGpuDevice.cpp b/src/nvidia-gpu/NvidiaGpuDevice.cpp
index d25860d..d7ad846 100644
--- a/src/nvidia-gpu/NvidiaGpuDevice.cpp
+++ b/src/nvidia-gpu/NvidiaGpuDevice.cpp
@@ -6,6 +6,7 @@
#include "NvidiaGpuDevice.hpp"
+#include "Inventory.hpp"
#include "NvidiaDeviceDiscovery.hpp"
#include "NvidiaGpuSensor.hpp"
#include "Thresholds.hpp"
@@ -15,6 +16,7 @@
#include <MctpRequester.hpp>
#include <NvidiaGpuEnergySensor.hpp>
+#include <NvidiaGpuMctpVdm.hpp>
#include <NvidiaGpuPowerSensor.hpp>
#include <NvidiaGpuThresholds.hpp>
#include <NvidiaGpuVoltageSensor.hpp>
@@ -42,6 +44,8 @@
mctpRequester(mctpRequester), conn(conn), objectServer(objectServer),
configs(configs), name(escapeName(name)), path(path)
{
+ inventory = std::make_shared<Inventory>(
+ conn, objectServer, name, gpu::DeviceIdentification::DEVICE_GPU);
makeSensors();
}