Does a GPU usage graph for AMD exist? [SO SOLVED :D]

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 2:37 pm Ok... then remove this line from the bash script
echo "\${execgraph \"echo $gpu\" 005500 009900 scale -t}"

And add this in the conky just below the execution of the script.

Code: Select all

${execgraph "echo $(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}')" 005500 009900 scale -t}"
If this doesn't work, i'm out of ideas...
YOU ARE LIKE UNTO A GOD!!!!

as I type this my gpu graph is populating the graph box from right to left every 5 seconds!

The bars are green, is there any way to control the color, or preferably set 2 colors for gradient like my other graphs?

example: ${cpugraph cpu1 40,350 ffff00 ff0000}
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Lookit this :)


Image
Last edited by Logansfury on Wed Mar 20, 2024 4:44 pm, edited 1 time in total.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

RTFM! https://conky.sourceforge.net/variables.html

But for your info... remove the scale -t for gradient colors and what do you think these numbers are for??
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 2:57 pm RTFM! https://conky.sourceforge.net/variables.html

But for your info... remove the scale -t for gradient colors and what do you think these numbers are for??
The scale -t threw me. Now that I look at the code more closely I see the number blocks are 6 digits each. Pretty clearly color codes now that I realize what I'm looking at.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

The gradient is working perfectly and the graph looks beautiful with the rest of the conky graphs.

There seems to be a stray period or comma mark by the graph however. I have checked all the codes but I dont see any stray characters to account for it.

Image
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

Logansfury wrote: Wed Mar 20, 2024 3:18 pm There seems to be a stray period or comma mark by the graph however. I have checked all the codes but I dont see any stray characters to account for it.
Without you posting the conky config, i have no idea what you did... i gave up mind reading a long time ago!
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 5:33 pm
Logansfury wrote: Wed Mar 20, 2024 3:18 pm There seems to be a stray period or comma mark by the graph however. I have checked all the codes but I dont see any stray characters to account for it.
Without you posting the conky config, i have no idea what you did... i gave up mind reading a long time ago!
Glad to oblige. Here is the final conky with working GPU graph:

conkyrc

Code: Select all

conky.config = {
	alignment = 'top_left',
	gap_x = 56,
	gap_y = 156,
	xinerama_head = 1,
    background = true,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'gray',
    default_outline_color = 'black',
    default_shade_color = 'white',
    color0 = '#ffffff',
    color1 = '#ff0000',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = true,
    draw_shades = false,
    extra_newline = false,
    font = 'Neon 80s:size=10',
    minimum_height = 260,
    minimum_width = 356,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_type = 'desktop',
    own_window_hints ='undecorated,sticky,skip_taskbar,skip_pager,below',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
   default_graph_height = 40,
   default_graph_width = 350
}

conky.text = [[

${color1}GPU» ${hr}
${execpi 5 ./radeontop.sh}
${execgraph "echo $(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}')" ffff00 ff0000}"
]]
Here is the bash script that populates the display:

radeontop.sh

Code: Select all

#!/bin/bash

rm -f ./radeontop.dump
radeontop -l1 -d ./radeontop.dump > /dev/null
wait
sed -i 's/, /\n/g' ./radeontop.dump

gpu=$(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}')
vgt=$(cat ./radeontop.dump | grep 'vgt' | awk '{print $2}')
ta=$(cat ./radeontop.dump | grep 'ta' | awk '{print $2}')
sx=$(cat ./radeontop.dump | grep 'sx' | awk '{print $2}')
sc=$(grep -w 'sc' ./radeontop.dump | awk '{print $2}')
spi=$(cat ./radeontop.dump | grep 'spi' | awk '{print $2}')
pa=$(cat ./radeontop.dump | grep 'pa' | awk '{print $2}')
db=$(cat ./radeontop.dump | grep 'db' | awk '{print $2}')
cb=$(cat ./radeontop.dump | grep 'cb' | awk '{print $2}')
vram=$(cat ./radeontop.dump | grep 'vram' | awk '{print $2" "$3}')
gtt=$(cat ./radeontop.dump | grep 'gtt' | awk '{print $2" "$3}')
mclk=$(cat ./radeontop.dump | grep 'mclk' | awk '{print $2" "$3}')
sclk=$(cat ./radeontop.dump | grep 'sclk' | awk '{print $2" "$3}')


echo "\${color red}GPU brand: \${color white}\${alignr}Advanced Micro Devices, Inc. [AMD/ATI]"
echo "\${color red}GPU model: \${color white}\${alignr}Cape Verde PRO [Radeon HD 7750]"
echo "\${color red}Graphics Pipe: \${color white}\${alignr}$gpu"
echo "\${color red}Vertex Grouper + Tesselator: \${color white}\${alignr}$vgt"
echo "\${color red}Texture Addresser: \${color white}\${alignr}$ta"
echo "\${color red}Shader Export: \${color white}\${alignr}$sx"
echo "\${color red}Shader Interpolator: \${color white}\${alignr}$spi"
echo "\${color red}Scan Converter: \${color white}\${alignr}$sc"
echo "\${color red}Primitive Assembly: \${color white}\${alignr}$pa"
echo "\${color red}Depth Block: \${color white}\${alignr}$db"
echo "\${color red}Color Block: \${color white}\${alignr}$cb"
echo "\${color red}Virtual RAM: \${color white}\${alignr}$vram of 868mb"
echo "\${color red}GTT: \${color white}\${alignr}$gtt of 16005mb"
echo "\${color red}Memory Clock: \${color white}\${alignr}$mclk of 0.80ghz"
echo "\${color red}Shader Clock: \${color white}\${alignr}$sclk of 0.80ghz"
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

Change these lines in your bash script

Code: Select all

gpu=$(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}'); gpu=${gpu:0:-1}

Code: Select all

echo "\${color red}Graphics Pipe: \${color white}\${alignr}$gpu%"
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 5:49 pm Change these lines in your bash script

Code: Select all

gpu=$(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}'); gpu=${gpu:0:-1}

Code: Select all

echo "\${color red}Graphics Pipe: \${color white}\${alignr}$gpu%"
I edited both lines, everything is still working fine but that pesky dot is still visible
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

And it isn't some pixels from your background image??
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 6:48 pm And it isn't some pixels from your background image??
I just toggled the widget on and off and the dot definitely comes and goes with the conky
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

Logansfury wrote: Wed Mar 20, 2024 5:41 pm conkyrc

Code: Select all

conky.config = {
	alignment = 'top_left',
	gap_x = 56,
	gap_y = 156,
	xinerama_head = 1,
    background = true,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'gray',
    default_outline_color = 'black',
    default_shade_color = 'white',
    color0 = '#ffffff',
    color1 = '#ff0000',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = true,
    draw_shades = false,
    extra_newline = false,
    font = 'Neon 80s:size=10',
    minimum_height = 260,
    minimum_width = 356,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_type = 'desktop',
    own_window_hints ='undecorated,sticky,skip_taskbar,skip_pager,below',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
   default_graph_height = 40,
   default_graph_width = 350
}

conky.text = [[

${color1}GPU» ${hr}
${execpi 5 ./radeontop.sh}
${execgraph "echo $(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}')" ffff00 ff0000}"
]]
On the last line there needs to be a semicolon! ]];
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 7:19 pm on the last line there needs to be a semicolon! ]];
I think I removed that while trying to figure out where the pixel was coming from.

Anyhow, I just restored the semicolon and the dot from hell is still there
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

Ok, out of ideas at the moment..
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 7:28 pm Ok, out of ideas at the moment..
It's definitely puzzling, I thought there would be an obvious out of place punctuation mark.

Well the GPU graph is absolutely beautiful, it fits/matches all the other conky graphs and it brings the GPU widget to life.

I'm thrilled you were able to script this and i'm not going to let a stray pixel ruin my good time.

As a test in a bit I will make another graph and see if the same pixel appears
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Does a GPU usage graph for AMD exist?

Post by Koentje »

The graph looks even better if you fix the sysfs system... were you can cat the files!
Radeontop makes it all very slow!
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

Koentje wrote: Wed Mar 20, 2024 7:48 pm The graph looks even better if you fix the sysfs system... were you can cat the files!
Radeontop makes it all very slow!
That sounds like a good project to do after some rest.

Hey!

Check out the bash script routines I just set up with scripts to capture millimeter dimensions and convert them into inches:

mon1size.sh

Code: Select all

#!/bin/bash

# Run xrandr --props and search for the section related to HDMI-A-0
xrandr_output=$(xrandr --props)
hdmi_info=$(echo "$xrandr_output" | grep -A1 -i "HDMI-A-0")

# Check if HDMI-A-0 is disconnected
if [[ $hdmi_info == *"disconnected"* ]]; then
    echo "No monitor detected"
else
    # Extract the resolution information (in mm)
    resolution_mm=$(echo "$hdmi_info" | grep -oE '[0-9]{3,4}mm x [0-9]{3,4}mm')

    # Extract width and height in mm
    width_mm=$(echo "$resolution_mm" | cut -d ' ' -f1)
    height_mm=$(echo "$resolution_mm" | cut -d ' ' -f3)

    # Remove "mm" suffix
    width_mm=${width_mm%mm}
    height_mm=${height_mm%mm}

    # Calculate diagonal size in inches
    diagonal_mm=$(bc <<< "scale=2; sqrt($width_mm^2 + $height_mm^2)")
    diagonal_inches=$(bc <<< "scale=2; $diagonal_mm / 25.4")

    echo "$diagonal_inches\""
fi
launched by conkyrc:

Code: Select all

conky.text = [[
${color1}${goto 35}Monitor 3 Size: ${alignr}${color0}${execpi 3600 ./mon3size.sh}
]];
Ive 3 bash scripts and 3 lines to execpi 3600 them for data display. It worked perfectly!

Some of what youve taught me is sticking!
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Does a GPU usage graph for AMD exist?

Post by Logansfury »

The stray character has been resolved!

It was an "

Code: Select all

conky.text = [[

${color1}GPU» ${hr}
${execpi 5 ./radeontop.sh}
${execgraph "echo $(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}')" ffff00 ff0000}"
]];
When I looked closer at the execgraph line I counted 3 double-quotes and realized the " at the end was NOT part of the code. I made the simple edit:

Code: Select all

conky.text = [[

${color1}GPU» ${hr}
${execpi 5 ./radeontop.sh}
${execgraph "echo $(cat ./radeontop.dump | grep 'gpu' | awk '{print $2}')" ffff00 ff0000}
]];
and the stray double-quote character is gone. Display is now perfect :)
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”