gpu : add description to TLimit Sensor
This patch adds support for Description redfish property by populating
PrettyName property of xyz.openbmc_project.Inventory.Item interface.
Tested.
Build an image for gb200nvl-obmc machine with the following patches
cherry picked. This patches are needed to enable the mctp stack.
https://gerrit.openbmc.org/c/openbmc/openbmc/+/79312
https://gerrit.openbmc.org/c/openbmc/openbmc/+/79410
https://gerrit.openbmc.org/c/openbmc/openbmc/+/79422
Copy the configuration file on gb200nvl-obmc machine and restart the
entity-manager service.
```
root@gb200nvl-obmc:~# rm -rf /var/configuration/
root@gb200nvl-obmc:~# systemctl restart xyz.openbmc_project.EntityManager.service
```
Copy the gpusensor app and run it.
```
root@gb200nvl-obmc:~# ./gpusensor
```
```
root@gb200nvl-obmc:~# busctl introspect xyz.openbmc_project.GpuSensor /xyz/openbmc_project/sensors/temperature/NVIDIA_GB200_GPU_TEMP_1
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.Association.Definitions interface - - -
.Associations property a(sss) 1 "chassis" "all_sensors" "/xyz/openbmc… emits-change
xyz.openbmc_project.Inventory.Item interface - - -
.PrettyName property s "Thermal Limit(TLIMIT) Temperature is t… emits-change
xyz.openbmc_project.Sensor.Threshold.Critical interface - - -
.CriticalAlarmHigh property b false emits-change
.CriticalAlarmLow property b false emits-change
.CriticalHigh property d nan emits-change writable
.CriticalLow property d 0 emits-change writable
xyz.openbmc_project.Sensor.Threshold.HardShutdown interface - - -
.HardShutdownAlarmHigh property b false emits-change
.HardShutdownAlarmLow property b false emits-change
.HardShutdownHigh property d nan emits-change writable
.HardShutdownLow property d 0 emits-change writable
xyz.openbmc_project.Sensor.Threshold.Warning interface - - -
.WarningAlarmHigh property b false emits-change
.WarningAlarmLow property b false emits-change
.WarningHigh property d nan emits-change writable
.WarningLow property d 0 emits-change writable
xyz.openbmc_project.Sensor.Value interface - - -
.MaxValue property d 127 emits-change
.MinValue property d -128 emits-change
.Unit property s "xyz.openbmc_project.Sensor.Value.Unit.… emits-change
.Value property d 48.9688 emits-change writable
xyz.openbmc_project.Sensor.ValueMutability interface - - -
.Mutable property b true emits-change
xyz.openbmc_project.State.Decorator.Availability interface - - -
.Available property b true emits-change writable
xyz.openbmc_project.State.Decorator.OperationalStatus interface - - -
.Functional property b true emits-change
```
Change-Id: Ia344f096754a96f727194c444a2421122b32150b
Signed-off-by: Harshit Aghera <haghera@nvidia.com>
diff --git a/src/gpu/GpuTLimitSensor.cpp b/src/gpu/GpuTLimitSensor.cpp
index 5a02326..88955ce 100644
--- a/src/gpu/GpuTLimitSensor.cpp
+++ b/src/gpu/GpuTLimitSensor.cpp
@@ -61,6 +61,15 @@
association = objectServer.add_interface(dbusPath, association::interface);
+ descriptionInterface = objectServer.add_interface(
+ dbusPath, "xyz.openbmc_project.Inventory.Item");
+
+ descriptionInterface->register_property(
+ "PrettyName",
+ "Thermal Limit(TLIMIT) Temperature is the distance in deg C from the GPU temperature to the first throttle limit."s);
+
+ descriptionInterface->initialize();
+
setInitialProperties(sensor_paths::unitDegreesC);
}
@@ -72,6 +81,7 @@
}
objectServer.remove_interface(sensorInterface);
objectServer.remove_interface(association);
+ objectServer.remove_interface(descriptionInterface);
}
void GpuTLimitSensor::checkThresholds()
diff --git a/src/gpu/GpuTLimitSensor.hpp b/src/gpu/GpuTLimitSensor.hpp
index 0407814..da054a2 100644
--- a/src/gpu/GpuTLimitSensor.hpp
+++ b/src/gpu/GpuTLimitSensor.hpp
@@ -83,4 +83,6 @@
* @brief D-Bus object server
*/
sdbusplus::asio::object_server& objectServer;
+
+ std::shared_ptr<sdbusplus::asio::dbus_interface> descriptionInterface;
};