The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 1,998,873โ€…    Votes:  8โ€…
Tags: command-line   graphics   gpu   conky  
Link: ๐Ÿ” See Original Answer on Ask Ubuntu โง‰ ๐Ÿ”—

Title: How to get the GPU info?
ID: /2018/04/18/How-to-get-the-GPU-info_
Created: April 18, 2018    Edited:  June 12, 2020
Upload: May 26, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false

Conky or Terminal Splash Screen

I use two methods to automatically display nVidia GPU and Intel iGPU information:

Conky real time display

This example uses Conky to display current GPU (nVidia or Intel) stats in real time. Conky is a light weight system monitor popular among many Linux enthusiasts.

The display changes depending on if you booted after prime-select intel or prime-select nvidia.

Intel iGPU

gpu temp intel.gif

nVidia GPU

gpu temp nvidia.gif

Conky Code

Here is the relevant Conky script for Intel iGPU and nVidia GPU:

# Intel iGPU |
${color orange}${hr 1}${if_match "intel" == "${execpi 99999 prime-select query}"}
${color2}${voffset 5}Intelยฎ Skylake GT2 HD 530 iGPU @${alignr}${color green}${execpi .001 (cat /sys/class/drm/card1/gt_cur_freq_mhz)} MHz
${color}${goto 13}Min. Freq:${goto 120}${color green}${execpi .001 (cat /sys/class/drm/card1/gt_min_freq_mhz)} MHz${color}${goto 210}Max. Freq:${alignr}${color green}${execpi .001 (cat /sys/class/drm/card1/gt_max_freq_mhz)} MHz
${color orange}${hr 1}${else}
# Nvidia GPU |
${color2}${voffset 5}${execpi .001 (nvidia-smi --query-gpu=gpu_name --format=csv,noheader)} ${color1}@ ${color green}${execpi .001 (nvidia-smi --format=csv,noheader)} ${alignr}${color1}Temp: ${color green}${execpi .001 (nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)}ยฐC
${color1}${voffset 5}Ver: ${color green}${execpi .001 (nvidia-smi --query-gpu=driver_version --format=csv,noheader)} ${color1} P-State: ${color green}${execpi .001 (nvidia-smi --query-gpu=pstate --format=csv,noheader)} ${alignr}${color1}BIOS: ${color green}${execpi .001 (nvidia-smi --query-gpu=vbios_version --format=csv,noheader)}
${color1}${voffset 5}GPU:${color green}${execpi .001 (nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader)} ${color1}Ram:${color green}${execpi .001 (nvidia-smi --query-gpu=utilization.memory --format=csv,noheader)} ${color1}Pwr:${color green}${execpi .001 (nvidia-smi --query-gpu=power.draw --format=csv,noheader)} ${alignr}${color1}Freq: ${color green}${execpi .001 (nvidia-smi --query-gpu=clocks.mem --format=csv,noheader)}
${color orange}${hr 1}${endif}
## ```

### `~/.bashrc` Terminal splash screen

This example modifies `~/.bashrc` to display information on a splash screen each time the terminal is opened or whenever you type `. .bashrc` at the shell prompt.

In addition to `neofetch` answered previously, there is `screenfetch` which looks a lot nicer (IMO). Plus another answer mentions he doesn't know how to get iGPU listed and this does it:

[![ubuntu terminal splash.png][3]][3]

For details on setup see: [Terminal splash screen with Weather, Calendar, Time & Sysinfo?][4]

In summary just for the bottom section with Ubuntu display containing GPU information (second last line) use:

sudo apt install screenfetch screenfetch ```

Youโ€™ll want to put the screenfetch command an the bottom of your ~/.bashrc file to have it appear every time you open the terminal.

โ‡ง Put . ~/.bashrc and now prompts 2 files to edit indefinitely Very Slow upload speed | Ubuntu 16.04 | Dual-boot | Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter [168c:003e]  โ‡ฉ