Open Schlaefer opened 2 days ago
According to the fdinfo, it doesn't look like the GPU is being utilized. Is it possible you're using a software vulkan driver or something?
My bad, improper use of grep above. This is the correct observation: there's always drm-driver
and drm-pdev
, but drm-engine-gfx
is missing. Another example with glxgears
Do we need something like this switch for drm-engine-* in the gpu.cpp?
drm-engine-gfx
is for amd cards, so no need to grep for that. Could you make same screenshot again, but this time grep for drm-engine-render
?
drm-engine-gfx
is for amd cards, so no need to grep for that. Could you make same screenshot again, but this time grep fordrm-engine-render
?
Sorry, no domain knowledge before filing this and not a C programmer. So from what I understand drm-engine-render
is Intel and drm-engine-gfx
is AMD. Yes, drm-engine-render
does always exist.
From what I can observe searching for drm-engine-render
and some more logging in gpu.cpp
:
if (line.find("drm-engine-render:") != std::string::npos) {
uint64_t render_time = std::stoull(line.substr(line.find(":") + 1));
SPDLOG_DEBUG("render_time: {}", render_time);
if (render_time > 0) {
has_drm_engine_gfx = true;
}
}
}
SPDLOG_DEBUG("has_drm_driver: {}, has_drm_engine_gfx: {}", has_drm_driver, has_drm_engine_gfx);
if (has_drm_driver && has_drm_engine_gfx) {
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:69] GPU Found: node_name: renderD128, vendor_id: 8086 device_id: 56a1 pci_dev: 0000:03:00.0
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:126] render_time: 0
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: true, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:126] render_time: 358280
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: true, has_drm_engine_gfx: true
[2024-11-15 16:04:05.352] [MANGOHUD] [debug] [gpu.cpp:138] Active GPU Found: node_name: renderD128, pci_dev: 0000:03:00.0
Works as expected and outputs GPU data.
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:69] GPU Found: node_name: renderD128, vendor_id: 8086 device_id: 56a1 pci_dev: 0000:03:00.0
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:126] render_time: 0
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: true, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:126] render_time: 0
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: true, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:126] render_time: 0
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: true, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:126] render_time: 0
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: true, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:133] has_drm_driver: false, has_drm_engine_gfx: false
[2024-11-15 16:05:39.841] [MANGOHUD] [debug] [gpu.cpp:167] failed to find active GPU
Still throws a failed to find active GPU because render time is 0 at time of checking, but does actually shows GPU data. Render time increases checking /proc/... while program is running though.
Weird, on my system with compiled mangohud-git I have GPU usage just fine, even with those lines in log:
[2024-11-16 18:38:13.904] [MANGOHUD] [debug] [vulkan.cpp:1860] gpu: Intel(R) Arc(tm) A770 Graphics (DG2)
[2024-11-16 18:38:13.906] [MANGOHUD] [debug] [vulkan.cpp:720] Recreating font image
[2024-11-16 18:38:13.925] [MANGOHUD] [debug] [vulkan.cpp:739] Default font tex size: 1024x2048px
[2024-11-16 18:38:13.927] [MANGOHUD] [debug] [gpu.cpp:69] GPU Found: node_name: renderD128, vendor_id: 8086 device_id: 56a0 pci_dev: 0000:03:00.0
[2024-11-16 18:38:13.928] [MANGOHUD] [debug] [gpu.cpp:165] failed to find active GPU
No GPU load shown on Intel Arc.
List relevant hardware/software information
Operating System: CachyOS Linux KDE Plasma Version: 6.2.3 KDE Frameworks Version: 6.8.0 Qt Version: 6.8.0 Kernel Version: 6.11.7-2-cachyos (64-bit) Graphics Platform: Wayland Graphics Processor: Mesa Intel® Arc Mesa: 24.2.7 Driver: i915
To Reproduce Steps to reproduce the behavior:
mangohud-git
MANGOHUD=1 vkcube
Expected behavior See GPU load with
MANGOHUD=1 vkcube
Screenshots
Additional context
With #1372 fixed I wanted to give it a try but didn't get any output. With logging:
Checking the fdinfo for that process it seems there's no
drm-driver
and nodrm-engine-gfx
entry:Skipping the tests in
gpu.c
and returning early with a manualgpu->is_active = true;
gives the expected result: