mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Unify reading pci paths
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cee785f8a1
commit
7d64d8e00e
@@ -17,6 +17,7 @@
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/os_interface/linux/hw_device_id.h"
|
||||
#include "shared/source/os_interface/linux/os_inc.h"
|
||||
#include "shared/source/os_interface/linux/os_interface.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
#include "shared/source/os_interface/linux/system_info.h"
|
||||
#include "shared/source/os_interface/os_environment.h"
|
||||
@@ -362,7 +363,10 @@ std::vector<std::unique_ptr<HwDeviceId>> OSInterface::discoverDevices(ExecutionE
|
||||
for (unsigned int i = 0; i < maxDrmDevices; i++) {
|
||||
std::string path = std::string(pathPrefix) + std::to_string(i + startNum);
|
||||
int fileDescriptor = SysCalls::open(path.c_str(), O_RDWR);
|
||||
appendHwDeviceId(hwDeviceIds, fileDescriptor, "00:02.0");
|
||||
|
||||
auto pciPath = OSInterface::OSInterfaceImpl::getPciPath(fileDescriptor);
|
||||
|
||||
appendHwDeviceId(hwDeviceIds, fileDescriptor, pciPath.value_or("00:02.0").c_str());
|
||||
if (!hwDeviceIds.empty() && hwDeviceIds.size() == numRootDevices) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user