hishamhm / htop

htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.
GNU General Public License v2.0
5.84k stars 581 forks source link

GPU buffers memory accounting (TTM, GEM) #926

Open eugene-bright opened 5 years ago

eugene-bright commented 5 years ago

Nowadays GPU drivers can dynamically allocate DMA buffers to be used in addition to VRAM. It's mainly done by translation-table maps (ttm) module. Some GPU modules may still use GEM subsystem to manage buffers though.

It seems to me that htop counts TTM memory as free on my system. Looks like TTM module usage can determined by reading file /sys/class/drm/ttm/memory_accounting/pool/pool_allocation_size.

Should we add GPU memory class and calculate TTM + GEM allocated memory?