-
Notifications
You must be signed in to change notification settings - Fork 418
Add VFIO Validation for vgpu-device-manager #1877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5b9600e to
4b9f067
Compare
cmd/nvidia-validator/main.go
Outdated
| return fmt.Errorf("error checking for GPU devices on the host: %w", err) | ||
| } | ||
| for _, device := range GPUDevices { | ||
| if device.SriovInfo.PhysicalFunction == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if device.SriovInfo.PhysicalFunction == nil { | |
| if device.SriovInfo == nil || device.SriovInfo.PhysicalFunction == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this would work as device.SriovInfo is a struct value (with type SriovInfo) and not a pointer, so it cannot be nil.
cmd/nvidia-validator/main.go
Outdated
| totalVF := int(device.SriovInfo.PhysicalFunction.TotalVFs) | ||
| if totalVF > 0 { | ||
| log.Infof("Found GPU device with SR-IOV VFs: %s (TotalVFs: %d)", device.Address, totalVF) | ||
| return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we returning early here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If VFIO is enabled, than we wouldn't need to execute the rest of the function (and we would error by default when looking for mdev devices). That's why we would return early if VF exist. if VFIO is not enabled, there would be devices under mdevBusPath := "/sys/class/mdev_bus" and we would not enter into this for loop. Instead we would follow the earlier verification code.
4b9f067 to
9be6269
Compare
9be6269 to
9fd7799
Compare
Signed-off-by: Arjun <[email protected]>
9fd7799 to
bc1d2f4
Compare
No description provided.