From 854cbe1d24a94fd5572795966c12928722ff4253 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Wed, 3 Apr 2024 10:43:44 -0400 Subject: [PATCH] SWDEV-422580 - Adding back the pcie.function to PCI address string in hipGetDevicePCIBusId. Change-Id: I932724cc872d7ae2643ce6ac2924901cb49cd7ad [ROCm/clr commit: a1e0970d6d75116548fddd0fc33c0ca14c3b3355] --- projects/clr/hipamd/src/hip_device_runtime.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_device_runtime.cpp b/projects/clr/hipamd/src/hip_device_runtime.cpp index 32fc26fbd4..a735d2039a 100644 --- a/projects/clr/hipamd/src/hip_device_runtime.cpp +++ b/projects/clr/hipamd/src/hip_device_runtime.cpp @@ -541,7 +541,12 @@ hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device) { hipDeviceProp_tR0600 prop; HIP_RETURN_ONFAIL(ihipGetDeviceProperties(&prop, device)); - snprintf(pciBusId, len, "%04x:%02x:%02x.0", prop.pciDomainID, prop.pciBusID, prop.pciDeviceID); + auto* deviceHandle = g_devices[device]->devices()[0]; + snprintf (pciBusId, len, "%04x:%02x:%02x.%01x", + prop.pciDomainID, + prop.pciBusID, + prop.pciDeviceID, + deviceHandle->info().deviceTopology_.pcie.function); HIP_RETURN(len <= 12 ? hipErrorInvalidValue : hipSuccess); }