The following document describes at a high level how one can use OpenShift Virtualization, an NVIDIA GPU, and VirtualGL to run hardware accelerated remote games.
- OpenShift 4.8 or Higher
- OpenShift Virtualization 4.8 or higher
- OpenShift Worker Nodes with NVIDIA Graphics Card Installed
- NVIDIA P4 used in this document
You will need an OpenShift 4.8 (or higher) cluster available that is running on Bare Metal. See: https://docs.openshift.com/container-platform/4.8/installing/installing_bare_metal/preparing-to-install-on-bare-metal.html
Once your BM cluster is up and running, install OpenShift Virtualization. See: https://docs.openshift.com/container-platform/4.8/virt/install/preparing-cluster-for-virt.html
Once OpenShift Virtualization is intalled, configure OpenShift Virtualization for GPU Passthrough. See: https://docs.openshift.com/container-platform/4.8/virt/virtual_machines/advanced_vm_management/virt-configuring-pci-passthrough.html
Finally Create an instance of a Fedora34 VM using the fedorawk1.yml file below. See: https://docs.openshift.com/container-platform/4.8/virt/virtual_machines/virt-create-vms.html NOTE: The yaml below will create a vm with a user of "fedora:fedora", be sure to update the password field if you do not want this.
Log into the VM you created and run the following commands:
$ sudo su -
$ dnf update -y
$ dnf install -y VirtualGL supertuxkart
Configure VirtualGL per the following two documents:
- Install NVIDIA Drivers: https://ask.fedoraproject.org/t/installing-nvidia-drivers-on-fedora-34/14071
- Configure X for Headless configuration: https://virtualgl.org/Documentation/HeadlessNV
- Configure and start VirtualGL: https://cdn.rawgit.com/VirtualGL/virtualgl/2.6.5/doc/index.html#hd006
Log into the workstation you want to display the remote workload on. Example instructions assume Fedora34 workstation.
$ sudo su -
$ dnf update -y
$ dnf install -y VirtualGL
Once your remote VM and display workstation are setup you can run the remote workload. VirtualGL can stream the application and 3D accelerated video stream over SSH. We will use this process to connect and run the SuperTuxCart application.
From the workstation you want to display the application on run:
$ vglconnect -s <IP address> -p <NodePort>
# you will be prompted for your password twice. This sets up the inital connection and then the VirtualGL tunnel
$ vglrun supertuxcart --demo-mode=1
At this point SuperTuxCart should start on your workstation, using the Graphics Card from your remote virtual machine.