Skip to content

Commit

Permalink
Print amdgpu version
Browse files Browse the repository at this point in the history
Change-Id: Ibab6e51489d436b66c3bac4bbd0f52a400ad6b0b
  • Loading branch information
gregrodgers authored and dayatsin-amd committed Oct 3, 2023
1 parent f1f463d commit b249107
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rocminfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,17 @@ int CheckInitialState(void) {
}
}
if (is_live){
printf("%sROCk module is loaded%s\n", COL_WHT, COL_RESET);
std::ifstream amdgpu_version("/sys/module/amdgpu/version");
if (amdgpu_version){
std::stringstream buffer;
buffer << amdgpu_version.rdbuf();
std::string vers;
std::getline(buffer, vers);
amdgpu_version.close();
printf("%sROCk module version %s is loaded%s\n", COL_WHT, vers.c_str(), COL_RESET);
} else {
printf("%sROCk module is loaded%s\n", COL_WHT, COL_RESET);
}
} else {
printf("%sROCk module is NOT live, possibly no GPU devices%s\n",
COL_RED, COL_RESET);
Expand Down

0 comments on commit b249107

Please sign in to comment.