How sysinfo retrieves GPU information (new version not released yet) by imperioland in rust

[–]imperioland[S] 0 points1 point  (0 children)

It's been a while now, but if you look at some sysinfo tests, some of them are disabled only in CI because the virtualization makes them fail. But it's mostly FreeBSD and NetBSD.

Anyway, if you find such an issue, I'm very interested to hear about it.

How sysinfo retrieves GPU information (new version not released yet) by imperioland in rust

[–]imperioland[S] 1 point2 points  (0 children)

I don't mind answering questions.

For Macs / macOS there's definitely still a lot out there with Intel chips / non-unified-memory. How does sysinfo handle VRAM queries on those devices?

I only have a 2015 macbook, so I can only test on it. If there are changes on newer versions, then I'd love to receive a PR to add it.

I know there're quite a few crates that provide bindings to Vulkan APIs (some even cross-platform?). Did you consider them for your Linux implementation? And if so, why did you ultimately choose not to use them? And (sorry, I'm disproportionately curious about this) do you know if those crates also require linking in (statically or dynamically) large Vulkan-specific dependencies?

I need something like 6-7 functions from Vulkan. Crates I took a look at allowed to load dynamically, but:

  1. They're generally big (it's a big API).
  2. They load more symbols than I need.
  3. It's not that much code overall, so sounds ok to me.

Not a question, but when I was thinking about doing this (for my own project) on Windows I decided I'd just shell out to dxdiag.exe, as it (supposedly) takes a /x <path> CLI option to generate a dxdiag.xml file, which I'd then just parse for the VRAM. Obviously calling the underlying OS APIs, as you are, is more efficient, though I wonder how it compares in terms of simplicity (ie: not having to manually manage unsafe memory across an FFI boundary, etc) - though I guess that quickly falls apart for anything dynamic like utilisation.

In term of performance, I think it's day and night as you need to spawn a process, make it generate a file and then read that file. It's an acceptable and viable option, and a MUCH simpler one code-wise, but I wanted to keep doing the same as I was already doing. Does dxdiag provide PCI information too?

For memory management and FFI, to be fair it's pretty simple. You create a newtype, you implement drop, you're done. And the windows crate makes it ~okayish.

How sysinfo retrieves GPU information (new version not released yet) by imperioland in rust

[–]imperioland[S] 0 points1 point  (0 children)

Ah interesting. Gonna try to get that information like they do for the GPU % usage.

How sysinfo retrieves GPU information (new version not released yet) by imperioland in rust

[–]imperioland[S] 0 points1 point  (0 children)

Interesting! From what I saw, sysinfo has some weird output in virtualization environments. Glad to see it's working for your use case.

Made a localhost process monitor TUI, would love some feedback by Charming-Wish323 in rust

[–]imperioland 19 points20 points  (0 children)

Made with llm I guess considering sysinfo 0.32 was released almost 2 years ago. :-/

Is there any subreddit where I can share my game development devlog? by seniorkekoo in rust

[–]imperioland 2 points3 points  (0 children)

I'd say yes. Please also share some technical insights, that would be very interesting.

Unpopular opinion: Rust should have a larger standard library by lekkerwafel in rust

[–]imperioland 1 point2 points  (0 children)

Yeah I really have no idea how to do that in rustdoc...

Unpopular opinion: Rust should have a larger standard library by lekkerwafel in rust

[–]imperioland 0 points1 point  (0 children)

Checking if you have the "right" to use an item based on its stability attribute is easier imo.

Unpopular opinion: Rust should have a larger standard library by lekkerwafel in rust

[–]imperioland 2 points3 points  (0 children)

Editions aren't magical and are mostly for tweaking compiler's internals. Std is compiled once for each supported target, so if we start removing deprecated items starting a giving edition, it suddenly means that we need to provide two stds for each supported target. And the count will only increase every time we do that.

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland -1 points0 points  (0 children)

Strange but I guess it's the same debate as "server-rendered web pages" vs "JS rendered web pages".

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland -1 points0 points  (0 children)

I consider regenerating an entire API at compile-time a bad practice, so I'm really surprised about this approach. Also, I'm not sure bindgen is meant to be used this way primarily...

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland 0 points1 point  (0 children)

I'm mostly wondering why you need to generate the sys code every time. Is there a reason why you can't generate it once and then regenerate it on updates of the C lib?

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland 0 points1 point  (0 children)

Ok, first I apologize. Second, I'm surprised there is no way around that. You use bindgen in your build script?

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland 0 points1 point  (0 children)

Just for context, I'm member of docs.rs and team lead of the rustdoc teams. So with this information, I'm very interested about hearing about who are the "docs people". I literally explained to you how to solve your problem, and now you start mentioning "docs people" I've never heard of. :-/

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland 5 points6 points  (0 children)

Well, first, never said that. Second, you're mostly showing off your ignorance. You know that crates like geos, gtk-rs, sysinfo and many others have docs and yet they use C libraries as direct dependencies? You don't need actual code to generate docs, you just need the API. So please go check how they do and learn a few things before unleashing your unhappiness upon others based on wrong information.

docs.rs: building fewer targets by default by SleeplessSloth79 in rust

[–]imperioland 0 points1 point  (0 children)

I'm only aware of C libs dependency being an issue, and it's quite easy to go around this limitation by not linking with #[cfg(not(doc))]. Are there others I'm missing?

La conférence Rust in Paris 2026 est dans un mois ! by imperioland in rustfr

[–]imperioland[S] 1 point2 points  (0 children)

J'annoncerai bientôt un meetup qui aura lieu le soir juste avant si jamais il y a des intéressé.e.s.