Skip to content

Commit

Permalink
Merge pull request #184 from lars-t-hansen/w-nobug-comment-fixes
Browse files Browse the repository at this point in the history
No bug: Clean up some comments
  • Loading branch information
lars-t-hansen committed Aug 27, 2024
2 parents afb8ee4 + a2c3b76 commit ab858a4
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit ab858a4

Please sign in to comment.