fix: CUDA device PCI bus ID de-dupe OOMing (ignoring other 3 gpus entirely)#22533
Open
lucyknada wants to merge 1 commit intoggml-org:masterfrom
Open
fix: CUDA device PCI bus ID de-dupe OOMing (ignoring other 3 gpus entirely)#22533lucyknada wants to merge 1 commit intoggml-org:masterfrom
lucyknada wants to merge 1 commit intoggml-org:masterfrom
Conversation
gaugarg-nv
reviewed
Apr 30, 2026
| char pci_bus_id[16] = {}; | ||
| snprintf(pci_bus_id, sizeof(pci_bus_id), "%04x:%02x:%02x.0", prop.pciDomainID, prop.pciBusID, prop.pciDeviceID); | ||
| char pci_bus_id[32] = {}; | ||
| CUDA_CHECK(cudaDeviceGetPCIBusId(pci_bus_id, sizeof(pci_bus_id), i)); |
Contributor
There was a problem hiding this comment.
I think this will fail compilation on hip/musa. You need to add the macro in vendor headers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Basically the same as here: #18673 I believe (I only recently updated nvidia drivers, so might be the exact same); after updating llama.cpp and nvidia drivers it started detecting my 4x 3090 as 1x 3090 and OOMing, this fixed the issue - CUDA itself returns unique IDs already too.
Additional information
I tested this on a 4x 3090 system where CUDA reported unique PCI bus IDs via
cudaDeviceGetPCIBusId(), but lcpp logged the same device ID for all GPUs and skipped the other three 3090's with a cli message and then OOM'd.Requirements