Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions parts/linux/cloud-init/artifacts/10_azure_nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,20 @@ fi
cat << EOF
smbios --type 4 --get-string 7 --set cpu_manufacturer

if [ x\$cpu_manufacturer = xNVIDIA ]; then
if [ "x\$cpu_manufacturer" = xNVIDIA ]; then
set default="gnulinux-${NVIDIA}-advanced-${boot_device_id}"
set nvidia_args="iommu.passthrough=1 irqchip.gicv3_nolpi=y arm_smmu_v3.disable_msipolling=1"
set nvidia_args="iommu.passthrough=1"
set cpu_version=""
smbios --type 4 --get-string 16 --set cpu_version
# Grace requires GICv3 LPI and SMMUv3 MSI polling workarounds; Vera uses standard GICv3 ITS LPIs.
for cpu_word in \$cpu_version; do
if [ "x\$cpu_word" = xGrace ]; then
set nvidia_args="iommu.passthrough=1 irqchip.gicv3_nolpi=y arm_smmu_v3.disable_msipolling=1"
break
fi
done
unset cpu_word
unset cpu_version
else
set default="gnulinux-${OTHER}-advanced-${boot_device_id}"
fi
Expand Down
2 changes: 1 addition & 1 deletion parts/linux/cloud-init/artifacts/51-azure-nvidia.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 10_azure_nvidia selects the hardware-appropriate entry from a flat menu.
GRUB_DISABLE_SUBMENU=true

# Append NVIDIA Grace arguments only when the selector sets nvidia_args.
# Append NVIDIA kernel arguments only when the selector sets nvidia_args.
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \$nvidia_args"
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,21 @@ downloadGPUDrivers() {
local imex_package=""
if [ "$OS_VERSION" = "3.0" ] && [ "$(getCPUArch)" = "arm64" ]; then
case "${VM_SKU,,}" in
*gb200*|*gb300*)
*gb200*|*gb300*|*_vr_*|*nvl*)
local driver_version
driver_version=$(getAzureLinuxNvidiaDriverVersionFromPackage "$CUDA_PACKAGE" "cuda-open-")
if [ -z "$driver_version" ]; then
echo "Failed to determine NVIDIA driver version for IMEX"
exit $ERR_NVIDIA_DRIVER_INSTALL
fi

imex_package="nvidia-imex-${driver_version}"
# Starting with driver 620, NVIDIA's repo ships nvidia-imex-direct instead of nvidia-imex-<driver_version>.
local driver_major="${driver_version%%.*}"
if [[ "$driver_major" =~ ^[0-9]+$ ]] && [ "$driver_major" -ge 620 ]; then
imex_package="nvidia-imex-direct"
else
imex_package="nvidia-imex-${driver_version}"
fi
local config_path="${NVIDIA_IMEX_MODPROBE_CONFIG_PATH:-/etc/modprobe.d/nvidia-imex.conf}"
mkdir -p "$(dirname "$config_path")" || exit $ERR_NVIDIA_DRIVER_INSTALL
printf '%s\n' 'options nvidia NVreg_CreateImexChannel0=1' > "$config_path" || exit $ERR_NVIDIA_DRIVER_INSTALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ EOF
BeforeEach 'setup'
AfterEach 'cleanup'

It 'selects the newest RPM-owned kernel from each Azure Linux track'
It 'selects the newest RPM-owned kernel from each Azure Linux track and scopes Grace errata args'
When run script "$SCRIPT"
The status should be success
The output should include 'set default="gnulinux-2.0.10-test-advanced-test-device"'
The output should include 'set default="gnulinux-1.0.10-test-advanced-test-device"'
The output should include 'smbios --type 4 --get-string 16 --set cpu_version'
The output should include 'for cpu_word in $cpu_version; do'
The output should include 'if [ "x$cpu_word" = xGrace ]; then'
The output should include 'set nvidia_args="iommu.passthrough=1 irqchip.gicv3_nolpi=y arm_smmu_v3.disable_msipolling=1"'
The output should include 'set nvidia_args="iommu.passthrough=1"'
The output should not include '9.0.0-unowned'
The stderr should include 'Default NVIDIA image: 2.0.10-test, non-NVIDIA image: 1.0.10-test'
End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,28 +567,34 @@ EOF
The variable GRID_CALLED should not equal "true"
End

It 'selects the newest HWE OpenRM package for GB200'
Parameters
"GB200 on R580" "Standard_ND128isr_NDR_GB200_v6" "580.159.04" "nvidia-imex-580.159.04"
"Vera Rubin on R620" "Standard_ND168isr_VR_NVL72_v7" "620.70.10" "nvidia-imex-direct"
End

It "selects the newest HWE OpenRM and IMEX packages for $1"
OS_VERSION="3.0"
NVIDIA_GPU_DRIVER_TYPE="cuda-lts"
MOCK_VM_SKU="Standard_ND128isr_NDR_GB200_v6"
MOCK_VM_SKU="$2"
MOCK_DRIVER_VER="$3"
MOCK_OPEN_RET=0
MOCK_KERNEL_PACKAGE="kernel-hwe"
uname() { echo "9.9.2-1.azl3"; }
dnf() {
echo "cuda-open-999.1.2-2_9.9.2.1.azl3.aarch64"
echo "cuda-open-hwe-999.1.2-1_9.9.2.1.azl3.aarch64"
echo "cuda-open-hwe-999.1.2-2_9.9.2.1.azl3.aarch64"
echo "cuda-open-hwe-999.1.2-2_9.8.1.1.azl3.aarch64"
echo "cuda-open-${MOCK_DRIVER_VER}-2_9.9.2.1.azl3.aarch64"
echo "cuda-open-hwe-${MOCK_DRIVER_VER}-1_9.9.2.1.azl3.aarch64"
echo "cuda-open-hwe-${MOCK_DRIVER_VER}-2_9.9.2.1.azl3.aarch64"
echo "cuda-open-hwe-${MOCK_DRIVER_VER}-2_9.8.1.1.azl3.aarch64"
}

When call downloadGPUDrivers

The status should be success
The output should include "updateDnfWithNvidiaPkg"
The output should include "dnf install 30 1 600 cuda-open-hwe-999.1.2-2_9.9.2.1.azl3.aarch64 nvidia-imex-999.1.2"
The output should include "dnf install 30 1 600 cuda-open-hwe-${3}-2_9.9.2.1.azl3.aarch64 ${4}"
The output should include "removeNvidiaRepos"
The output should include "systemctl_disable 20 5 25 nvidia-imex"
The output should not include "dnf install 30 1 600 cuda-open-999.1.2-2_9.9.2.1.azl3.aarch64"
The output should not include "dnf install 30 1 600 cuda-open-${3}-2_9.9.2.1.azl3.aarch64"
The output should not include "dracut"
The output should not include "shutdown"
The contents of file "$imex_config_path" should equal "options nvidia NVreg_CreateImexChannel0=1"
Expand Down
Loading