2.vgpu改直通
先关闭vGPU
# lspci -DD|grep NVIDIA
0000:3b:00.0 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:00.4 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:00.5 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:00.6 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:00.7 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.0 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.1 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.2 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.3 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.4 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.5 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.6 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:01.7 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.0 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.1 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.2 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.3 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.4 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.5 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.6 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:02.7 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.0 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.1 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.2 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.3 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.4 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.5 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.6 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:03.7 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:04.0 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:04.1 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:04.2 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:3b:04.3 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:af:00.0 VGA compatible controller: NVIDIA Corporation Device 2208 (rev a1)
0000:af:00.1 Audio device: NVIDIA Corporation GA102 High Definition Audio Controller (rev a1)
## 关闭vGPU
# systemctl stop nvidia-vgpu-mgr.service
# /usr/lib/nvidia/sriov-manage -d ALL
# lspci -DD|grep NVIDIA
0000:3b:00.0 3D controller: NVIDIA Corporation GA102GL (rev a1)
0000:af:00.0 VGA compatible controller: NVIDIA Corporation Device 2208 (rev a1)
0000:af:00.1 Audio device: NVIDIA Corporation GA102 High Definition Audio Controller (rev a1)
echo 0000:3b:00.0 > /sys/bus/pci/drivers/nvidia/unbind
echo "vfio-pci" > /sys/bus/pci/devices/0000\:3b\:00.0/driver_override
echo 0000:3b:00.0 > /sys/bus/pci/drivers/vfio-pci/bind
# lspci -nnk -d 10de:
3b:00.0 3D controller [0302]: NVIDIA Corporation GA102GL [10de:2236] (rev a1)
Subsystem: NVIDIA Corporation Device [10de:1482]
Kernel driver in use: vfio-pci
Kernel modules: nouveau, nvidia_vgpu_vfio, nvidia
af:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2208] (rev a1)
Subsystem: ASUSTeK Computer Inc. Device [1043:884c]
Kernel driver in use: vfio-pci
Kernel modules: nouveau, nvidia_vgpu_vfio, nvidia
af:00.1 Audio device [0403]: NVIDIA Corporation GA102 High Definition Audio Controller [10de:1aef] (rev a1)
Subsystem: ASUSTeK Computer Inc. Device [1043:884c]
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
接下来的kubevirt cr的配置,参考开启vGPU"
- 如果又想将直通改回成 vGPU,则需要解绑直通,并重新启动vGPU服务即可