bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
MIT License
1.22k stars 62 forks source link

Wrong PCI number #52

Closed posLop closed 1 year ago

posLop commented 2 years ago

Envy is configuring my pci wrong

poslop@poslop-a ~$ lspci | grep VGA                                                                                                    
0000:00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P Integrated Graphics Controller (rev 0c)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)

envy used pci ID

BusID  "PCI:0:1:0:0"

working pci ID

BusID  "PCI:1:0:0"
netravatpendsey commented 1 year ago

I have the same issue. I think it is cause by a slightly broken regex script for formatting the Bus ID. The current regex [0-9a-f]{2}:[0-9a-z]{2}.[0-9] will match incorrectly if the Bus ID starts with "0000:". Replacing it with [0-9a-f]{2}:[0-9a-z]{2}\.[0-9] fixes the issue.

bayasdev commented 1 year ago

@netravatpendsey @posLop could you guys try the latest changes from the rewrite-pci branch?

Thank you!

bayasdev commented 1 year ago

Should be fixed now