Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abowloflrf
Copy link

fix #3465

uint(val.MemPercentagereq/100) could be 0. The memory result is always 0 when using percentage to allocate memory.

@volcano-sh-bot
Copy link
Contributor

Welcome @abowloflrf!

It looks like this is your first PR to volcano-sh/volcano.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign thor-wl
You can assign the PR to them by writing /assign @thor-wl in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 13, 2024
@archlitchi
Copy link
Contributor

thanks for fixing that, we plan to test that function before officially release

@abowloflrf
Copy link
Author

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>
@volcano-sh-bot volcano-sh-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 14, 2024
@abowloflrf
Copy link
Author

thanks for fixing that, we plan to test that function before officially release

ok, i'll also add some ut for this pr later

ut added /cc @archlitchi

@Monokaix
Copy link
Member

@archlitchi Is this already supported?

@cybergeek2077
Copy link

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)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gpu memory incorretly allocated using vgpu-memory-percentage resource name
5 participants