Skip to content

Commit

Permalink
Check /sys/module/amdgpu for ROCk instead of lsmod
Browse files Browse the repository at this point in the history
Closes: #42

Signed-off-by: YiyangWu <[email protected]>
  • Loading branch information
littlewu2508 authored and LiXueying0309 committed Aug 15, 2024
1 parent aa8a838 commit d00aee6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rocminfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,14 @@ int CheckInitialState(void) {
return -1;
}
} else {
printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n",
int module_dir;
module_dir = open("/sys/module/amdgpu", O_DIRECTORY);
if (module_dir < 0) {
printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n",
COL_RED, COL_RESET);
return -1;
return -1;
}
close(module_dir);
}

// Check if user belongs to the group for /dev/kfd (e.g. "video" or
Expand Down

0 comments on commit d00aee6

Please sign in to comment.