From 3e91378b4a842eb698f3632ece3acd357a59121b Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Wed, 14 Oct 2020 02:57:53 +0000 Subject: [PATCH] Fix PCI bus domain ID SWDEV-256338 Change-Id: I09afdca4f1a08f99ce662a4c4ed8a51d85500699 --- device/device.hpp | 3 +++ device/rocm/rocdevice.cpp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/device/device.hpp b/device/device.hpp index d0fdc7276..da5b07b4d 100755 --- a/device/device.hpp +++ b/device/device.hpp @@ -452,6 +452,9 @@ struct Info : public amd::EmbeddedObject { //! Returns the topology for the device cl_device_topology_amd deviceTopology_; + //! Returns PCI Bus Domain ID + uint32_t pciDomainID; + //! Semaphore information uint32_t maxSemaphores_; uint32_t maxSemaphoreSize_; diff --git a/device/rocm/rocdevice.cpp b/device/rocm/rocdevice.cpp index 004be5a9c..32cc259c3 100755 --- a/device/rocm/rocdevice.cpp +++ b/device/rocm/rocdevice.cpp @@ -618,6 +618,13 @@ bool Device::create() { info_.deviceTopology_.pcie.bus = (hsa_bdf_id & (0xFF << 8)) >> 8; info_.deviceTopology_.pcie.device = (hsa_bdf_id & (0x1F << 3)) >> 3; info_.deviceTopology_.pcie.function = (hsa_bdf_id & 0x07); + uint32_t pci_domain_id = 0; + if (HSA_STATUS_SUCCESS != + hsa_agent_get_info(_bkendDevice, + static_cast(HSA_AMD_AGENT_INFO_DOMAIN), &pci_domain_id)) { + return false; + } + info_.pciDomainID = pci_domain_id; #ifdef WITH_AMDGPU_PRO // Create amdgpu-pro device interface for SSG support