Skip to content

Commit f3f36d6

Browse files
committed
test: Verify Intel AMX is reported inside guest
To check that Intel AMX is indeed supported inside guest, check related features are listed in CPUID output. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 9ac05eb commit f3f36d6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/integration_tests/functional/test_cpu_features_x86_64.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,3 +979,37 @@ def test_c3_on_skylake_show_warning(uvm_plain, cpu_template_any):
979979
assert message in uvm.log_data
980980
else:
981981
assert message not in uvm.log_data
982+
983+
984+
@pytest.mark.skipif(
985+
global_props.cpu_codename != "INTEL_SAPPHIRE_RAPIDS"
986+
or global_props.host_linux_version_tpl < (5, 17),
987+
reason="Intel AMX is only supported on Intel Sapphire Rapids and kernel v5.17+",
988+
)
989+
def test_intel_amx_reported_on_sapphire_rapids(
990+
microvm_factory, guest_kernel_linux_6_1, rootfs
991+
):
992+
"""
993+
Verifies that Intel AMX is reported on guest (v5.17+)
994+
"""
995+
uvm = microvm_factory.build(guest_kernel_linux_6_1, rootfs)
996+
uvm.spawn()
997+
uvm.basic_config()
998+
uvm.add_net_iface()
999+
uvm.start()
1000+
1001+
expected_dict = {
1002+
"AMX-BF16: tile bfloat16 support": "true", # CPUID.(EAX=07H,ECX=0):EDX[22]
1003+
"AMX-TILE: tile architecture support": "true", # CPUID.(EAX=07H,ECX=0):EDX[24]
1004+
"AMX-INT8: tile 8-bit integer support": "true", # CPUID.(EAX=07H,ECX=0):EDX[25]
1005+
"AMX-FP16: FP16 tile operations": "false", # CPUID.(EAX=07H,ECX=1):EAX[21], not supported on host as well
1006+
"XTILECFG state": "true", # CPUID.(EAX=0DH,ECX=0):EAX[17]
1007+
"XTILEDATA state": "true", # CPUID.(EAX=0DH,ECX=0):EAX[17]
1008+
}
1009+
cpuid_utils.check_guest_cpuid_output(
1010+
uvm,
1011+
"cpuid -1",
1012+
None,
1013+
"=",
1014+
expected_dict,
1015+
)

0 commit comments

Comments
 (0)