Skip to content

Commit c293ff0

Browse files
[Test] Skip Nvidia driver installation if Deep Learning AMI is used
Signed-off-by: Hanwen <hanwenli@amazon.com>
1 parent ada534f commit c293ff0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/integration-tests/tests/createami/test_createami.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ def test_build_image(
124124
bucket_name = s3_bucket_factory()
125125
_set_s3_bucket_policy(bucket_name, get_arn_partition(region), region)
126126

127+
enable_nvidia = True
127128
# Get base AMI
128129
if os in ["alinux2", "ubuntu2004"]:
129130
# Test Deep Learning AMIs
130131
base_ami = retrieve_latest_ami(region, os, ami_type="remarkable", architecture=architecture)
132+
enable_nvidia = False # Deep learning AMIs have Nvidia pre-installed
131133
elif "rhel" in os or "rocky" in os or "ubuntu" in os:
132134
# Test AMIs from first stage build. Because RHEL/Rocky and Ubuntu have specific requirement of kernel versions.
133135
try:
@@ -144,7 +146,7 @@ def test_build_image(
144146
parent_image=base_ami,
145147
instance_role=instance_role,
146148
bucket_name=bucket_name,
147-
gpu_count=get_gpu_count(instance),
149+
enable_nvidia=str(enable_nvidia and get_gpu_count(instance) > 0).lower(),
148150
)
149151

150152
image = images_factory(image_id, image_config, region)

tests/integration-tests/tests/createami/test_createami/test_build_image/image.config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Build:
2424
# Disable Lustre installation because these newer operating systems release new kernels more often. Lustre usually does not support the latest kernels
2525
Enabled: {% if os in ["ubuntu2204", "rhel9", "rocky9"] %} false {% else %} true {% endif %}
2626
NvidiaSoftware:
27-
Enabled: {% if gpu_count > 0 %} true {% else %} false {% endif %}
27+
Enabled: {{ enable_nvidia }}
2828

2929
CustomS3Bucket: {{ bucket_name }}
3030

0 commit comments

Comments
 (0)