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

No bug: Clean up some comments #184

Merged
merged 1 commit into from
Aug 27, 2024
Merged
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
10 changes: 6 additions & 4 deletions src/nvidia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,20 @@ pub fn get_nvidia_information(user_by_pid: &UserTable) -> Result<Vec<gpu::Proces
// `nvidia-smi pmon`. This output has a couple of problems:
//
// - it is (documented to be) not necessarily stable
// - it does not orphaned processes holding onto GPU memory, the way nvtop can do
// - it does not show orphaned processes holding onto GPU memory, the way nvtop can do
//
// To fix the former (in part), we parse the line that starts with '# gpu' to get field name
// indices, and then use those indices to fetch data.
//
// To fix the latter problem we do something with --query-compute-apps, see later.
//
// Note that `-c 1 -s u` gives us more or less instantaneous utilization, not some long-running
// Note that `-c 1 -s mu` gives us more or less instantaneous utilization, not some long-running
// average.
//
// TODO: We could consider using the underlying C library instead, but this adds a fair
// amount of complexity. See the nvidia-smi manual page.
// TODO: We could consider using the underlying C library instead, but this adds a fair amount of
// complexity. See https://docs.nvidia.com/deploy/nvml-api/index.html and the nvidia-smi manual
// page. This however looks like a bit of a nightmare: it is not installed by default, it must be
// downloaded as part of some cuda kit, the documentation appears to be not great.

const NVIDIA_PMON_COMMAND: &str = "nvidia-smi";
const NVIDIA_PMON_ARGS: &[&str] = &["pmon", "-c", "1", "-s", "mu"];
Expand Down
Loading