安装facebook/wdt备忘

ubuntu和centos的都安装成功了。。折磨了好几天了

WDT环境配置(ubuntu20.04环境):ubuntu20.04自带的gcc版本应该已经满足安装wdt了,不需要再升级了。提前安装一些依赖的东西,后面编译的时候需要,如果不安装,后面可能会报错。为了以防万一还是都安装上吧
sudo apt-ge install git
sudo apt-get install g++-11
sudo apt-get install gcc-11
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install libboost-dev
sudo apt-get install build-essential
sudo apt-get install libgoogle-glog-dev libboost-system-dev libdouble-conversion-dev一:安装cmake,我选择的是3.16版本
cmake:
wget http://www.cmake.org/files/v3.16/cmake-3.16.0.tar.gz
tar xvfz cmake-3.16.0.tar.gz
cd cmake-3.16.0
./bootstrap --prefix=/usr --parallel=16
make
sudo make install二:安装gtest
gtest:
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
tar xvfz release-1.8.0.tar.gz
cd googletest-release-1.8.0
cmake .
make
sudo make installhttps://www.bbsmax.com/A/QW5Y3emKzm/上面的形式安装好像没起作用,我编译的时候还是有错误,(可能是执行make install时没有把.a文件拷到系统目录/usr/local/lib的原因)
后面改成,
sudo apt-get install libgtest-dev
cd /usr/src/gtest
sudo mkdir build
cd build
sudo cmake ..
sudo make
然后将build/lib目录下的两个.a文件拷贝到/usr/local/lib三:安装double-conversion
git clone https://github.com/floitsch/double-conversion.git
cd double-conversion
cmake .
make
sudo make install四:安装gflags
git clone https://github.com/schuhschuh/gflags.git
mkdir gflags/build
cd gflags/build
cmake -D GFLAGS_NAMESPACE=google -D BUILD_SHARED_LIBS=on ..
make
sudo make install五:安装fmt
git clone  https://github.com/fmtlib/fmt.git
cmake .
make
make install
还需要把fmt库的include目录下的所有头文件拷贝到系统的/usr/include目录下。不然编译时会报错六:安装boost,我安装的是1.71.0
https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/
解压以后进入目录,./bootstrap.sh   #运行sh脚本
./b2
sudo ./b2 install #安装七:最后安装wdt,安装wdt时,需要先下载folly
git clone https://github.com/facebook/folly.git
git clone https://github.com/facebook/wdt.gitcd ..
mkdir build
cmake  ../wdt -DBUILD_TESTING=on
make -j
sudo make install如果最后编译wdt时报错,需要软链接一下:
sudo ln -sf /usr/bin/g++-11 /usr/bin/g++需要注意的地方,执行make install是记得带sudo,不然可能会报错。最后可以来个例子测试一下:
。。。

命令设置:

1. rxe_net_add(name, netdev) //netdev就是virtio-net的网络设备
make
insmod ./visre.ko2. ibv_devices命令,能看到rdma设备sudo modprobe ib_core
sudo modprobe ib_uverbs
sudo apt-get install libudev-dev
sudo apt-get install libsystemd-devclient:
./rtf_tool -i ens6f0 -d rocep103s0f0 -H -q 1 -w 128 -b 2 192.168.20.12 -s 32server:
./rtf_tool -i vis_en0 -d rocep103s0f0 -H -o -f ./a.txt -q 1 -w 128 -s 32 -b 2./rtf_tool -i vis_en0 -d rocep103s0f0 -H -o -f ./1G.txt -q 1 -w 128 -s 32 -b 2
./rtf_tool -i vis_en0 -d rocep103s0f0 -H -o -f ./1m.txt -q 1 -w 128 -s 32 -b 2-H 巨页
-o
-f 传输的文件
-q qp个数
-w wr深度
-s mr大小
-bdd if=/dev/zero of=./1G.txt bs=1M count=1024tcpdump -i ens6f1 -en -w 11.capubuntu:巨页设置1:sudo vim /etc/default/grub
文件内容:
GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=never default_hugepagesz=1G hugepagesz=1G hugepages=30"2: 更新系统grub重启
sudo updata-grub
reboot3:查看设置情况
cat /proc/meminfo | grep Huge
4:
sudo apt-get install libhugetlbfs-dev
sudo mkdir -p /mnt/hugetlbfs
sudo mount -t hugetlbfs none /mnt/hugetlbfs如果以上步骤还不行的话,设置第55:sudo setcap cap_ipc_lock=ep your_executableecho "sudo ib_write_bw  -F -d rxe0 -s 64  -n 1000 -t 60 -l 8"
echo "sudo ib_write_lat -F -d rxe0 -s 64 -n 1000 -t 60 -l 8"echo "0x404 0x28" > /proc/vis_en0/rdma 
echo "0x41c 0x1" > /proc/vis_en0/rdma
echo "0x400 0x1" > /proc/vis_en0/rdma
59:./ib_write_bw -F -d rocep103s0f0 -n 5 -s 15 --use_tcp_socket 192.168.20.11
58:
./ib_write_bw -F -d rocep103s0f0 --use_tcp_socket测试程序一:
5859目录:/home/xujia/demo59:./server
58:./client 192.168.20.12在server端看数据内容。测试程序二:
5859目录:/home/xujia/rdma-main/perftest59./ib_write_bw -F -d rocep103s0f0 -n 5 -s 15 --use_tcp_socket 192.168.20.11
58./ib_write_bw -F -d rocep103s0f0 --use_tcp_socket需要抓包看数据内容。测试程序三:
5859目录:
/home/xujia/rtf_tool_test58:
./rtf_tool -i ens6f0 -d rocep103s0f0 -H -q 1 -w 128 -b 2 192.168.20.12 -s 32./rtf_tool -i ens6f0 -d rocep103s0f0 -H -q 1 -w 128 -b 2 192.168.20.12 -s 32
59:
./rtf_tool -i vis_en0 -d rocep103s0f0 -H -o -f ./a.txt -q 1 -w 128 -s 32 -b 2./rtf_tool -i vis_en0 -d rocep103s0f0 -H -o -f ./1G.txt -q 1 -w 128 -s 32 -b 2vis_perftest:server:ib_write_bw -F -d rocep103s0f0 -s 64 -n 10 --use_hugepagesclient:ib_write_bw -F -d rocep103s0f0 -s 64 -n 10 --use_hugepages 192.168.20.12
创建文件:dd if=/dev/zero of=./1M.txt bs=1M count=1dd if=/dev/zero of=./1k.txt bs=1K count=1dd if=/dev/zero of=./1G.txt bs=1G count=1
测试程序一:5859目录:/home/xujia/demo
a)正向传输
59:./server
58:./client 192.168.20.12
在server端看数据内容(client端发送hello world)。
b)反向传输
59./client 192.168.20.11
58:./server
测试程序二:
5859目录:/home/xujia/rdma-main/perftesta)正向传输
59./ib_write_bw -F -d rocep103s0f0 -n 5 -s 15 --use_tcp_socket 192.168.20.11
58./ib_write_bw -F -d rocep103s0f0 --use_tcp_socketb)反向传输
58./ib_write_bw -F -d rocep103s0f0 -n 5 -s 15 --use_tcp_socket 192.168.20.12
59./ib_write_bw -F -d rocep103s0f0 --use_tcp_socket需要抓包看数据内容(发送数据内容有填充不是全0)。
测试程序三:
5859目录:/home/xujia/rtf_tool_test
a)正向传输
58:./rtf_tool -i ens6f0 -d rocep103s0f0 -H -q 1 -w 128 -b 2 192.168.20.12 -s 32
59:./rtf_tool -i vis_en0 -d rocep103s0f0 -H -o -f ./a.txt -q 1 -w 128 -s 32 -b 2
b)反向传输
58./rtf_tool -i ens6f0 -d rocep103s0f0 -H -o -f ./a.txt -q 1 -w 128 -s 32 -b 2
59./rtf_tool -i vis_en0 -d rocep103s0f0 -H -q 1 -w 128 -b 2 192.168.20.11 -s 32
驱动装载:
5859目录(或者home/zhangdong)/home/xujia/rdma_ubuntu/release
命令:
58:bash xxx.sh 1 0xa
59:bash xxx.sh 1 0xb

参考:
1:https://blog.csdn.net/wuzhimang/article/details/78204527
2:https://blog.csdn.net/skykingf/article/details/120701069
3:https://blog.csdn.net/qq_43127460/article/details/126253393
4:https://zhuanlan.zhihu.com/p/60266397
5:https://blog.csdn.net/weixin_37726222/article/details/124002454
6:https://blog.csdn.net/chenxijie1985/article/details/104595791
7:https://blog.csdn.net/skykingf/article/details/120701069
8:https://blog.51cto.com/u_15301988/5134287
9:https://www.bbsmax.com/A/kjdw4lyOzN/

安装参考文章也不一定一步下来就可以安装成功,反正见招拆招吧。

本文链接:https://my.lmcjl.com/post/8725.html

展开阅读全文

4 评论

留下您的评论.