From 142492d9ebf17099063ee490ce3cf97b73a3e4b2 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Wed, 20 Sep 2023 09:38:27 -0500 Subject: [PATCH] SWDEV-422580 - Adding pcie.function to the PCI address string in hipGetDevicePCIBusId. Change-Id: Iaa73b6028ac7b1d05cc310405d6fe622d764320f [ROCm/clr commit: 369fdc4d87eb262021246aafd0c07b6473ae1fd8] --- projects/clr/hipamd/src/hip_device_runtime.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/src/hip_device_runtime.cpp b/projects/clr/hipamd/src/hip_device_runtime.cpp index c024216a9b..5ecf9a6d17 100644 --- a/projects/clr/hipamd/src/hip_device_runtime.cpp +++ b/projects/clr/hipamd/src/hip_device_runtime.cpp @@ -443,10 +443,12 @@ hipError_t hipDeviceGetPCIBusId ( char* pciBusId, int len, int device ) { hipDeviceProp_t prop; HIP_RETURN_ONFAIL(ihipGetDeviceProperties(&prop, device)); - snprintf (pciBusId, len, "%04x:%02x:%02x.0", + auto* deviceHandle = g_devices[device]->devices()[0]; + snprintf (pciBusId, len, "%04x:%02x:%02x.%01x", prop.pciDomainID, prop.pciBusID, - prop.pciDeviceID); + prop.pciDeviceID, + deviceHandle->info().deviceTopology_.pcie.function); HIP_RETURN(len <= 12 ? hipErrorInvalidValue : hipSuccess); }