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 committed 2020-04-28 00:35:16 -04:00
1 父節點 922aa1b5dc
當前提交 0495eb2077
1 file changed
+3 -1
+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) {