Skip to content

Conversation

@airvzxf
Copy link

@airvzxf airvzxf commented Nov 25, 2025

Description

This PR implements the “Effective Load” metric discussed in Issue #422.

The goal is to provide a more realistic representation of GPU usage by weighting the GPU Load against the current power consumption relative to the TDP.

Technical Implementation

1. Data Extraction (extract_gpuinfo.c)
I added a helper function calculate_effective_load that runs after the standard dynamic info refresh.

  • Logic: Effective Load = GPU_Util_Rate * (Power_Draw / Power_Draw_Max)
  • Safety: The calculation is strictly conditional. It only executes if power_draw, power_draw_max, and gpu_util_rate are valid and greater than zero. If the driver (e.g., some AMD/Intel implementations) does not provide Power_Draw_Max, the field remains unset/invalid.

2. Interface (interface.c)

  • Added a new text field in the device header: Eff. XX%.
  • This field is positioned after the power metrics.
  • If the data is unavailable, it displays Eff. N/A.

3. Plotting & Options (interface_options.c, interface_setup_win.c)

  • Added plot_effective_load_rate to the plotting enum.
  • Users can now select “Effective load rate” in the Setup Menu (F2) to visualize this metric over time in the main graph.

Screenshots

nvtop-new-feat-effctive

Testing

I have tested this on my local machine.

  • Scenario: High GPU load reported but low-power consumption -> Effective Load correctly shows a low percentage.
  • Scenario: Stress test (high load + high power) -> Effective load converges with standard GPU load.

I look forward to your feedback.

Introduces a new 'Effective Load' metric, calculated as GPU Load weighted by power consumption (Current Power / Max Power). This provides a more accurate representation of hardware throughput, especially in low P-States.

- Updates 'gpuinfo_dynamic_info' to store effective_load_rate.

- Implements calculation logic in 'extract_gpuinfo.c'.

- Adds 'Eff. Load' display to the device header in the ncurses interface.

- Adds 'Effective load rate' as a selectable metric in the Chart setup menu and handles config persistence.
@airvzxf
Copy link
Author

airvzxf commented Nov 26, 2025

I noticed a defect/oversight in this initial implementation.

Before I push the fix and polish the code, I wanted to confirm if the “effective load” concept is something you are interested in merging. If the feature aligns with your goals for nvtop, please let me know, and I will resolve the issue immediately.

Defect: shows RAM.
Screenshot_2025-11-26_16-35-55

Release and stable version: shows GPU memory.
Screenshot_2025-11-26_16-36-10

@airvzxf
Copy link
Author

airvzxf commented Nov 27, 2025

Update regarding the defect I mentioned:

Good news: I performed a clean fetch of master and confirmed that the issue is pre-existing and unrelated to my changes in this PR.

I tracked down the regression to commit d955f94 (specifically in extract_gpuinfo_nvidia.c), where it seems system RAM is being reported instead of GPU memory.

Specifically, the logic change here seems to be the culprit:

} else {
// Memory query failed - likely unified memory GPU
has_unified_memory = true;
}

I will open a separate issue to track that bug so we can keep this PR focused on the “Effective Load” feature.

@airvzxf
Copy link
Author

airvzxf commented Nov 27, 2025

I added a follow-up commit to clamp the effective load value to 100%.

I realized that during transient power spikes or scenarios where power limits are raised (overclocking), the Current Power can slightly exceed the reported Max Power. This fix ensures the plotting logic stays within valid bounds to prevent visual glitches in the graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant