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

Implement MPS natively as in linux #807

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,9 @@ When running `kubernetes` with `CRI-O`, add the config file to set the
`crun` config file at `/etc/crio/crio.conf.d/10-crun.conf`:
```
[crio]

[crio.runtime]
default_runtime = "nvidia"

[crio.runtime.runtimes]

[crio.runtime.runtimes.nvidia]
runtime_path = "/usr/bin/nvidia-container-runtime"
runtime_type = "oci"
Expand Down Expand Up @@ -169,7 +166,6 @@ Done

> **WARNING:** *if you don't request GPUs when using the device plugin with NVIDIA images all
> the GPUs on the machine will be exposed inside your container.*

## Configuring the NVIDIA device plugin binary

The NVIDIA device plugin has a number of options that can be configured for it.
Expand Down Expand Up @@ -1048,4 +1044,4 @@ GPUs re-registering themselves automatically.

Upgrading the device plugin itself is a more complex task. It is recommended to
drain GPU tasks as we cannot guarantee that GPU tasks will survive a rolling
upgrade. However we make best efforts to preserve GPU tasks during an upgrade.
upgrade. However we make best efforts to preserve GPU tasks during an upgrade.
7 changes: 2 additions & 5 deletions cmd/mps-control-daemon/mps/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ func (m *Daemon) perDevicePinnedDeviceMemoryLimits() map[string]string {
if totalMemory == 0 {
continue
}
replicas := replicasPerDevice[index]
limits[index] = fmt.Sprintf("%vM", totalMemory/replicas/1024/1024)
limits[index] = fmt.Sprintf("%vM", totalMemory/1024/1024)
}
return limits
}
Expand All @@ -253,7 +252,5 @@ func (m *Daemon) activeThreadPercentage() string {
if len(m.Devices()) == 0 {
return ""
}
replicasPerDevice := len(m.Devices()) / len(m.Devices().GetUUIDs())

return fmt.Sprintf("%d", 100/replicasPerDevice)
return fmt.Sprintf("%d", 100)
}