furiosa-ai / device-api

APIs that offers NPU devices' information and allow to control the devices
Apache License 2.0
5 stars 8 forks source link

sensor_container is empty when get device from blocking feature #74

Closed yw-furiosa closed 1 year ago

yw-furiosa commented 1 year ago

When using furiosa_device::blocking::list_devices, sensor_container of Device.Fetcher is empty. Printing the fetcher from the non-blocking function (furiosa_device::list_devices) shows:

Fetcher { device_index: 0, sensor_container: SensorContainer({
Power: [Sensor { name: "PCI Total RMS PWR", items: {"average": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/power1_average"} }, Sensor { name: "NE Core RMS PWR", items: {"average": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/power2_average"} }, Sensor { name: "NE PWR", items: {"average": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/power3_average"} }, Sensor { name: "PCI 12V PWR", items: {"average": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/power4_average"} }, Sensor { name: "PCI 3.3V PWR", items: {"average": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/power5_average"} }, Sensor { name: "NE 12V PWR", items: {"average": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/power6_average"} }], 
Current: [Sensor { name: "NE Current", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/curr1_input"} }, Sensor { name: "PCI 12V Curr", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/curr2_input"} }, Sensor { name: "PCI 3.3V Curr", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/curr3_input"} }, Sensor { name: "NE 12V Curr", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/curr4_input"} }], 
Temperature: [Sensor { name: "Peak", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp1_input"} }, Sensor { name: "Average", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp2_input"} }, Sensor { name: "U74M", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp3_input"} }, Sensor { name: "LPDDR4", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp4_input"} }, Sensor { name: "PCIE", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp5_input"} }, Sensor { name: "NE", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp6_input"} }, Sensor { name: "NE_PE0", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp7_input"} }, Sensor { name: "NE_PE1", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp8_input"} }, Sensor { name: "NE_TOP", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp9_input"} }, Sensor { name: "AMBIENT", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/temp10_input"} }], 
Voltage: [Sensor { name: "NE Core Volt", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/in0_input"} }, Sensor { name: "NE Core 48V Volt", items: {"input": "/sys/bus/pci/devices/0000:4f:00.0/hwmon/hwmon4/in1_input"} }]}) }

However, this is the fetcher from blocking feature (furiosa_device::blocking::list_devices).

Fetcher { device_index: 0, sensor_container: SensorContainer({}) }
sukyoungjeong-furiosa commented 1 year ago

This is somewhat a known-issue-but-nobody-knows. 😢 See https://github.com/furiosa-ai/device-api/pull/40#issuecomment-1168442466. I think we have to fill the blank implementation, leveraging existing async implementation + tokio's block_on or something else. https://github.com/furiosa-ai/device-api/blob/6fa9733521641266499cf25fbb060fac9e914e27/device-api/src/blocking.rs#L149-L154

yw-furiosa commented 1 year ago

Resolved at #82