Syllo / nvtop

GPU & Accelerator process monitoring for AMD, Apple, Huawei, Intel, NVIDIA and Qualcomm
Other
8.05k stars 291 forks source link

ARM Mali GPU Panfrost support #235

Closed larunbe closed 10 months ago

larunbe commented 1 year ago

Add support for ARM Mali GPUs monitoring with the Panfrost driver.

flyxyz123 commented 1 year ago

Hi, I tried to build but failed due to https://github.com/larunbe/nvtop/blob/bb580d3801c6a0f9f3807740d9098d4df4450b76/src/extract_gpuinfo_panfrost_utils.c#L22. File panfrost_utils.h seems do not exist. I removed that line and build passed. Is it a bug?

larunbe commented 1 year ago

Hi, I tried to build but failed due to https://github.com/larunbe/nvtop/blob/bb580d3801c6a0f9f3807740d9098d4df4450b76/src/extract_gpuinfo_panfrost_utils.c#L22. File panfrost_utils.h seems do not exist. I removed that line and build passed. Is it a bug?

Sorry, I recently added that file but forgot to include it in the PR update. It's been included in the latest push.

larunbe commented 12 months ago

Thanks for this patch. Looks good to me so far. There is only one thing missing in my opinion is a toggle in the F2 setup menu (see header options). I'll add it this week if I have some time to spare.

Is this F2 functionality present in other drivers? If so, I could do it myself.

nextfoe commented 11 months ago

Hi @larunbe , May I run nvtop on the embedded devices or android phone after cherry-pick your patches? Now i has a issue:

adb shell
# ./data/nvtop
profile parameter not implemented in Panfrost
No GPU to monitor.

# ls /sys/kernel/debug/dri/128/
no profile file, just has a name file.

Thanks

larunbe commented 11 months ago

Hi @larunbe , May I run nvtop on the embedded devices or android phone after cherry-pick your patches? Now i has a issue:

adb shell
# ./data/nvtop
profile parameter not implemented in Panfrost
No GPU to monitor.

# ls /sys/kernel/debug/dri/128/
no profile file, just has a name file.

Thanks

You'll need the latest changes on drm-misc to run this on an SoC with a Mali GPU. The patch submission is here: https://lore.kernel.org/lkml/20231004130601.60239c7f@collabora.com/ However like I said the patch series has already landed in the drm-misc tree, so I guess that means it'll be part of the next 6.7 release.

nextfoe commented 11 months ago

Hi @larunbe , May I run nvtop on the embedded devices or android phone after cherry-pick your patches? Now i has a issue:

adb shell
# ./data/nvtop
profile parameter not implemented in Panfrost
No GPU to monitor.

# ls /sys/kernel/debug/dri/128/
no profile file, just has a name file.

Thanks

You'll need the latest changes on drm-misc to run this on an SoC with a Mali GPU. The patch submission is here: https://lore.kernel.org/lkml/20231004130601.60239c7f@collabora.com/ However like I said the patch series has already landed in the drm-misc tree, so I guess that means it'll be part of the next 6.7 release.

Thanks, I will try cherry-pick this patch to our kernel version to test again.

Syllo commented 11 months ago

I pushed a patch to fix the cache lookup and two others to get the "Extra GPU info line" in the F2 menu and made it so that it gets saved/loaded from the config file.

larunbe commented 11 months ago

If you want to try the Panthor backend, you'd need a SBC with a Mali CSF GPU (Like RockPi5) and the fdinfo enablement branch I'm currently working on: https://gitlab.freedesktop.org/larumbe/panthor/-/tree/panthor-fdinfo

larunbe commented 11 months ago

Hi @Syllo, do you think you might have a wee bit of time to have a peek into my latest changes some time this week? Cheers.

Syllo commented 10 months ago

Hey @larunbe,

I think that it's in a good enough state to be included. Do you wish to add something more before merging?

larunbe commented 10 months ago

Hi @Syllo, Someone running nvtop on a SBC with a Mali CSF GPU has noticed when unsetting XDG_CONFIG_HOME it crashes in a segmentation fault. I've been unable to reproduce it on my local setup. They'll be giving me a full stacktrace of the event next week, and when I've figured out what's wrong and fixed it, will let you know so that you can merge the changes. Cheers

larunbe commented 10 months ago

Hey @larunbe,

I think that it's in a good enough state to be included. Do you wish to add something more before merging?

I think the PR is now ready to be merged.