From f8ac80b7a04bb8a5c2885a1fcab1bbc278a132ca Mon Sep 17 00:00:00 2001 From: wanyaoqi Date: Tue, 16 Apr 2024 15:50:55 +0800 Subject: [PATCH] fix(host): fix gpu device vendor check strategy Check gpu device vendor id on class code is DISPLAY. Signed-off-by: wanyaoqi --- pkg/hostman/isolated_device/gpu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hostman/isolated_device/gpu.go b/pkg/hostman/isolated_device/gpu.go index e41d21670d..27c86cb6cc 100644 --- a/pkg/hostman/isolated_device/gpu.go +++ b/pkg/hostman/isolated_device/gpu.go @@ -95,7 +95,7 @@ func getPassthroughGPUs(filteredAddrs []string, enableWhitelist bool, whitelistM if !utils.IsInArray(dev.ClassCode, GpuClassCodes) { continue } - if !utils.IsInStringArray(dev.VendorId, []string{api.NVIDIA_VENDOR_ID, api.AMD_VENDOR_ID}) { + if dev.ClassCode == CLASS_CODE_DISP && !utils.IsInStringArray(dev.VendorId, []string{api.NVIDIA_VENDOR_ID, api.AMD_VENDOR_ID}) { log.Infof("Skip add device %s vendor is unsupport", dev.Addr) continue }