Skip to content

Commit 0e1a699

Browse files
authored
Fix bug caused by disabled gpu (#69)
Many AMD iGPUs are paired with a dGPU, and the BIOS has the option to disable the iGPU. Doing so can fix a variety of software problems related to multi-GPU-incompatible software. When this happens, rocm-smi prints an error message to stderr since the amdgpu driver is not initalized, but returns 0. Checking that there was actually data returned fixes the crash (since amd-smi correctly returns 255) for those with this hardware configuration. Signed-off-by: Owen Hilyard <hilyard.owen@gmail.com>
1 parent a6252c8 commit 0e1a699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mojo/mojo_host_platform.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def _get_amd_constraints_with_rocm_smi(rctx, rocm_smi, gpu_mapping):
6767
_log_result(rctx, rocm_smi, result)
6868

6969
constraints = []
70-
if result.return_code == 0:
70+
if result.return_code == 0 and len(result.stdout) > 0: #len(result.stdout) == 0 when the driver is not initialized
7171
blob = json.decode(result.stdout)
7272
if len(blob.keys()) == 0:
7373
fail("rocm-smi succeeded but didn't actually have any GPUs, please report this issue")

0 commit comments

Comments
 (0)