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

Unable to read PCI information: pci config file has an invalid format #122

Open
mszaro opened this issue Nov 29, 2024 · 4 comments
Open
Assignees

Comments

@mszaro
Copy link

mszaro commented Nov 29, 2024

Hey there, I'm running into an issue that seems related to #91:

mszaro@miniserv:~$ sudo egpu-switcher config
[error] unable to read pci information from sysfs: got error while scanning device '0000:04:01.0': the pci 'config' file has an invalid format

This is with 0.19.0, manually installed by pulling the binary.

The device in question as seen by lspci:

04:01.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] (rev 06) (prog-if 00 [Normal decode])
        Subsystem: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018]
        !!! Unknown header type 7f
        Interrupt: pin ? routed to IRQ 127
        IOMMU group: 18
        I/O behind bridge: 00006000-00006fff [size=4K] [32-bit]
        Memory behind bridge: 5e000000-5e2fffff [size=3M] [32-bit]
        Prefetchable memory behind bridge: 0000006000000000-000000640fffffff [size=16640M] [64-bit]
        Kernel driver in use: pcieport

This seems to be unrelated to my actual eGPU itself, but for the sake of completeness, it's an RX 7800M in an external enclosure. I haven't installed any drivers manually, just attempting to roll with the amdgpu support already in the kernel. (Linux Mint 22 x64, kernel 6.8.0-49-generic).

@hertg
Copy link
Owner

hertg commented Nov 30, 2024

Might be an issue similar to #119, which I wasn't able to reproduce/resolve at the time. If you could provide me the original config file for your device at 04:01.0, maybe it would be possible to debug this one. (see my comment here for instructions on how you can send it to me in encrypted form).

The !!! Unknown header type 7f in your lspci output makes me think that maybe my gopci library can't handle that device, maybe it reports an unexptect/invalid configuration...

@mszaro
Copy link
Author

mszaro commented Nov 30, 2024

Well, that's interesting. I would be happy to send it to you, but I think I just worked out why it doesn't parse; it's empty!

mszaro@miniserv:/sys/bus/pci/devices/0000:04:01.0$ du config
0       config

I can't explain what this device is - wondering if it's something virtual created to use a TB3 cable between two TB4 devices? - but at any rate since this is a non-GPU device, perhaps the tool could ignore devices with malformed configs?

@hertg
Copy link
Owner

hertg commented Dec 1, 2024

Thanks for looking it up, yeah that's weird. And I agree, it should probably handle this error gracefully. I may need to address that in my gopci library. I really wonder where that invalid config file is coming from, though.

@mszaro
Copy link
Author

mszaro commented Dec 2, 2024

Yeah, I have no idea. I'm no expert on the spec by any means, but at least as an average Linux user I wouldn't expect /pci/.../config to be absent. It isn't, on any other devices on the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants