mdevctl用来管理nVidia vgpu超赞,但官方不支持使用centos7。因此我写一篇教程讲讲怎么样才能在centos7使用mdevctl

更新git

centos7默认的git版本太低,不适合编译:

yum install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install git

准备rust的环境

安装 rust 编译器

curl https://sh.rustup.rs -sSf | sh -s -- -y

现在让 rust 二进制文件在你的 $PATH 中可用(你只需要在安装 rust 后第一次这样做)

source $HOME/.cargo/env

安装rst2man

需要安装python-docutils包,这里面带了rst2man

yum install python-docutils

使用

which rst2man

确认系统内安装了rst2man

获取文件

git clone https://github.com/mdevctl/mdevctl

进入mdevctl目录并编译库。取决于您的硬件和互联网连接,这可能需要一段时间

cd mdevctl/
cargo build --release

编译完成的二进制文件在/root/mdevctl/target/release
运行make rpm生成RPM文件,运行make install进行安装。

从源安装

执行命令就行了。

cargo install mdevctl

但从源安装的没法用,会报错:

mdevctl Error: No such file or directory (os error 2)

测试

mdevctl types
mdevctl list -d

最后修改:2023 年 06 月 22 日
如果觉得我的文章对你有用,请随意赞赏