Although availability of computer games on Linux has improved a lot there is way more potential for openSUSE to fire them up.
This project is about improving the usability of openSUSE for gaming to appreciate the gamers who run openSUSE as their primary OS. The final goal for a number of improvements is that each gamer can play flawlessly without a single issue.
The recommended steps to achieve this:
Find out how to run graphical tests with hardware acceleration on bare metal machines.
Establish the preconditions in openQA when there is lack of them.
Write tests for games from the official repos which just check whether the game starts.
Investigate how to run game tests on platforms like Steam without leaking login credentials.
Extend the testing to modern AAA games on these platforms.
Find out how to implement realtime needle matching to verify the render output.
What does that help?
We get info about the necessary libraries to run these games and can decide how to improve their availability.
We get regression checks whether the game is still starting.
Depending how far this project may evolve we might be able to check for performance regressions as well.
CPU & IGP: AMD Ryzen 5 2400G (Vega11)
Mainboard: ASRock AB350 Pro4 , Bios P4.70
Memory: 16 GiB DDR4
GPU: AMD Radeon R9 290X
Hackweek 17 - Results: 1. Find out how to run graphical tests with hardware acceleration on bare metal machines. - Done.
Documentation : GPU-Passthrough (for this particular machine)
Plug one monitor in the IGP output to run the VM host and an other monitor in the dGPU to display the VM.
Enable AMD-Vi and IOMMU in UEFI of the mainboard. (In this case:
Advanced > CPU Configuration > SVM Mode: enabledand
Advanced > North Bridge Configuration > IOMMU: enabled)
Boot, install Tumbleweed and check whether IOMMU is running
dmesg | grep -i "\(iommu\|amd-vi\)"
Follow Steps 3 to 6 of the following guide: VGA PCI Passthrough guide on openSuSE Leap 42.2 - openSUSE Forums. For Step 5 use
/etc/dracut.conf.d/gpu-passthrough.conf. The following steps of the linked guide might also work for other systems but I got a black screen on the VM.
When the GPU is using
vfio-pcias driver on the VM host after reboot, produce a new virtual disk:
qemu-img create -f qcow2 vm_hdd.qcow2 200G
Use again the script in step 3 of the guide VGA PCI Passthrough guide on openSuSE Leap 42.2 - openSUSE Forums to get the correct device number. It is located directly after it's IOMMU Group number at the beginning of the line.
Get path to evdev devices:
ls /dev/input/by-id/ | grep "-event-"
Switch to root and use the following line to run the qemu-VM (adapt it regarding other hardware/addresses etc.):
qemu-system-x86_64 -enable-kvm -m 12000 -cpu host,kvm=off -smp 8,sockets=1,cores=4,threads=2 -device vfio-pci,host=10:00.0,x-vga=on -device vfio-pci,host=10:00.1 -vga none -hda /home/user/vm_hdd.qcow2 -object input-linux,id=kbd1,evdev=/dev/input/by-id/usb-DELL_Dell_USB_Entry_Keyboard-event-kbd,grab_all=on,repeat=on -object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-PixArt_Dell_MS116_USB_Optical_Mouse-event-mouse -nic user,model=virtio-net-pci. Specified inputs can be switched between the VM host and the VM guest by pressing both Ctrl keys on the keyboard. For Linux installation at first boot one needs to append
-cdrom /path/to/tumbleweed.isoas option.
(After installation on the VM press
ein Grub2 and add kernel boot parameter
nomodesetto break amdgpu and radeon modules and boot with software rendering mode. Copy necessary firmware from the Radeon ucode folder on freedesktop.org to
/lib/firmware/amdgpu. Also append the kernel boot line in
sudo grub2-mkconfig -o /boot/grub2/grub2.cfg. This step was only necessary because of current issues with the R9 290X GPU and openSUSE)
After everything has been done
dmesg | grep -i amdgpu should give only positive output.
Documentation : Hardware accelerated screen capturing on the VM (for this particular machine)
Download ffmpeg from git:
git clone git://source.ffmpeg.org/ffmpeg.git && cd ffmpegand install missing build requirements
Configure with special parameters to enable hardware encoding:
./configure --enable-libdrm --enable-vaapi --enable-encoder=h264_vaapi. Then simply
sudo make install.
Capture a test video, test.mp4, of the screen:
LIBVA_DRIVER_NAME=radeonsi ./ffmpeg -framerate 60 -f kmsgrab -i - -init_hw_device vaapi=v:/dev/dri/card0 -filter_hw_device v -filter:v hwmap,scale_vaapi=w=1920:h=1080:format=nv12 -c:v h264_vaapi -profile:v constrained_baseline -level:v 3.1 -b:v 20000k test.mp4
Final thoughts for Hackweek 17
It is definitely possible to enable openQA to run graphical hardware accelerated tests. Forwarding the screen output via network would also enable the testing of bare metal machines. At the same time, for virtual machines there is also the option to map the memory to the VM host for output in a window for example. How this can be achieved exactly has to be determined.
I will have a closer look at this and for the next Hackweek the goal should be the implementation.
Looking for hackers with the skills:
Nothing? Add some keywords!
This project is part of:
Hack Week 17
This project is one of its kind!