When I use qemu-kvm to start a tdx-cvm and hope the tdx-cvm can use host GPU by VFIO passthrough:
$ /usr/libexec/qemu-kvm
... ...
-object iommufd,id=iommufd0
-device pcie-root-port,id=pci.1,bus=pcie.0
-device vfio-pci,host=28:00.0,bus=pci.1,iommufd=iommufd0 -fw_cfg name=opt/ovmf/X-PciMmio64,string=262144
... ...
An error occurres:
qemu-kvm: -device vfio-pci,host=28:00.0,bus=pci.1,iommufd=iommufd0: vfio 0000:28:00.0: vfio /sys/bus/pci/devices/0000:28:00.0/vfio-dev: failed to load "/sys/bus/pci/devices/0000:28:00.0/vfio-dev/vfio0/dev"
I have bound my host gpu to vfio on the host:
$ lspci -nnk -s 28:00.0
28:00.0 VGA compatible controller [0300]: NVIDIA Corporation AD102 [GeForce RTX 4090 D] [10de:2685] (rev a1)
Subsystem: LeadTek Research Inc. Device [107d:2685]
Kernel driver in use: vfio-pci
Kernel modules: nouveau
I can't seem to find the dev file in the /sys/bus/pci/devices/0000:28:00.0/vfio-dev/vfio0/ directory
$ ls -al /sys/bus/pci/devices/0000:28:00.0/vfio-dev/vfio0/
total 0
drwxr-xr-x 3 root root 0 Feb 21 14:23 .
drwxr-xr-x 3 root root 0 Feb 21 14:23 ..
lrwxrwxrwx 1 root root 0 Feb 21 15:10 device -> ../../../0000:28:00.0
drwxr-xr-x 2 root root 0 Feb 21 15:10 power
lrwxrwxrwx 1 root root 0 Feb 21 15:10 subsystem -> ../../../../../../../../../../class/vfio-dev
-rw-r--r-- 1 root root 4096 Feb 21 14:23 uevent
What exactly causes this error?