Skip to content

Fix AMD GPU driver installation failure on Ubuntu 22.04 (jammy)#652

Merged
AlexW-F merged 5 commits intomainfrom
users/alexwill/amdgpubabelstreamfix
Mar 12, 2026
Merged

Fix AMD GPU driver installation failure on Ubuntu 22.04 (jammy)#652
AlexW-F merged 5 commits intomainfrom
users/alexwill/amdgpubabelstreamfix

Conversation

@AlexW-F
Copy link
Contributor

@AlexW-F AlexW-F commented Mar 11, 2026

Problem

The AMD GPU driver installation fails on Ubuntu 22.04 (jammy) Azure VMs
because it hardcodes a ROCm 5.5 driver URL targeting Ubuntu 20.04
(focal). The amdgpu-dkms kernel module from ROCm 5.5 cannot build
against kernel 6.8.x, leaving dpkg in a broken state that poisons all
subsequent apt-get commands. VirtualClient retries 6 times and then
gives up.

Changes

AMDGPUDriverInstallation.cs

  • Added OS codename detection by parsing VERSION_CODENAME from
    /etc/os-release during InitializeAsync
  • Added SupportedInstallationFiles dictionary mapping Ubuntu codenames
    to the correct ROCm driver URLs (focal → ROCm
    5.5, jammy → ROCm 6.3.3)
  • Added ResolveLinuxInstallationFile() — uses profile
    LinuxInstallationFile parameter as override if provided, otherwise
    auto-resolves from the built-in mapping
  • Fixed dpkg cleanup commands: changed single quotes to double quotes
    in bash -c wrappers (.NET ProcessStartInfo on Linux does not handle
    single quotes for argument grouping)
  • Retained existing fixes: GetUserHomePath(), .bashrc path creation,
    dpkg cleanup commands

AMDGPUDriverInstallationTests.cs

  • Added /etc/os-release mock in test setup
  • Added 4 new test cases: jammy URL resolution, focal URL resolution,
    profile parameter override, unsupported codename error
  • All 8 tests pass

Validation

Tested on an Azure VM (Standard_D2s_v5, Ubuntu 22.04 jammy, kernel
6.8.0-1044-azure):

  • Codename correctly detected as jammy
  • ROCm
    6.3.3 URL resolved: wget https://repo.radeon.com/amdgpu-install/6.3.3/
    ubuntu/jammy/amdgpu-install_6.3.60303-1_all.deb
  • amdgpu-install -y --usecase=hiplibsdk,rocm,dkms ran successfully
  • DKMS build started for amdgpu
    6.10.5 on kernel 6.8.0 (the exact step that was failing with ROCm 5.5)
  • No disk space or dpkg quoting issues

Alex Williams-Ferreira and others added 4 commits March 2, 2026 12:32
Detect Ubuntu codename from /etc/os-release and resolve the correct
ROCm installation URL from a built-in mapping (focal->5.5, jammy->6.3.3).
This fixes BabelStream failures on Ubuntu 22.04 where ROCm 5.5's
amdgpu-dkms module fails to build on kernel 6.8.x, leaving dpkg broken
and crashing VirtualClient repeatedly.

Changes:
- Add SupportedInstallationFiles codename-to-URL mapping
- Add DetectOsVersionCodenameAsync and ResolveLinuxInstallationFile
- Add dpkg cleanup commands for broken amdgpu-dkms package state
- Fix bashrc path for root users via GetUserHomePath
- Add unit tests for codename resolution, fallback, and error cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
.NET ProcessStartInfo on Linux does not handle single quotes for
argument grouping - only double quotes work. The previous bash -c
commands with single quotes caused argv to be split incorrectly,
resulting in 'unexpected EOF' errors.

Also removed 2>/dev/null redirects since stderr is captured by the
process proxy anyway.

Verified on Ubuntu 22.04 VM: dpkg cleanup runs successfully, codename
detection resolves to jammy, and ROCm 6.3.3 driver installation begins
correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AlexW-F
Copy link
Contributor Author

AlexW-F commented Mar 11, 2026

@microsoft-github-policy-service agree company="Microsoft"

@AlexW-F AlexW-F merged commit 2d869c1 into main Mar 12, 2026
5 checks passed
@AlexW-F AlexW-F deleted the users/alexwill/amdgpubabelstreamfix branch March 12, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants