Merge ~tai271828/+git/maas-preseeds:mr-linux-nvidia-curtin-templating into ~ce-hyperscale/+git/maas-preseeds:main

Proposed by Taihsiang Ho
Status: Merged
Approved by: dann frazier
Approved revision: f4066bc0bb419e630328e4886e299f9dde13006b
Merged at revision: de45f843188160f36ff7a556d04442efce0b786d
Proposed branch: ~tai271828/+git/maas-preseeds:mr-linux-nvidia-curtin-templating
Merge into: ~ce-hyperscale/+git/maas-preseeds:main
Diff against target: 78 lines (+34/-14)
2 files modified
curtin_userdata_dgx (+5/-0)
late.sh (+29/-14)
Reviewer Review Type Date Requested Status
dann frazier Approve
Review via email: mp+441716@code.launchpad.net

Description of the change

Per our discussion in https://warthogs.atlassian.net/browse/NVDGX-108?focusedCommentId=227032 , let's apply the curtin templating workaround.

- I have deployed blanka with Jammy and focal, and I will get the corresponding linux-nvidia and linux-generic.
- I don't have a chance to try with akis to see if we have any regression yet as it was occupied by kernel testing.

To post a comment you must log in.
Revision history for this message
dann frazier (dannf) wrote :

I'd suggesting cherry-picking the original versions of the first 3 commits instead of reverting revert commits, but with only that change, +1!

review: Approve
Revision history for this message
Taihsiang Ho (tai271828) wrote :

Rebased by following the suggestion of cherry-picking. Landing the mr.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

Merged. Deploy to Needham MAAS and Taipei MAAS.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

Deployed*

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin_userdata_dgx b/curtin_userdata_dgx
2index 7380386..d1c2a4e 100644
3--- a/curtin_userdata_dgx
4+++ b/curtin_userdata_dgx
5@@ -97,6 +97,11 @@ debconf_selections:
6 swap:
7 size: 0
8
9+{{if release not in ["xenial", "bionic", "focal"]}}
10+kernel:
11+ package: linux-nvidia
12+{{endif}}
13+
14 late_commands:
15 maas: ['wget', '--no-proxy', '{{node_disable_pxe_url}}', '--post-data', '{{node_disable_pxe_data}}', '-O', '/dev/null']
16 01_maas_preseed: ['curtin', 'in-target', '--', 'git', 'clone', 'https://git.launchpad.net/~ce-hyperscale/+git/maas-preseeds', '/tmp/maas-dgx-preseed']
17diff --git a/late.sh b/late.sh
18index 37be944..29cfe7e 100755
19--- a/late.sh
20+++ b/late.sh
21@@ -18,9 +18,9 @@ install_mellanox_ofed() {
22 MELLANOX_OFED_VERSION=4.9-2.2.4.0
23 ;;
24 *)
25- # nvidia seems to make future DGX MOFED-less, and DGX OS does not
26- # install MOFED. Let's try to have the same performance
27- # characteristics for jammy and above.
28+ # nvidia seems to make future DGX MOFED-less, and DGX OS starting
29+ # with jammy does not install MOFED. Let's try to have the same
30+ # performance characteristics for jammy and above.
31 return 0
32 esac
33 mlnx_url="${MLNX_REPO}/${MELLANOX_OFED_VERSION}/ubuntu${ubuntu_ver}/mellanox_mlnx_ofed.list"
34@@ -127,18 +127,33 @@ fi
35
36 pkgs="nvidia-utils-${NVIDIA_DRIVER_VERSION}"
37 pkgs="${pkgs} nvidia-kernel-source-${NVIDIA_DRIVER_VERSION}"
38-ubuntu_ver="$(lsb_release -rs)"
39+# For nvidia flavor it is a bit tricky since the nomenculate is not consistent
40+# with generic and other flavors fully. For example,
41+# $ dpkg-query -W -f '${Package}\n' linux-nvidia*
42+# linux-nvidia
43+# linux-nvidia-headers-5.15.0-1015
44+# linux-nvidia-source-5.15.0
45+# linux-nvidia-tools
46+# but the generic headers would look like
47+# linux-headers-generic
48+# linux-headers-5.15.0-25-generic
49+# even more, this is the hwe flavor for example:
50+# linux-headers-generic-hwe-20.04
51+#
52+# So using similar pattern to generalize regex will not work.
53+#
54+# Lastly, brace expansion is not POSIX. Dash does not support brace expansion
55+# so we do not use something like:
56+# linux-{generic,nvidia}
57+# and let us use the other approaches like a for-loop instead.
58+for possible_flavor_pattern in linux-generic* linux-nvidia; do
59+ for metapkg in $(dpkg-query -W -f '${Package}\n' "${possible_flavor_pattern}"); do
60+ flavor=${metapkg#linux-}
61+ pkgs="$pkgs linux-modules-nvidia-${NVIDIA_DRIVER_VERSION}-${flavor}"
62+ echo $pkgs
63+ done
64+done
65
66-case $ubuntu_ver in
67- 22.04)
68- pkgs="$pkgs linux-modules-nvidia-${NVIDIA_DRIVER_VERSION}-nvidia linux-nvidia"
69- ;;
70- *)
71- for metapkg in $(dpkg-query -W -f '${Package}\n' "linux-generic*"); do
72- flavor=${metapkg#linux-}
73- pkgs="$pkgs linux-modules-nvidia-${NVIDIA_DRIVER_VERSION}-${flavor}"
74- done
75-esac
76 apt install -y ${pkgs}
77 install_fabric_manager
78 install_mellanox_ofed

Subscribers

People subscribed via source and target branches

to all changes: