rocminfo fails when amdgpu is built into the kernel

When amdgpu is built into the kernel, /sys/module/amdgpu/initstate will not be created even when the driver is functional. However, test shows /sys/module/amdgpu will be present. Adding an additional check for /sys/module/amdgpu when /sys/module/amdgpu/instate is not present.

Change-Id: Ie5c67c7e1eff8ac1683b211aaec802d0d342aeeb
このコミットが含まれているのは:
Alex Xu authored and Alex Xu committed 2024-09-24 10:59:22 -04:00
1 親 9537420254
コミット c6f7a17c85
1ファイル変更
+8 -3
+8 -3
ファイルの表示
@@ -1220,9 +1220,14 @@ int CheckInitialState(void) {
return -1;
}
} else {
printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n",
COL_RED, COL_RESET);
return -1;
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;
}
close(module_dir);
}
// Check if user belongs to the group for /dev/kfd (e.g. "video" or