From c05258e1678fd27afd4d25cf40f009317e79e0b8 Mon Sep 17 00:00:00 2001 From: r2k1 Date: Wed, 26 Feb 2025 12:01:06 +1300 Subject: [PATCH] use installer --- .../linux/cloud-init/artifacts/cse_config.sh | 8 +-- vhdbuilder/packer/install-dependencies.sh | 56 ++++++++++++++----- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/parts/linux/cloud-init/artifacts/cse_config.sh b/parts/linux/cloud-init/artifacts/cse_config.sh index 0c6d7206d39..e39ca98ad84 100755 --- a/parts/linux/cloud-init/artifacts/cse_config.sh +++ b/parts/linux/cloud-init/artifacts/cse_config.sh @@ -857,13 +857,9 @@ ensureAMDGPUDrivers() { ensureAMDGPUDriversUbuntu() { echo "Installing AMD GPU drivers" - pushd /var/cache/amdgpu-apt - ls -l - sudo dpkg -i *.deb - popd - - # delete amdgpu module from blacklist + # for some reason the amdgpu module is in blacklist and won't be loaded without this sudo sed -i '/blacklist amdgpu/d' /etc/modprobe.d/blacklist-radeon-instinct.conf + sudo ./root/rocm-offline-install.run REBOOTREQUIRED=true echo "AMD GPU drivers installed" diff --git a/vhdbuilder/packer/install-dependencies.sh b/vhdbuilder/packer/install-dependencies.sh index 6157d74ac8c..c5b54fe355e 100644 --- a/vhdbuilder/packer/install-dependencies.sh +++ b/vhdbuilder/packer/install-dependencies.sh @@ -634,27 +634,53 @@ downloadAMDGPUDriversUbuntu() { ;; esac - # Add validation keys for amdgpu repo - sudo mkdir --parents --mode=0755 /etc/apt/keyrings - wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ - gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null - sudo chmod 0644 /etc/apt/keyrings/rocm.gpg - - # for some reason the module is in blacklist for 22.04 and won't be loaded unless we remove it - # attempt to remove it for other releases as well, just in case - sudo sed -i '/blacklist amdgpu/d' /etc/modprobe.d/blacklist-radeon-instinct.conf if [ "${UBUNTU_RELEASE}" == "22.04" ]; then - echo "deb [arch=amd64,i386 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/6.3.3/ubuntu jammy main" \ - | sudo tee /etc/apt/sources.list.d/amdgpu.list + wget https://repo.radeon.com/rocm/installer/rocm-linux-install-offline/rocm-rel-6.3.3/ubuntu/22.04/rocm-offline-creator_1.0.7.60303-1~22.04.run -O rocm-offline-creator.run elif [ "${UBUNTU_RELEASE}" == "24.04" ]; then - echo "deb [arch=amd64,i386 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/6.3.3/ubuntu noble main" \ - | sudo tee /etc/apt/sources.list.d/amdgpu.list + wget https://repo.radeon.com/rocm/installer/rocm-linux-install-offline/rocm-rel-6.3.3/ubuntu/24.04/rocm-offline-creator_1.0.7.60303-1~24.04.run -O rocm-offline-creator.run + bash ./rocm-offline-creator_1.0.7.60303-1~24.04.run config=/etc/amdgpu.config else echo "Unexpected Ubuntu Release (${UBUNTU_RELEASE})" exit 1 fi - sudo apt-get update - sudo apt-get install -y amdgpu-dkms + sudo cat > /etc/amdgpu.config << EOL +# Creator/Build Options +############################### +INSTALL_PACKAGE_TYPE=0 +INSTALL_PACKAGE_NAME="rocm-offline-install.run" +INSTALL_PACKAGE_DIR=/root + +INSTALL_PACKAGE_REPO=0 + +DOWNLOAD_PKG_CONFIG_NUM=0 + +# ROCm Options +############################### +ROCM_USECASES=dkms +ROCM_VERSIONS=6.3.3 + +# Driver/amdgpu Options +############################### +AMDGPU_INSTALL_DRIVER=yes +AMDGPU_POST_INSTALL_BLACKLIST=no +AMDGPU_POST_INSTALL_START=yes + +# Post-Install Options +############################### +AMDGPU_POST_GPU_ACCESS_CURRENT_USER=no +AMDGPU_POST_GPU_ACCESS_ALL_USERS=no + +# Extra Package Options +############################### +EXTRA_PACKAGES_ONLY=no +EXTRA_PACKAGES="" + +# Post-Install Options +############################### +AMDGPU_POST_GPU_ACCESS_CURRENT_USER=no +AMDGPU_POST_GPU_ACCESS_ALL_USERS=no +EOL + sudo bash ./rocm-offline-creator.run config=/etc/amdgpu.config } downloadAMDGPUDrivers() {