ktop icon indicating copy to clipboard operation
ktop copied to clipboard

pynvml deprecated, no AMD GPU support

Open dlm21 opened this issue 9 months ago • 7 comments

Since pynvml is deprecated, a drop in replacement for Nvidia GPUs should be nvidia-ml-py , and maybe AMD GPUs could be supported by pyrsmi . On my box with a 7900XTX:

Image

dlm21 avatar Feb 11 '26 05:02 dlm21

Thanks for reporting this. I don't currently have an AMD GPU to test on but I could build this in a branch and then maybe you could give it a try?

brontoguana avatar Feb 11 '26 12:02 brontoguana

Yep, I'd be glad to test. I know it's a lot of work adding support for hardware you don't own, and you do list Nvidia as a requirement, so I understand it's not a high priority at all. I can make due with amdgpu_top --dark to monitor loads while playing with different models/checkpoints, but this one is a lot prettier :P

dlm21 avatar Feb 11 '26 15:02 dlm21

Can you try this please:

git clone -b feature/amd-gpu https://github.com/brontoguana/ktop.git && cd ktop && ./setup.sh

that will check out the AMD feature branch and run ktop, you should hopefully then see your GPU(s) listed?

brontoguana avatar Feb 11 '26 16:02 brontoguana

also now defaults to using nvidia-ml-py and falls back to pynvml (thanks for the suggestion)

brontoguana avatar Feb 11 '26 16:02 brontoguana

Oh wow that was fast, thank you! On a different box atm, also AMD ( GMKTec Evo-X2 ) , and it works ! Note that this is a weird setup (AI Max 395+ with 128GB memory shared between system and igpu) so while it shows 1GB of VRAM, the GTT settings make most of the 128GB available to whatever needs VRAM. I took a screenshot showing the amdgpu_top details below the ktop window to show the GTT size is what matters most for loading AI models (in this case it's ComfyUI with Z-Image-turbo, a small diffusion model to get some load on it). So I'm not sure if you want to drill down deeper into the VRAM usage stuff, but thought I'd point it out. I'll test on my main workstation this evening after work just to be sure it's also detecting the discrete card in it as well.

Also in the CPU section, I don't see a history graph, it's always blank, even when I put load on it.

Image

Similar apps show the GTT as "shared memory" fwiw:

Image

dlm21 avatar Feb 11 '26 17:02 dlm21

Thats great thanks for testing it. Thanks for the note about the CPU history too I'll look into that.

So the GTT thing is interesting because its related to my other github project - Krasis. In your setup here you have a lot of system RAM and that as you say is being made available to the GPU but its fundamentally quite different to discrete memory on the GPU itself. When it has to access that ram it has to go across the PCIE bridge so the bandwidth is typically much lower than memory that is on the GPU itself. LLMs are generally memory bandwidth bound (atm) so ideally you want to avoid that situation. Krasis is about trying to get full GPU prefill on VRAM with various optimisations and then use system ram exclusively for FFN which is ideal for a hybrid system. So as you say on this system its only going to run an LLM by using the shared (system) ram, but we are reporting the 1GB dedicated GPU ram. I might look into having the GPU monitoring show shared ram as an additional metric.

brontoguana avatar Feb 11 '26 17:02 brontoguana

AMD GPU support seems ok now, I'll think about GTT. I tested the CPU situation but it seemed ok to me. I have made a change though that makes the history line double height so maybe you could test with that and see if you still see no CPU history?

brontoguana avatar Feb 11 '26 18:02 brontoguana