mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00

While running the new GPU tests it was noted that the proprietary nVidia driver barfed when run under the sanitiser: 2025-02-20 11:13:08,226: [11:13:07.782] Output 'headless' attempts EOTF mode SDR and colorimetry mode default. 2025-02-20 11:13:08,227: [11:13:07.784] Output 'headless' using color profile: stock sRGB color profile and that's the last thing it outputs. The sanitizer reports that when the framework sends the SIGTERM because of the timeout we get a write to a NULL pointer (but interesting not this time in an atexit callback): UndefinedBehaviorSanitizer:DEADLYSIGNAL ==471863==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7a18ceaafe80 bp 0x000000000000 sp 0x7ffe8e3ff6d0 T471863) ==471863==The signal is caused by a WRITE memory access. ==471863==Hint: address points to the zero page. #0 0x7a18ceaafe80 (/lib/x86_64-linux-gnu/libnvidia-eglcore.so.535.183.01+0x16afe80) (BuildId: 24b0d0b90369112e3de888a93eb8d7e00304a6db) #1 0x7a18ce9e72c0 (/lib/x86_64-linux-gnu/libnvidia-eglcore.so.535.183.01+0x15e72c0) (BuildId: 24b0d0b90369112e3de888a93eb8d7e00304a6db) #2 0x7a18ce9f11bb (/lib/x86_64-linux-gnu/libnvidia-eglcore.so.535.183.01+0x15f11bb) (BuildId: 24b0d0b90369112e3de888a93eb8d7e00304a6db) #3 0x7a18ce6dc9d1 (/lib/x86_64-linux-gnu/libnvidia-eglcore.so.535.183.01+0x12dc9d1) (BuildId: 24b0d0b90369112e3de888a93eb8d7e00304a6db) #4 0x7a18e7d15326 in vrend_renderer_create_fence /usr/src/virglrenderer-1.0.0-1ubuntu2/obj-x86_64-linux-gnu/../src/vrend_renderer.c:10883:26 #5 0x55bfb6621871 in virtio_gpu_virgl_process_cmd The #dri-devel channel confirmed: <digetx> stsquad: nv driver is known to not work with venus, don't use it for testing So lets skip running the test to avoid known failures. As we now use vulkaninfo to probe we also need to handle the case where there is no Vulkan driver configured for the hardware. Reviewed-by: Thomas Huth <thuth@redhat.com> Reported-by: Peter Maydell <peter.maydell@linaro.org> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com> [AJB: also skip if vulkaninfo can't find environment] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20250304222439.2035603-6-alex.bennee@linaro.org>
115 lines
4.3 KiB
Python
Executable file
115 lines
4.3 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
#
|
|
# Functional tests for the various graphics modes we can support.
|
|
#
|
|
# Copyright (c) 2024, 2025 Linaro Ltd.
|
|
#
|
|
# Author:
|
|
# Alex Bennée <alex.bennee@linaro.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
from qemu.machine.machine import VMLaunchFailure
|
|
|
|
from qemu_test import Asset
|
|
from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
|
|
from qemu_test import skipIfMissingCommands
|
|
|
|
from qemu_test.linuxkernel import LinuxKernelTest
|
|
|
|
from re import search
|
|
from subprocess import check_output, CalledProcessError
|
|
|
|
class Aarch64VirtGPUMachine(LinuxKernelTest):
|
|
|
|
ASSET_VIRT_GPU_KERNEL = Asset(
|
|
'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/'
|
|
'download?path=%2F&files='
|
|
'Image',
|
|
'89e5099d26166204cc5ca4bb6d1a11b92c217e1f82ec67e3ba363d09157462f6')
|
|
|
|
ASSET_VIRT_GPU_ROOTFS = Asset(
|
|
'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/'
|
|
'download?path=%2F&files='
|
|
'rootfs.ext4.zstd',
|
|
'792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4')
|
|
|
|
def _launch_virt_gpu(self, gpu_device):
|
|
|
|
self.set_machine('virt')
|
|
self.require_accelerator("tcg")
|
|
|
|
kernel_path = self.ASSET_VIRT_GPU_KERNEL.fetch()
|
|
image_path = self.uncompress(self.ASSET_VIRT_GPU_ROOTFS, format="zstd")
|
|
|
|
self.vm.set_console()
|
|
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
|
'console=ttyAMA0 root=/dev/vda')
|
|
|
|
self.vm.add_args("-accel", "tcg")
|
|
self.vm.add_args("-cpu", "neoverse-v1,pauth-impdef=on")
|
|
self.vm.add_args("-machine", "virt,gic-version=max",
|
|
'-kernel', kernel_path,
|
|
'-append', kernel_command_line)
|
|
self.vm.add_args("-smp", "2", "-m", "2048")
|
|
self.vm.add_args("-device", gpu_device)
|
|
self.vm.add_args("-display", "egl-headless")
|
|
self.vm.add_args("-display", "dbus,gl=on")
|
|
|
|
self.vm.add_args("-device", "virtio-blk-device,drive=hd0")
|
|
self.vm.add_args("-blockdev",
|
|
"driver=raw,file.driver=file,"
|
|
"node-name=hd0,read-only=on,"
|
|
f"file.filename={image_path}")
|
|
self.vm.add_args("-snapshot")
|
|
|
|
try:
|
|
self.vm.launch()
|
|
except VMLaunchFailure as excp:
|
|
if "old virglrenderer, blob resources unsupported" in excp.output:
|
|
self.skipTest("No blob support for virtio-gpu")
|
|
elif "old virglrenderer, venus unsupported" in excp.output:
|
|
self.skipTest("No venus support for virtio-gpu")
|
|
elif "egl: no drm render node available" in excp.output:
|
|
self.skipTest("Can't access host DRM render node")
|
|
elif "'type' does not accept value 'egl-headless'" in excp.output:
|
|
self.skipTest("egl-headless support is not available")
|
|
else:
|
|
self.log.info("unhandled launch failure: %s", excp.output)
|
|
raise excp
|
|
|
|
self.wait_for_console_pattern('buildroot login:')
|
|
ec_and_wait(self, 'root', '#')
|
|
|
|
def _run_virt_weston_test(self, cmd, fail = None):
|
|
|
|
# make it easier to detect successful return to shell
|
|
PS1 = 'RES=[$?] # '
|
|
OK_CMD = 'RES=[0] # '
|
|
|
|
ec_and_wait(self, 'export XDG_RUNTIME_DIR=/tmp', '#')
|
|
ec_and_wait(self, f"export PS1='{PS1}'", OK_CMD)
|
|
full_cmd = f"weston -B headless --renderer gl --shell kiosk -- {cmd}"
|
|
ec_and_wait(self, full_cmd, OK_CMD, fail)
|
|
|
|
@skipIfMissingCommands('zstd')
|
|
def test_aarch64_virt_with_vulkan_gpu(self):
|
|
|
|
self.require_device('virtio-gpu-gl-pci')
|
|
|
|
try:
|
|
vk_info = check_output(["vulkaninfo", "--summary"],
|
|
encoding="utf-8")
|
|
except CalledProcessError as excp:
|
|
self.skipTest(f"Miss-configured host Vulkan: {excp.output}")
|
|
|
|
if search(r"driverID\s+=\s+DRIVER_ID_NVIDIA_PROPRIETARY", vk_info):
|
|
self.skipTest("Test skipped on NVIDIA proprietary driver")
|
|
|
|
self._launch_virt_gpu("virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on")
|
|
self._run_virt_weston_test("vkmark -b:duration=1.0",
|
|
"debug: stuck in fence wait with iter at")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
LinuxKernelTest.main()
|