Skip to content

Commit a8fd165

Browse files
CUDA: lower-case PCI bus id, standardize for ggml (ggml-org#22820)
1 parent 6d57a49 commit a8fd165

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

ggml/include/ggml-backend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ extern "C" {
169169
// device type
170170
enum ggml_backend_dev_type type;
171171
// device id
172-
// for PCI devices, this should be the PCI bus id formatted as "domain:bus:device.function" (e.g. "0000:01:00.0")
172+
// for PCI devices, this should be the lower-case PCI bus id formatted as "domain:bus:device.function" (e.g. "0000:c1:00.0")
173173
// if the id is unknown, this should be NULL
174174
const char * device_id;
175175
// device capabilities

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5434,6 +5434,9 @@ ggml_backend_reg_t ggml_backend_cuda_reg() {
54345434
char pci_bus_id[32] = {};
54355435
CUDA_CHECK(cudaDeviceGetPCIBusId(pci_bus_id, sizeof(pci_bus_id), i));
54365436
dev_ctx->pci_bus_id = pci_bus_id;
5437+
for (char & c : dev_ctx->pci_bus_id) {
5438+
c = std::tolower(c);
5439+
}
54375440
dev_ctx->op_offload_min_batch_size = min_batch_size;
54385441

54395442
ggml_backend_dev_t dev = new ggml_backend_device {

0 commit comments

Comments
 (0)