@@ -41,13 +41,29 @@ func TestNVDriverTemplate(t *testing.T) {
4141 },
4242 expectedOutput : `
4343
44- sudo apt-get update
45- install_packages_with_retry linux-headers-$(uname -r)
44+ # Install Dependencies
45+ with_retry 3 10s sudo apt-get update
46+ install_packages_with_retry linux-headers-$(uname -r) gcc make
47+ install_packages_with_retry apt-utils build-essential \
48+ ca-certificates \
49+ curl \
50+ kmod \
51+ file \
52+ libelf-dev \
53+ libglvnd-dev \
54+ pkg-config
55+
56+ install_packages_with_retry gcc-12 g++-12 && \
57+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 && \
58+ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
59+
60+ # Install the new cuda-keyring package
4661distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
4762wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-keyring_1.1-1_all.deb
4863sudo dpkg -i cuda-keyring_1.1-1_all.deb
49-
5064with_retry 3 10s sudo apt-get update
65+
66+ # Install the NVIDIA driver
5167install_packages_with_retry cuda-drivers=123.4.5
5268
5369# Check if NVIDIA module is loaded, if not load it
@@ -68,14 +84,29 @@ nvidia-smi
6884 Branch : "550" ,
6985 },
7086 expectedOutput : `
71-
72- sudo apt-get update
73- install_packages_with_retry linux-headers-$(uname -r)
87+ # Install Dependencies
88+ with_retry 3 10s sudo apt-get update
89+ install_packages_with_retry linux-headers-$(uname -r) gcc make
90+ install_packages_with_retry apt-utils build-essential \
91+ ca-certificates \
92+ curl \
93+ kmod \
94+ file \
95+ libelf-dev \
96+ libglvnd-dev \
97+ pkg-config
98+
99+ install_packages_with_retry gcc-12 g++-12 && \
100+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 && \
101+ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
102+
103+ # Install the new cuda-keyring package
74104distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
75105wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-keyring_1.1-1_all.deb
76106sudo dpkg -i cuda-keyring_1.1-1_all.deb
77-
78107with_retry 3 10s sudo apt-get update
108+
109+ # Install the NVIDIA driver
79110install_packages_with_retry cuda-drivers-550
80111
81112# Check if NVIDIA module is loaded, if not load it
@@ -97,14 +128,29 @@ nvidia-smi
97128 Version : "123.4.5" ,
98129 },
99130 expectedOutput : `
100-
101- sudo apt-get update
102- install_packages_with_retry linux-headers-$(uname -r)
131+ # Install Dependencies
132+ with_retry 3 10s sudo apt-get update
133+ install_packages_with_retry linux-headers-$(uname -r) gcc make
134+ install_packages_with_retry apt-utils build-essential \
135+ ca-certificates \
136+ curl \
137+ kmod \
138+ file \
139+ libelf-dev \
140+ libglvnd-dev \
141+ pkg-config
142+
143+ install_packages_with_retry gcc-12 g++-12 && \
144+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 && \
145+ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
146+
147+ # Install the new cuda-keyring package
103148distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
104149wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-keyring_1.1-1_all.deb
105150sudo dpkg -i cuda-keyring_1.1-1_all.deb
106-
107151with_retry 3 10s sudo apt-get update
152+
153+ # Install the NVIDIA driver
108154install_packages_with_retry cuda-drivers=123.4.5
109155
110156# Check if NVIDIA module is loaded, if not load it
0 commit comments