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

Retrieving NUMA node ID #28

Closed sukyoungjeong-furiosa closed 2 years ago

sukyoungjeong-furiosa commented 2 years ago

It would be useful if we can retrieve NUMA node ID associated with the NPU device's PCI lane.

cf) image

Currently, one can retrieve NUMA node ID as follows:

root@sukyoungjeong-npu-0:~# cat /sys/class/npu_mgmt/npu5_mgmt/busname
0000:ce:00.0
root@sukyoungjeong-npu-0:~# cat /sys/bus/pci/devices/0000\:ce\:00.0/numa_node
1
libc-furiosa commented 2 years ago

관련하여 도움이 될만한 문서 몇 가지를 남깁니다. 다른 좋은 레퍼런스를 아는게 있으시다면 추가로 공유해주시면 좋을 것 같습니다.

sukyoungjeong-furiosa commented 2 years ago

https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci

What: /sys/bus/pci/devices/.../numa_node Date: Oct 2014 Contact: Prarit Bhargava prarit@redhat.com Description: This file contains the NUMA node to which the PCI device is attached, or -1 if the node is unknown. The initial value comes from an ACPI _PXM method or a similar firmware source. If that is missing or incorrect, this file can be written to override the node. In that case, please report a firmware bug to the system vendor. Writing to this file taints the kernel with TAINT_FIRMWARE_WORKAROUND, which reduces the supportability of your system.