[SWDEV-560681] Allowed GPU enumeration to continue with non-contiguous render nodes (#1609)
* Fix uninitialized variable in GPU enumeration loop (#1643) * Initialize node_to_gpu_id to prevent undefined behavior --------- Signed-off-by: gabrpham <Gabriel.Pham@amd.com> Co-authored-by: Allan Xavier <axavier@digitalocean.com>
This commit is contained in:
@@ -685,7 +685,7 @@ KFDNode::Initialize(void) {
|
||||
|
||||
std::map<uint32_t, std::shared_ptr<IOLink>>::iterator it;
|
||||
uint32_t node_to;
|
||||
uint64_t node_to_gpu_id;
|
||||
uint64_t node_to_gpu_id = 0;
|
||||
std::shared_ptr<IOLink> link;
|
||||
bool numa_node_found = false;
|
||||
for (it = io_link_map_tmp.begin(); it != io_link_map_tmp.end(); it++) {
|
||||
@@ -693,7 +693,7 @@ KFDNode::Initialize(void) {
|
||||
node_to = it->first;
|
||||
link = it->second;
|
||||
ret = ReadKFDGpuId(node_to, &node_to_gpu_id);
|
||||
if (ret) {return ret;}
|
||||
if (ret) {continue;}
|
||||
if (node_to_gpu_id == 0) { // CPU node
|
||||
if (numa_node_found) {
|
||||
if (numa_node_weight_ > link->weight()) {
|
||||
|
||||
Reference in New Issue
Block a user