-
-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve GPU debug reports #7456
base: main
Are you sure you want to change the base?
Conversation
Instead of using weird "hacks" to get GPU information, Just get whatever libdrm reports. This is by no means perfect and omits specific GPU details such as the model.
More GPU info can be obtained like so https://gitlab.freedesktop.org/mesa/demos/-/blob/main/src/demos/glinfo.c?ref_type=heads#L23-25
You also need to run drmFreeVersion() after you done with drmGetVersion(). https://github.com/swaywm/sway/blob/7288f77bbe275825a0e0b011db873d9367782af0/sway/server.c#L148-L175 |
Yup sorry, Completely forgot to include that, As for additional GPU info vaxry said the current output is fine. This is just an excuse, I'm too lazy to add more crud |
y no clang-format |
Didn't know that was a thing? |
const std::string GPUINFO = execAndGet("lspci -vnn | grep VGA"); | ||
#endif | ||
result += "GPU information: \n" + GPUINFO; | ||
int fd = open("/dev/dri/card0", O_RDONLY | O_CLOEXEC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is dumb, we may not even be running on card0. You should get the card(s) path(s) from the current aq session g_pCompositor->m_pAqBackend->session
src/debug/HyprCtl.cpp
Outdated
result += "GPU information: \n" + GPUINFO; | ||
int fd = open("/dev/dri/card0", O_RDONLY | O_CLOEXEC); | ||
if (fd < 0) { | ||
throw std::runtime_error("Failed to open /dev/dri/card0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??? just skip this log
src/debug/HyprCtl.cpp
Outdated
drmVersion* version = drmGetVersion(fd); | ||
if (!version) { | ||
close(fd); | ||
throw std::runtime_error("Failed to get DRM version"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again
#else | ||
const std::string GPUINFO = execAndGet("lspci -vnn | grep VGA"); | ||
#endif | ||
int fd = open("/dev/dri/card0", O_RDONLY | O_CLOEXEC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same stuff here, also why are you duping code? make this into a function? renderer does the same, btw, idk why this is needed here
No clue how to use "g_pCompositor->m_pAqBackend->session" but hopefully this is better. |
Probably like so Hyprland/src/render/Renderer.cpp Line 38 in 688fe5c
Btw, this Hyprland/src/render/Renderer.cpp Line 48 in 688fe5c
is useless, at least on nvidia:
Well, it logged elsewhere with But it's so weird how the function to get version doesn't actually return useful version number. Nvidia moment. |
Describe your PR, what does it fix/add?
Instead of using weird "hacks" to get GPU information, Just get whatever libdrm reports.
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
At the moment this uses /dev/dri/card0.
This implementation is not as verbose as before, Card model is not shown, unaware of a way to show it.
Is it ready for merging, or does it need work?
I'd say it's ready i guess.