Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 3e91378

Browse files
committed
Fix PCI bus domain ID
SWDEV-256338 Change-Id: I09afdca4f1a08f99ce662a4c4ed8a51d85500699
1 parent 5cefcaf commit 3e91378

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

device/device.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ struct Info : public amd::EmbeddedObject {
452452
//! Returns the topology for the device
453453
cl_device_topology_amd deviceTopology_;
454454

455+
//! Returns PCI Bus Domain ID
456+
uint32_t pciDomainID;
457+
455458
//! Semaphore information
456459
uint32_t maxSemaphores_;
457460
uint32_t maxSemaphoreSize_;

device/rocm/rocdevice.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ bool Device::create() {
618618
info_.deviceTopology_.pcie.bus = (hsa_bdf_id & (0xFF << 8)) >> 8;
619619
info_.deviceTopology_.pcie.device = (hsa_bdf_id & (0x1F << 3)) >> 3;
620620
info_.deviceTopology_.pcie.function = (hsa_bdf_id & 0x07);
621+
uint32_t pci_domain_id = 0;
622+
if (HSA_STATUS_SUCCESS !=
623+
hsa_agent_get_info(_bkendDevice,
624+
static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_DOMAIN), &pci_domain_id)) {
625+
return false;
626+
}
627+
info_.pciDomainID = pci_domain_id;
621628

622629
#ifdef WITH_AMDGPU_PRO
623630
// Create amdgpu-pro device interface for SSG support

0 commit comments

Comments
 (0)