Slimbook-Team / slimbookamdcontroller

GNU General Public License v3.0
35 stars 8 forks source link

shorter name for 'unsupported' GPUs and rounded GPU voltage #23

Closed UbayGD closed 1 year ago

UbayGD commented 1 year ago

Now that I have my beloved Slimbook One I have discovered that the GPU model name (for this particular PC) is getting it from the 'lspci' command instead of using the 'pyamdgpuinfo' library. Since this name is huge and makes the window very wide I decided to add a sort of listing for these unsupported models. This way it looks a bit nicer.

I have also limited the voltage decimals since values like '0.98000001' were appearing (not exactly, it is an example).

Best regards and thanks!

UbayGD commented 1 year ago

I have marked this PR as a draft because I don't know if it would be better to try to get the model out of the lspci command but using a regular expression to keep only what is in square brackets.

For example for: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c4)

Use a regular expression to get the following: Radeon Vega Series / Radeon Vega Mobile Series

I would have to check if that pattern is always followed.

@MarSlimbook any ideas/advice?

slimbook commented 1 year ago

Okey, let me check some cases to see what's the output of some of our computers.

In a R7 4800H, output is: VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c6)

I also looked for a better command output some time ago, but never found something better.

UbayGD commented 1 year ago

Mmmm... Not exactly the same as what the command shows for the R9 5900HX...

I'm thinking the flow might look like this:

MarSlimbook commented 1 year ago

Looks good to me, although the last option is quite a lot of text, but it won't usually be shown.

UbayGD commented 1 year ago

Finally I have decided that if pyamdgpuinfo does not return the model and does not match the regular expressions it will return "Unknown model".

I must say that I'm not very good with regular expressions so it's possible that it can be improved or that I missed something.

Best regards!