Linux – How to configure hosts to show host name in ibnetdiscover (infiniband)

infinibandlinuxUbuntu

Windows machines with the OFED stack installed show the host names in ibnetdiscover.

Under Ubuntu Linux all I see is "MT25408 ConnectX Mellanox Technologies".

Is there a way of configuring the driver to show the hostname or some other text instead?


EDIT: After haggai_e's answer below I added the following to my init scripts in ubuntu. Now ibnetdiscover etc will show more useful information.

# Add node description to sysfs
IBSYSDIR="/sys/class/infiniband"
hca_id=1
if [ -d ${IBSYSDIR} ]; then
  for hca in ${IBSYSDIR}/*; do
    if [ -e ${hca}/node_desc ]; then
      echo -n "$(hostname -s) HCA-${hca_id}" >> ${hca}/node_desc
    fi
    hca_id=$((hca_id+1))
  done
fi

Which in ibnetdiscover shows the host names as

e.g.

node1 HCA-1
node2 HCA-2

For my nodes

Best Answer

ibnetdiscover prints the NodeDescription field of the InfiniBand node in quotes. You can set this by writing to /sys/class/infiniband/<device name>/node_desc. OFED contains an init script called openibd that will set this to show the host name during startup.

Related Topic