Skip to content
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

GPU and Display Information #237

Merged
merged 6 commits into from
Apr 24, 2018
Merged

GPU and Display Information #237

merged 6 commits into from
Apr 24, 2018

Conversation

bp0
Copy link
Collaborator

@bp0 bp0 commented Mar 18, 2018

Working on #225, I've started to enumerate GPU devices. Along the way I wrote new PCI utility functions, and changed Devices/PCI to use them. Added X utility functions and changed Computer/Display to use them.

This series also fixes the issue described at #162 for devices/pci.

@mckaygerhard
Copy link
Contributor

puff! you are made a great job!

@bp0
Copy link
Collaborator Author

bp0 commented Mar 18, 2018

Shots

X information (via ssh, no GLX)
screenshot_2018-03-18_11-58-06
GPU information not from X, so remains correct
screenshot_2018-03-17_21-05-22
screenshot_2018-03-17_20-28-46

screenshot_2018-03-17_20-35-28

@bp0
Copy link
Collaborator Author

bp0 commented Mar 18, 2018

I've squashed some fixes together and re-ordered with rebase -i and push -f.

@bp0 bp0 force-pushed the gpu branch 3 times, most recently from dd449c1 to edcab86 Compare March 18, 2018 23:07
gint width, height;

/* new stuff */
xrr_info *xrr;

/* don't free */
gchar *vendor; /* points to xrr->xi->vendor */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If somethings isn't supposed to be freed, it's best to just mark them as const.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: making it const introduced a warning when sending it through info_*()

@@ -88,6 +88,8 @@ if(NOT HARDINFO_NOSYNC)
pkg_check_modules(LIBSOUP libsoup-2.4>=2.24)
endif()

pkg_check_modules(X11 REQUIRED x11)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is requiring X11 the way to go? GTK3 can use Wayland, and it's not really a good idea to require X11 in that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but older machines need X11 and does not work with Wailand, some distributions does will not include never Wayland and seems for now, if wayland will be used , x11 will be used as base, such as debian 9

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to have a machine with no xserver, nor xrandr, nor xdpyinfo, that still has an X-client application running on it. I was running on a x-less debian machine with ssh -X ... and it left the whole display information empty, even though X is clearly being used. The xlib dep is for a fallback of getting information directly from X. Otherwise, (for example, in Debian) we need to make sure that x11-xserver-utils is an install dependency of the hardinfo package, so that we know that xrandr and xdpyinfo will be available.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we are guaranteed to have Xlib available if we have GDK. Honestly, we might try and get all the X information directly via Xlib instead of relying on xrandr and/or xdpyinfo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umm so then now X11 its a new depend, so about the reading of scsi older kernels vs newer kernels.. ? may runnign good hardware only work with older kernel.. to the list of TODO (theres at leas one in the issues) we must added the new depens and runtime-depends and i'll prepare a README introduction update and compilation info how to

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reply didn't get added to this thread, but instead the PR thread, so I'll duplicate it here.
X11 was always required via GDK, only now the Xlib headers are needed to build. This really doesn't change anything for the binary, it just lets the cmake magic work to find the right linking config.


/* TODO: In the future, when there is more vendor specific information available in
* the gpu struct, then more precise names can be given to each gpu */
void make_nice_name(gpud *s) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be static?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there a list of names maybe.. but..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, static.

@mckaygerhard
Copy link
Contributor

umm @bp0 this will sustitue the "Display" section? and will include all the OpenGL/CL/XL/"any-L" information ?

@bp0
Copy link
Collaborator Author

bp0 commented Mar 20, 2018

@mckaygerhard, the Display section as it is now is only for information from X, and if using X over network, it is about actual server being used and not the machine's X server.

There is currently no Wayland information available in Hardinfo.
I've made this clear in this commit:
19869a5

I don't have a setup that can use Wayland, as I have an nVidia card, so I can't really work on it. I do have an old Radeon card that I might try, but it may be too old. To test out detecting multiple cards, I have only one 16x PCIE slot, so I actually used an old PCI S3 Virge card from the 90s that I found in a box. Linux won't even drive it for console anymore, which is sad, but it let me see what two cards in the GPU list would look like.

@bp0
Copy link
Collaborator Author

bp0 commented Mar 20, 2018

@lpereira, @mckaygerhard: do either of you have a PRIME setup laptop with intel and nvidia graphics?

@bp0 bp0 force-pushed the gpu branch 2 times, most recently from 7d2a518 to 7f16c28 Compare March 20, 2018 05:03
@mckaygerhard
Copy link
Contributor

sorry @bp0, not, i have one intel Haswell-ULT with Radeon 8690M, also have some dual intel+radeon very olders firts made.. some time ago i have a intel+nvidia but i really hate introduce binary only software so i change it

i have access to many hardware but not to a prime: intel+nvidia setup.. sorry, but i can test with my intel+readeon. maybe @nerv55 can help me with that if i ask to

@bp0
Copy link
Collaborator Author

bp0 commented Mar 20, 2018 via email

@bp0
Copy link
Collaborator Author

bp0 commented Mar 20, 2018

@mckaygerhard, well I'd certainly appreciate information from any multi-gpu systems.
Could you send me glxinfo, xrandr --prop, dmesg | grep drm (or complete), lspci from any or all of those systems?
Oh and hardinfo -r -f text with this patch series applied would be nice too!

@bp0
Copy link
Collaborator Author

bp0 commented Mar 23, 2018

I've rebased again to simplify the PR.

@mckaygerhard
Copy link
Contributor

i'll send you in a couple of hours, let me be free os some task and i feedback here

@bp0 bp0 force-pushed the gpu branch 2 times, most recently from 8c90f0f to 1bf4a13 Compare March 25, 2018 20:16
bp0 added 5 commits March 25, 2018 16:13
Based on usb_util. Only current method is via lspci, but framework
exists to add other methods.

Signed-off-by: Burt P <pburt0@gmail.com>
Get X display info from Xlib,  xrandr, xdpyinfo, and glxinfo.
Also, Some simple Wayland info lives here for now.

Signed-off-by: Burt P <pburt0@gmail.com>
Enumerates GPUs into a list. Currently from PCI and device tree.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Burt P <pburt0@gmail.com>
This commit fixes:
* lpereira#200
  now using xrandr to get screen info instead of gdk, so it works
  from the cli
* lpereira#27
  opengl core and compatibility versions are both listed
* lpereira#230
  (by removing extension list)

Signed-off-by: Burt P <pburt0@gmail.com>
@bp0
Copy link
Collaborator Author

bp0 commented Apr 15, 2018

Any problems, questions, or comments? Though there is more work to do for #225, this could be merged as it is now.

@mckaygerhard
Copy link
Contributor

sorry for late i have a bouild with this pull enable.. i post feedback in later

@lpereira lpereira merged commit ea8ce7d into lpereira:master Apr 24, 2018
@bp0 bp0 deleted the gpu branch April 24, 2018 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants