Handle rsmi app running on machine with no AMD gpus

This fixes a seg fault that would happen in release builds when
there are no KFD nodes on a system, which occurs when there are
not AMD gpus present in the system. This use case occurs
for higher application code that is meant to be gpu agnostic.

Change-Id: If374930bc2e62f9898f337349cde3ebb16091ff0


[ROCm/amdsmi commit: 806f665a85]
Этот коммит содержится в:
Chris Freehill
2020-04-27 21:14:06 -05:00
родитель 922aa1b5dc
Коммит 0495eb2077
+3 -1
Просмотреть файл
@@ -429,7 +429,9 @@ int DiscoverKFDNodes(std::map<uint64_t, std::shared_ptr<KFDNode>> *nodes) {
uint32_t node_indx;
auto kfd_node_dir = opendir(kKFDNodesPathRoot);
assert(kfd_node_dir != nullptr);
if (kfd_node_dir == nullptr) {
return errno;
}
auto dentry = readdir(kfd_node_dir);
while (dentry != nullptr) {