8000 Adding more restrictive eGPU detection by toumorokoshi · Pull Request #49 · hertg/egpu-switcher · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adding more restrictive eGPU detection #49

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

Merged
merged 2 commits into from
Aug 7, 2020
Merged

Conversation

toumorokoshi
Copy link
Contributor

Fixes #48

Most GPUs register as "VGA compatible controller" in lspci. Adding this
string to the regex search eliminates false positives for other devices
that use the same PCI-E BusID, such as non-VGA devices connected via
non-eGPU docks.

Fixes hertg#48

Most GPUs register as "VGA compatible controller" in lspci. Adding this
string to the regex search eliminates false positives for other devices
that use the same PCI-E BusID, such as non-VGA devices connected via
non-eGPU docks.
@toumorokoshi
Copy link
Contributor Author

I've verified this fixed my issue, very similar to #48 (non eGPU dock)

@hertg
Copy link
Owner
hertg commented Aug 6, 2020

Hey, thanks for the PR!

I would actually prefer to limit the results in the lspci command directly, rather than changing grep.
So the if statement should probably look more something like that:

if [ $((lspci -d ::0300 && lspci -d ::0302) | grep -iEc "$bus1h:$bus2h.$bus3h") -eq 1 ]; then

Limiting the results by filtering the device classes in lspci has proven to be more reliable than via grep. You can have a look at the read_gpus() method for reference.

@toumorokoshi
Copy link
Contributor Author

Sounds good! I'll fix that PR up.

Doing a quick glance at the display types supported, I presume we should ignore XGA (01) and Display Controller (80)? I don't see anything registering under those.

using lspci filters vs regex match for VGA controller string,
as the filters are more robust.
@hertg
Copy link
Owner
hertg commented Aug 7, 2020

I did add that code-change to my local egpu-switcher, and it worked seamlessly on my TB3 Dock at work today.

Doing a quick glance at the display types supported, I presume we should ignore XGA (01) and Display Controller (80)? I don't see anything registering under those.

I also haven't seen any of these before, so I don't really know what devices would register as XGA (01) or Display Controller (80). It's probably best to keep it like it is right now, instead of adding more device-classes we don't know enough about. There were no issues reported about undetected eGPUs since we changed to (lspci -d ::0300 && lspci -d ::0302) in read_gpus().

@hertg hertg merged commit eaf2f8e into hertg:master Aug 7, 2020
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.

Improve eGPU detection
2 participants
0