-
Notifications
You must be signed in to change notification settings - Fork 968
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
fix gpu memory allocation using vgpu-memory-percentage
#3466
base: master
Are you sure you want to change the base?
fix gpu memory allocation using vgpu-memory-percentage
#3466
Conversation
Welcome @abowloflrf! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
thanks for fixing that, we plan to test that function before officially release |
ok, i'll also add some ut for this pr later |
Signed-off-by: Ruofeng Lei <ruofenglei@outlook.com>
8e4abf6
to
54f9c44
Compare
ut added /cc @archlitchi |
@archlitchi Is this already supported? |
I've encountered this issue as well; why not merge this PR? |
@@ -356,7 +356,7 @@ func checkNodeGPUSharingPredicate(pod *v1.Pod, gssnap *GPUDevices, replicate boo | |||
continue | |||
} | |||
if val.MemPercentagereq != 101 && val.Memreq == 0 { | |||
val.Memreq = int32(gs.Device[i].Memory * uint(val.MemPercentagereq/100)) | |||
val.Memreq = int32(float64(gs.Device[i].Memory) * float64(val.MemPercentagereq) / 100.0) |
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 recommend using this implementation: val.Memreq = int32(gs.Device[i].Memory) * val.MemPercentagereq / 100
fix #3465
uint(val.MemPercentagereq/100)
could be0
. The memory result is always0
when using percentage to allocate memory.