fix(host): gpu probe miss 3d type gpu (#17805)

This commit is contained in:
wanyaoqi
2023-08-21 12:32:17 +08:00
committed by GitHub
parent c42f88642a
commit dd51418e45
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -2032,6 +2032,12 @@ func (h *SHostInfo) getNicsOvsOffloadInterfaces(nics []string) ([]isolated_devic
}
func (h *SHostInfo) probeSyncIsolatedDevices() (*jsonutils.JSONArray, error) {
for _, driver := range []string{"vfio", "vfio_iommu_type1", "vfio-pci"} {
if out, err := procutils.NewRemoteCommandAsFarAsPossible("modprobe", driver).Output(); err != nil {
log.Errorf("failed probe driver %s: %s %s", driver, out, err)
}
}
offloadNics, err := h.getNicsOvsOffloadInterfaces(options.HostOptions.OvsOffloadNics)
if err != nil {
return nil, err
+1 -1
View File
@@ -370,7 +370,7 @@ func (d *PCIDevice) IsBootVGA() (bool, error) {
}
func (d *PCIDevice) forceBindVFIOPCIDriver(useBootVGA bool) error {
if !utils.IsInStringArray(d.ClassCode, []string{CLASS_CODE_VGA, CLASS_CODE_VGA}) {
if !utils.IsInStringArray(d.ClassCode, []string{CLASS_CODE_VGA, CLASS_CODE_3D}) {
return nil
}
isBootVGA, err := d.IsBootVGA()