Uncomment all #deb-src lines in /etc/apt/sources.list
Run the following commands:
sudo apt update
sudo apt install build-essential
sudo apt build-dep qemu
wget https://download.qemu.org/qemu-5.0.0.tar.xz
tar xvJf qemu-5.0.0.tar.xz
cd qemu-5.0.0
./configure --enable-rdma --enable-debug
make -j 28
sudo make -j28 install
sudo make rdmacm-mux
# Check version (should be 5.0.0)
qemu-system-x86 --version
wget https://content.mellanox.com/ofed/MLNX_OFED-5.2-2.2.0.0/MLNX_OFED_LINUX-5.2-2.2.0.0-ubuntu20.04-x86_64.tgz
tar zxvf MLNX_OFED_LINUX-5.2-2.2.0.0-ubuntu20.04-x86_64.tgz
./mlnxofedinstall --all
sudo rmmod ib_ipoib
sudo rmmod ib_cm
sudo rmmod rdma_c
strace ./rdmacm-mux -d mlx5_0 -p 0
Before running the rdmacm-mux make sure that both ib_cm and rdma_cm kernel modules aren't loaded, otherwise the rdmacm-mux service will fail to start.