Code Monkey home page Code Monkey logo

Comments (4)

nokyan avatar nokyan commented on July 30, 2024 1

image
I've implemented it for NVIDIA GPUs, for AMD it's probably gonna be a bit more difficult though :)

from resources.

nokyan avatar nokyan commented on July 30, 2024

Hi, thanks for the suggestion.
I'll put it on my to-do list. :)

from resources.

do-sch avatar do-sch commented on July 30, 2024

To make this work with AMD and Intel GPUs, you will have to read the computing time of each individual process from fdinfo in proc and add up the utilization of all processes.
Example of that file:

pos:	0
flags:	02100002
mnt_id:	34
ino:	659
drm-driver:	amdgpu
drm-client-id:	428
drm-pdev:	0000:63:00.0
pasid:	32789
drm-driver:	amdgpu
drm-pdev:	0000:63:00.0
drm-client-id:	641912
drm-memory-vram:	186708 KiB
drm-memory-gtt: 	17828 KiB
drm-memory-cpu: 	0 KiB
amd-memory-visible-vram:	186708 KiB
amd-evicted-vram:	0 KiB
amd-evicted-visible-vram:	0 KiB
amd-requested-vram:	186708 KiB
amd-requested-visible-vram:	39748 KiB
amd-requested-gtt:	17828 KiB
drm-engine-gfx:	22584849422 ns
drm-engine-enc:	88926670130 ns

You can then parse the following information from it:

Time that the process has rendered:
AMD: drm-engine-gfx
Intel: drm-engine-render

Time that the process has encoded or decoded:
AMD: drm-engine-enc
Intel: drm-engine-video

AMD also has the following keys, which never appear on my hardware (Radeon 780M):

drm-engine-compute
drm-engine-dma
drm-engine-dec
drm-engine-enc_1
drm-engine-jpeg
drm-engine-vpe

Intel still has some, but I will never fill them on my Intel HD 515:

drm-engine-compute
drm-engine-copy
drm-engine-video-enhance

With AMD, you could also read out how much VRAM each process is using.

The whole thing will probably be even more complicated, however, because there are systems that have several GPUs. You then have to differentiate based on the drm-pdev value.

I started something like this some time ago for a demo application, but never went any further.

from resources.

nokyan avatar nokyan commented on July 30, 2024

To make this work with AMD and Intel GPUs, you will have to read the computing time of each individual process from fdinfo in proc and add up the utilization of all processes. Example of that file:

pos:	0
flags:	02100002
mnt_id:	34
ino:	659
drm-driver:	amdgpu
drm-client-id:	428
drm-pdev:	0000:63:00.0
pasid:	32789
drm-driver:	amdgpu
drm-pdev:	0000:63:00.0
drm-client-id:	641912
drm-memory-vram:	186708 KiB
drm-memory-gtt: 	17828 KiB
drm-memory-cpu: 	0 KiB
amd-memory-visible-vram:	186708 KiB
amd-evicted-vram:	0 KiB
amd-evicted-visible-vram:	0 KiB
amd-requested-vram:	186708 KiB
amd-requested-visible-vram:	39748 KiB
amd-requested-gtt:	17828 KiB
drm-engine-gfx:	22584849422 ns
drm-engine-enc:	88926670130 ns

You can then parse the following information from it:

Time that the process has rendered: AMD: drm-engine-gfx Intel: drm-engine-render

Time that the process has encoded or decoded: AMD: drm-engine-enc Intel: drm-engine-video

AMD also has the following keys, which never appear on my hardware (Radeon 780M):

drm-engine-compute
drm-engine-dma
drm-engine-dec
drm-engine-enc_1
drm-engine-jpeg
drm-engine-vpe

Intel still has some, but I will never fill them on my Intel HD 515:

drm-engine-compute
drm-engine-copy
drm-engine-video-enhance

With AMD, you could also read out how much VRAM each process is using.

The whole thing will probably be even more complicated, however, because there are systems that have several GPUs. You then have to differentiate based on the drm-pdev value.

I started something like this some time ago for a demo application, but never went any further.

Thank you very much for the info, I unfortunately forgot to close this issue, GPU encoding/decoding is already in Resources 1.3 (Flathub will hopefully soon get the update aswell). 😅
I adapted much of nvtop's code for that.

from resources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.