[PLUGIN] GPU Statistics


Recommended Posts

Hi,

 

Here you have:

 

nvidia-smi -q -x -g 0 | grep clocks_
        <clocks_event_reasons>
            <clocks_event_reason_gpu_idle>Not Active</clocks_event_reason_gpu_idle>
            <clocks_event_reason_applications_clocks_setting>Not Active</clocks_event_reason_applications_clocks_setting>
            <clocks_event_reason_sw_power_cap>Not Active</clocks_event_reason_sw_power_cap>
            <clocks_event_reason_hw_slowdown>Not Active</clocks_event_reason_hw_slowdown>
            <clocks_event_reason_hw_thermal_slowdown>Not Active</clocks_event_reason_hw_thermal_slowdown>
            <clocks_event_reason_hw_power_brake_slowdown>Not Active</clocks_event_reason_hw_power_brake_slowdown>
            <clocks_event_reason_sync_boost>Not Active</clocks_event_reason_sync_boost>
            <clocks_event_reason_sw_thermal_slowdown>Not Active</clocks_event_reason_sw_thermal_slowdown>
            <clocks_event_reason_display_clocks_setting>Not Active</clocks_event_reason_display_clocks_setting>
        </clocks_event_reasons>

Link to comment
43 minutes ago, vmonjo said:

Hi,

 

Here you have:

 

nvidia-smi -q -x -g 0 | grep clocks_
        <clocks_event_reasons>
            <clocks_event_reason_gpu_idle>Not Active</clocks_event_reason_gpu_idle>
            <clocks_event_reason_applications_clocks_setting>Not Active</clocks_event_reason_applications_clocks_setting>
            <clocks_event_reason_sw_power_cap>Not Active</clocks_event_reason_sw_power_cap>
            <clocks_event_reason_hw_slowdown>Not Active</clocks_event_reason_hw_slowdown>
            <clocks_event_reason_hw_thermal_slowdown>Not Active</clocks_event_reason_hw_thermal_slowdown>
            <clocks_event_reason_hw_power_brake_slowdown>Not Active</clocks_event_reason_hw_power_brake_slowdown>
            <clocks_event_reason_sync_boost>Not Active</clocks_event_reason_sync_boost>
            <clocks_event_reason_sw_thermal_slowdown>Not Active</clocks_event_reason_sw_thermal_slowdown>
            <clocks_event_reason_display_clocks_setting>Not Active</clocks_event_reason_display_clocks_setting>
        </clocks_event_reasons>

Just release 2023.06.10 with fixes.

Link to comment

Thanks for this cool plugin.  I just updated it yesterday to the newest version.

 

Minor issue(s), The Power Draw graph is always at 100% no matter the amount of power being used by the Intel GPU.  The numbers in watts change next to the graph, but the graph always stays at 100%.

 

Also, the Blitter Load never seems to change.  Is that measurable on my system?

 

 SuperMicro X11SCZ-F, Xeon E-2288G, with unRAID 6.12.0.  GPU Statistics 2023.06.10.

 

image.png.23205622675ccf6e2691cb2eb8ad3fc5.png

 

image.png.22a6e6223c774182e69a7fbe41a687af.png

 

root@unRAID:~# timeout -k .500 .400 intel_gpu_top -J -s 250

{
        "period": {
                "duration": 14.276773,
                "unit": "ms"
        },
        "frequency": {
                "requested": 0.000000,
                "actual": 0.000000,
                "unit": "MHz"
        },
        "interrupts": {
                "count": 0.000000,
                "unit": "irq/s"
        },
        "rc6": {
                "value": 0.000000,
                "unit": "%"
        },
        "power": {
                "GPU": 0.000000,
                "Package": 75.122702,
                "unit": "W"
        },
        "imc-bandwidth": {
                "reads": 5214.525316,
                "writes": 1257.441683,
                "unit": "MiB/s"
        },
        "engines": {
                "Render/3D/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                },
                "Blitter/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                },
                "Video/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                },
                "VideoEnhance/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                }
        },
        "clients": {

        }
}
{
        "period": {
                "duration": 262.660651,
                "unit": "ms"
        },
        "frequency": {
                "requested": 0.000000,
                "actual": 0.000000,
                "unit": "MHz"
        },
        "interrupts": {
                "count": 11.421581,
                "unit": "irq/s"
        },
        "rc6": {
                "value": 0.000000,
                "unit": "%"
        },
        "power": {
                "GPU": 0.004647,
                "Package": 37.973180,
                "unit": "W"
        },
        "imc-bandwidth": {
                "reads": 5000.416753,
                "writes": 611.634141,
                "unit": "MiB/s"
        },
        "engines": {
                "Render/3D/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                },
                "Blitter/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                },
                "Video/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                },
                "VideoEnhance/0": {
                        "busy": 0.000000,
                        "sema": 0.000000,
                        "wait": 0.000000,
                        "unit": "%"
                }
        },
        "clients": {

        }
}root@unRAID:~# 

 

root@unRAID:~# cd /usr/local/emhttp/plugins/gpustat/ && php ./gpustatus.php
Array
(
    [code] => 200
    [message] => Configuration file contains invalid settings.
    [extra] => 
)
root@unRAID:/usr/local/emhttp/plugins/gpustat#

 

MULTIGPU = "00:02.0"
TEMPFORMAT = "C"
UIREFRESH = 1
UIREFRESHINT = 1000
DISPCLOCKS = 1
DISPPCIUTIL = 1
DISPPWRDRAW = 1
DISPPWRSTATE = 1
DISPMEMUTIL = 0
DISPTEMP = 0
DISPFAN = 0
DISPENCDEC = 0
DISPTHROTTLE = 0
DISPSESSIONS = 0
DISP3DRENDER = 1
DISPBLITTER = 1
DISPVIDEO = 1
DISPVIDENH = 1
DISPINTERRUPT = 1
DISPPWRDRWSEL = "GPU"
DISPEVENT = 0
DISPVERTEX = 0
DISPTEXTURE = 0
DISPSHADEREXP = 0
DISPSEQUENCER = 0
DISPSHADERINTER = 0
DISPSCANCON = 0
DISPPRIMASSEM = 0
DISPDEPTHBLK = 0
DISPCOLORBLK = 0
DISPGFXTRANS = 0
MULTIGPUJSON = "%7B%2200%3A02.0%22%3A%7B%22id%22%3A%2200%3A02.0%22%2C%22model%22%3A%22Coffee+Lake-S+GT2+%5BUHD+Graphics+P630%5D%22%2C%22vendor%22%3A%22intel%22%2C%22guid%22%3A%220000%3A00%3A02.0%22%7D%7D"

 

Thanks again!

Edited by craigr
Link to comment
11 minutes ago, craigr said:
root@unRAID:~# cd /usr/local/emhttp/plugins/gpustat/ && php ./gpustatus.php
Array
(
    [code] => 200
    [message] => Configuration file contains invalid settings.
    [extra] => 
)
root@unRAID:/usr/local/emhttp/plugins/gpustat#

You need to look at gpustatusmulti.php for > 6.12

 

I do create a json file in /tmp/ with the values being passed to the panel. Will look at the bar.

 

root@computenode:/mnt/user/appdata/tasmotapm-unraid# cat /tmp/gpu*
Time = Sat, 17 Jun 2023 07:14:46 +0100
{"00:02.0":{"clock":0,"fan":"N\/A","memclock":"N\/A","memutil":"N\/A","memused":"N\/A","power":"0W","powermax":"N\/A","rxutil":"N\/A","txutil":"N\/A","temp":"N\/A","tempmax":"N\/A","util":"0%","vendor":"Intel","name":"AlderLake-S GT1","3drender":"0%","blitter":"0%","interrupts":0,"powerutil":"0%","video":"0%","videnh":"0%","panel":1},"09:00.0":{"clock":"324","fan":"30%","memclock":"324","memutil":"0%","memused":"1","power":"8W","powermax":"87","rxutil":"N\/A","txutil":"N\/A","temp":"37 \u00b0C","tempmax":"101 \u00b0C","util":"0%","vendor":"NVIDIA","name":"Quadro K4000","clockmax":"810","memclockmax":"2808","memtotal":"3018","encutil":"0%","decutil":"0%","pciemax":250,"perfstate":"P8","throttled":"Yes","thrtlrsn":" (gpu_idle)","pciegen":1,"pciegenmax":2,"pciewidth":1,"pciewidthmax":16,"sessions":0,"uuid":"GPU-ef6c0299-f1bc-7b5c-5291-7cd1a012f8bd","plexusing":false,"plexmem":0,"plexcount":0,"jellyfinusing":false,"jellyfinmem":0,"jellyfincount":0,"handbrakeusing":false,"handbrakemem":0,"handbrakecount":0,"embyusing":false,"embymem":0,"embycount":0,"tdarrusing":false,"tdarrmem":0,"tdarrcount":0,"unmanicusing":false,"unmanicmem":0,"unmaniccount":0,"dizquetvusing":false,"dizquetvmem":0,"dizquetvcount":0,"ersatztvusing":false,"ersatztvmem":0,"ersatztvcount":0,"fileflowsusing":false,"fileflowsmem":0,"fileflowscount":0,"frigateusing":false,"frigatemem":0,"frigatecount":0,"deepstackusing":false,"deepstackmem":0,"deepstackcount":0,"nsfminerusing":false,"nsfminermem":0,"nsfminercount":0,"shinobiprousing":false,"shinobipromem":0,"shinobiprocount":0,"foldinghomeusing":false,"foldinghomemem":0,"foldinghomecount":0,"appssupp":["plex","jellyfin","handbrake","emby","tdarr","unmanic","dizquetv","ersatztv","fileflows","frigate","deepstack","nsfminer","shinobipro","foldinghome"],"panel":2},"0d:00.0":{"clock":0.5,"fan":0,"memclock":0.1,"memutil":"1.2%","memused":47.51,"power":"N\/A","powermax":"N\/A","rxutil":"N\/A","txutil":"N\/A","temp":"43 \u00b0C","tempmax":105,"util":"0%","vendor":"AMD","name":"Radeon RX 6400\/6500 XT\/6500M","event":"0%","vertex":"0%","texture":"0%","shaderexp":"0%","sequencer":"0%","shaderinter":"0%","scancon":"0%","primassem":"0%","depthblk":"0%","colorblk":"0%","gfxtrans":"0.1%","transused":11.57,"memclockutil":"9.6%","clockutil":"21.6%","tempunit":"C","fanmax":5550,"voltage":0.7,"voltageunit":"V","panel":3}}
root@computenode:/mnt/user/appdata/tasmotapm-unraid# 

 

My bar is zero as below.

 

image.png

  • Thanks 1
Link to comment
9 hours ago, SimonF said:

You need to look at gpustatusmulti.php for > 6.12

 

I do create a json file in /tmp/ with the values being passed to the panel. Will look at the bar.

 

root@computenode:/mnt/user/appdata/tasmotapm-unraid# cat /tmp/gpu*

 

I don't seem to have a tasmotapm-unraid directory or a gpustatusmulti.php file?!?

 

image.thumb.png.b0f96be64f27e99062e663cd69976230.png

Link to comment
10 hours ago, SimonF said:

plugins are in /usr/local/emhttp/plugins/

 

const ES = ' ';

include 'lib/Main.php';
include 'lib/Nvidia.php';
include 'lib/Intel.php';
include 'lib/AMD.php';
include 'lib/Error.php';

use gpustat\lib\AMD;
use gpustat\lib\Main;
use gpustat\lib\Nvidia;
use gpustat\lib\Intel;
use gpustat\lib\Error;

if (!isset($gpustat_cfg)) {
    $gpustat_cfg = Main::getSettings();
}

// $gpustat_inventory should be set if called from settings page code
if (isset($gpustat_inventory) && $gpustat_inventory) {
    $gpustat_cfg['inventory'] = true;
    // Settings page looks for $gpustat_data specifically -- inventory all supported GPU types
    $gpustat_data = array_merge((new Nvidia($gpustat_cfg))->getInventorym(), (new Intel($gpustat_cfg))->getInventory(), (new AMD($gpustat_cfg))->getInventorym());
} else {


$array=json_decode($_GET['gpus'],true) ;


    $data = array() ;
    foreach ($array as $gpu) {
        $gpustat_cfg["VENDOR"] = $gpu['vendor'] ;
        $gpustat_cfg["GPUID"] = $gpu['guid'] ;

    switch ($gpu['vendor']) {
        case 'amd':
            $return=(new AMD($gpustat_cfg))->getStatistics();
            $decode = json_decode($return,true);
            $decode["panel"] = $gpu['panel'] ;
            $data[$gpu["id"]] = $decode;
            break;
        case 'intel':
            $return=(new Intel($gpustat_cfg))->getStatistics();
            $decode = json_decode($return,true);
            $decode["panel"] = $gpu['panel'] ;
            $data[$gpu["id"]] = $decode;
            break;
        case 'nvidia':
            $return = (new Nvidia($gpustat_cfg))->getStatistics() ;
            $decode = json_decode($return,true);
            $decode["panel"] = $gpu['panel'] ;
            $data[$gpu["id"]] = $decode;
            break;
        default:
            print_r(Error::get(Error::CONFIG_SETTINGS_NOT_VALID));
    }
}
$json=json_encode($data) ;
#Test data
#$json='{"00:02.0":{"clock":100,"fan":50,"memclock":500,"memutil":55,"memused":55,"power":"100W","powermax":500,"rxutil":50,"txutil":60,"temp":50,"tempmax":200,"util":"40%","vendor":"Intel","name":"AlderLake-S GT1","3drender":"50%","blitter":"50%","interrupts":100,"powerutil":"10%","video":"20%","videnh":"30%","pa>
header('Content-Type: application/json');
header('Content-Length:' . ES . strlen($json));
echo $json;
file_put_contents("/tmp/gpujson","Time = ".date(DATE_RFC2822)."\n") ;
file_put_contents("/tmp/gpujson",$json."\n",FILE_APPEND) ;
}

 

Link to comment
1 hour ago, craigr said:

 

const ES = ' ';

include 'lib/Main.php';
include 'lib/Nvidia.php';
include 'lib/Intel.php';
include 'lib/AMD.php';
include 'lib/Error.php';

use gpustat\lib\AMD;
use gpustat\lib\Main;
use gpustat\lib\Nvidia;
use gpustat\lib\Intel;
use gpustat\lib\Error;

if (!isset($gpustat_cfg)) {
    $gpustat_cfg = Main::getSettings();
}

// $gpustat_inventory should be set if called from settings page code
if (isset($gpustat_inventory) && $gpustat_inventory) {
    $gpustat_cfg['inventory'] = true;
    // Settings page looks for $gpustat_data specifically -- inventory all supported GPU types
    $gpustat_data = array_merge((new Nvidia($gpustat_cfg))->getInventorym(), (new Intel($gpustat_cfg))->getInventory(), (new AMD($gpustat_cfg))->getInventorym());
} else {


$array=json_decode($_GET['gpus'],true) ;


    $data = array() ;
    foreach ($array as $gpu) {
        $gpustat_cfg["VENDOR"] = $gpu['vendor'] ;
        $gpustat_cfg["GPUID"] = $gpu['guid'] ;

    switch ($gpu['vendor']) {
        case 'amd':
            $return=(new AMD($gpustat_cfg))->getStatistics();
            $decode = json_decode($return,true);
            $decode["panel"] = $gpu['panel'] ;
            $data[$gpu["id"]] = $decode;
            break;
        case 'intel':
            $return=(new Intel($gpustat_cfg))->getStatistics();
            $decode = json_decode($return,true);
            $decode["panel"] = $gpu['panel'] ;
            $data[$gpu["id"]] = $decode;
            break;
        case 'nvidia':
            $return = (new Nvidia($gpustat_cfg))->getStatistics() ;
            $decode = json_decode($return,true);
            $decode["panel"] = $gpu['panel'] ;
            $data[$gpu["id"]] = $decode;
            break;
        default:
            print_r(Error::get(Error::CONFIG_SETTINGS_NOT_VALID));
    }
}
$json=json_encode($data) ;
#Test data
#$json='{"00:02.0":{"clock":100,"fan":50,"memclock":500,"memutil":55,"memused":55,"power":"100W","powermax":500,"rxutil":50,"txutil":60,"temp":50,"tempmax":200,"util":"40%","vendor":"Intel","name":"AlderLake-S GT1","3drender":"50%","blitter":"50%","interrupts":100,"powerutil":"10%","video":"20%","videnh":"30%","pa>
header('Content-Type: application/json');
header('Content-Length:' . ES . strlen($json));
echo $json;
file_put_contents("/tmp/gpujson","Time = ".date(DATE_RFC2822)."\n") ;
file_put_contents("/tmp/gpujson",$json."\n",FILE_APPEND) ;
}

 

cat you provide the output of cat /tmp/gpujson

Link to comment
root@unRAID:/usr/local/emhttp/plugins/gpustat# cat /tmp/gpujson
Time = Sat, 17 Jun 2023 23:02:17 -0500
{"00:02.0":{"clock":0,"fan":"N\/A","memclock":"N\/A","memutil":"N\/A","memused":"N\/A","power":"0W","powermax":"N\/A","rxutil":"6930.42 MB\/s","txutil":"2624.87 MB\/s","temp":"N\/A","tempmax":"N\/A","util":"0%","vendor":"Intel","name":"Coffee Lake-S GT2 [UHD Graphics P630]","3drender":"0%","blitter":"0%","interrupts":4,"powerutil":"0%","video":"0%","videnh":"0%","panel":1}}
root@unRAID:/usr/local/emhttp/plugins/gpustat#

 

Nothing running at the time.

Edited by craigr
Link to comment
root@unRAID:/usr/local/emhttp/plugins/gpustat# cat /tmp/gpujson
Time = Sun, 18 Jun 2023 01:07:32 -0500
{"00:02.0":{"clock":1086,"fan":"N\/A","memclock":"N\/A","memutil":"N\/A","memused":"N\/A","power":"8.7W","powermax":"N\/A","rxutil":"17841.73 MB\/s","txutil":"5069.22 MB\/s","temp":"N\/A","tempmax":"N\/A","util":"68%","vendor":"Intel","name":"Coffee Lake-S GT2 [UHD Graphics P630]","3drender":"68%","blitter":"0%","interrupts":3098,"powerutil":"100%","video":"80%","videnh":"64%","panel":1}}

 

Few transcodes running.

Link to comment
On 6/18/2023 at 7:09 AM, craigr said:
root@unRAID:/usr/local/emhttp/plugins/gpustat# cat /tmp/gpujson
Time = Sun, 18 Jun 2023 01:07:32 -0500
{"00:02.0":{"clock":1086,"fan":"N\/A","memclock":"N\/A","memutil":"N\/A","memused":"N\/A","power":"8.7W","powermax":"N\/A","rxutil":"17841.73 MB\/s","txutil":"5069.22 MB\/s","temp":"N\/A","tempmax":"N\/A","util":"68%","vendor":"Intel","name":"Coffee Lake-S GT2 [UHD Graphics P630]","3drender":"68%","blitter":"0%","interrupts":3098,"powerutil":"100%","video":"80%","videnh":"64%","panel":1}}

 

Few transcodes running.

Playing with your values I get 100% bar.

 

change "powerutil":"100%" to 70% the bar is updated.

 

This value

On 6/17/2023 at 7:31 AM, craigr said:
     "rc6": {
                "value": 0.000000,
                "unit": "%"
        },

Is the percentage usage

 

            // According to the sparse documentation, rc6 is a percentage of how little the GPU is requesting power
            if ($this->settings['DISPPWRSTATE']) {
                if (isset($data['rc6']['value'])) {
                    $this->pageData['powerutil'] = $this->roundFloat(100 - $data['rc6']['value'], 2) . "%";
                }
            }
 

 

image.png

  • Thanks 1
Link to comment
On 6/19/2023 at 9:17 AM, craigr said:

Spoke too soon.  I tried a transcode and no matter how much power draw (0.1 - 10 w) the bar stayed at 100%.  Now with zero draw it's at 100% again.

& @SimonF this is a common issue and is not related to the GPU Statistics plugin, this is actually caused by intel_gpu_top

 

Just issue intel_gpu_top from a terminal and you should see that it reports 0% even if no load is on the GPU (this is when it doesn't work correctly).

 

I've already reported that multiple times over on the Intel-GPU-Tools Gitlab but they can't reproduce this issue.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.