GPT-5 Devs - GPU Viewer
Note: This is based on the chat we had during the .NET & AI Community StandUp show with the author here (https://www.youtube.com/watch?v=ptdNWGj8CN8) The original GPU viewer is this one: https://github.com/tjwald/nvsharptop The full list of resources are here: https://learn.microsoft.com/collections/yjwzhet31ez28w
This small console app queries local NVIDIA GPUs via nvidia-smi and renders a live terminal UI using Spectre.Console.
Quick start
dotnet run --project ConsoleGpuViewer\ConsoleGpuViewer.csproj -- --sample-interval 0.1 --display-interval 0.5 --cleanup-screen truePublish (single-file Windows x64)
dotnet publish ConsoleGpuViewer\ConsoleGpuViewer.csproj -c Release -r win-x64 --self-contained false /p:PublishSingleFile=trueInteractive controls
-
Press
Sto start / pause -
Press
SorEnterto start / pause -
Press
Qto quit -
Press
Hto switch to Horizontal view -
Press
Vto switch to Vertical view -
Press
Wto toggle Star Wars Mode (animated Star Wars intro crawl of GPU stats) -
Start-screen interactive options
-
Before pressing
Syou can change some options directly on the welcome/start screen. These mirror CLI flags and will be applied when monitoring starts:Ctoggle compact layout (--compact)Atoggle animate mode (--animate)Bcycle background glyph (--bg-glyph)Ptoggle pixel-graded mode (--pixel)- Left / Right arrows decrease / increase
--sample-intervalby 0.1s - Down / Up arrows decrease / increase
--display-intervalby 0.5s
You can still pass all the same options on the command line; the start screen simply provides a quick interactive way to change them before starting.
Default view
- The default view is now Vertical. Toggle to Horizontal on the welcome screen before starting or while running using
H/V.
- Continuous vertical bar: the Vertical view now renders per-timestamp columns adjacent to each other (no extra spacer), producing a continuous vertical history bar. This makes it easier to visually read utilization/memory trends across time.
- Y-axis labels on every row: the percent labels on the Y axis now appear on every row (previously they appeared on every other row). The label width is 5 characters (e.g.
100%) to align the chart grid. - Tick density: because columns are now 1-character wide in the Vertical view, timestamp labels along the X axis are condensed. The renderer attempts to center short time labels under groups; if you prefer more readable timestamps, increase the console width or use a larger
display-intervalso fewer groups are shown.
Options of interest
--sample-interval <seconds>: sampling frequency (default1.0) ----display-interval <seconds>: how often the UI aggregates samples and refreshes (default0.5)--compact: use a denser compact layout with smaller spacers between timestamp groups--animate: render at the sample rate (smooth scrolling) instead of the display interval--bar-char <char>: choose the character used for solid bars (default█)--util-high <int>: utilization percentage threshold that renders red (default90)--util-warn <int>: utilization percentage threshold that renders yellow (default70)--bg-glyph <space|dot|shade>: background glyph when a cell is empty (defaultshade)--pixel <true|false>: enable pixel-graded bar mode using Unicode fractional blocks for partial-row fills
Default vertical view settings
Verticalview is the default and the default configuration used when you start without interactive changes:--sample-interval:1.0seconds--display-interval:0.5seconds--compact:false--animate:false--bar-char:█--util-high:90--util-warn:70--bg-glyph:shade--pixel:false
Example with new options
dotnet run --project ConsoleGpuViewer\ConsoleGpuViewer.csproj -- --sample-interval 0.2 --display-interval 1 --bg-glyph dot --pixel trueNotes
- Requires
nvidia-smito be available in PATH (NVIDIA drivers). - The app targets
net10.0. - Use a Unicode-capable terminal for best visual results.