Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip ENOENT for vram_str_path and sdma_str_path if files not created when passing some, but not all, GPUs to a docker image #194

Open
wants to merge 1 commit into
base: amd-staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/rocm_smi_kfd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,31 +464,31 @@ int GetProcessInfoForPID(uint32_t pid, rsmi_process_info_t *proc,
vram_str_path += std::to_string(gpu_id);

err = ReadSysfsStr(vram_str_path, &tmp);
if (err) {
return err;
if (err==0) {
if (!is_number(tmp)) {
return EINVAL;
}
proc->vram_usage += std::stoull(tmp);
}

if (!is_number(tmp)) {
return EINVAL;
else if (err!=2){
return err;
}

proc->vram_usage += std::stoull(tmp);

std::string sdma_str_path = proc_str_path;
sdma_str_path += "/sdma_";
sdma_str_path += std::to_string(gpu_id);

err = ReadSysfsStr(sdma_str_path, &tmp);
if (err) {
return err;
if (err==0) {
if (!is_number(tmp)) {
return EINVAL;
}
proc->sdma_usage += std::stoull(tmp);
}

if (!is_number(tmp)) {
return EINVAL;
else if(err!=2){
return err;
}

proc->sdma_usage += std::stoull(tmp);

// Build the path and read from Sysfs file, info that
// encodes Compute Unit usage by a process of interest
std::string cu_occupancy_path = proc_str_path;
Expand Down