From 1374c06957f3bf18b2afbe6e0d0c3c4d3b356281 Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Sat, 22 Dec 2018 12:06:08 +0100 Subject: [PATCH] support Vulkan --- Dockerfile | 19 ++++++++++++++ Makefile | 2 +- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++- docker-compose.yml | 7 ++--- 4 files changed, 87 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 734a748..4fd4bb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,25 @@ RUN apt-get -y install libnm-glib4:i386 libnm-util2:i386 # https://github.com/ValveSoftware/steam-for-linux/issues/3307 RUN apt-get -y install fontconfig:i386 +# Enable Vulkan library. +# DXVK is a Vulkan-based compatibility layer for Direct3D 11. +# It allows running 3D applications on Linux using Wine. +# To fully leverage the DXVK, you need the following: +# 1. Vulkan library installed; +# 2. Capable GPU that supports Vulkan; +# 3. Latest GPU drivers which support Vulkan; +# +# $ cat /home/user/.local/share/Steam/steamapps/common/Proton\ 3.16/dist/lib64/wine/dxvk/version +# 60a03a29599bf1f8c73efdbcf288e91ef261bc58 dxvk (v0.90-10-g60a03a2) +# +# https://developer.nvidia.com/vulkan-driver +# https://en.wikipedia.org/wiki/Vulkan_(API)#Compatibility +# https://github.com/lutris/lutris/wiki/How-to:-DXVK +# https://github.com/doitsujin/dxvk/wiki/Driver-support +# https://www.protondb.com +# https://lutris.net +RUN apt-get -y install libvulkan1 libvulkan1:i386 vulkan-utils + LABEL maintainer="Andrey Arapov " COPY ./launch /launch ENTRYPOINT [ "/bin/bash", "/launch" ] diff --git a/Makefile b/Makefile index 1bc94f7..a347410 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ NS ?= andrey01 NAME ?= steam -VERSION ?= 0.1 +VERSION ?= 1.0 default: build diff --git a/README.md b/README.md index 1a8b464..f990ec4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ ## Changes +### Dec 22 2018: + +- support Vulkan; + ### Dec 21 2018: - got rid of 'wrong ELF class' messages in the logs; @@ -59,7 +63,7 @@ GPU: ```sh git clone https://git.nixaid.com/arno/steam.git cd steam -docker-compose up +docker-compose build && docker-compose up ``` If Steam does not start, you may need to allow your user making connections to @@ -84,6 +88,52 @@ If you are getting `segmentation fault` error or Steam does not start, then you docker-compose run --rm steam --reset ``` +## Vulkan / DXVK + +DXVK is a Vulkan-based compatibility layer for DirectX 11. + +It allows running 3D applications on Linux using Wine. + +To fully leverage the DXVK, you need the following: + +1. Vulkan library installed; + +2. Capable GPU that supports Vulkan; + +3. Latest GPU drivers which support Vulkan; + +4. Wine 3.10+ with the [DXVK](https://github.com/doitsujin/dxvk/) (Steam's Proton already has DXVK installed); + +5. The game that supports DirectX 11; + +``` +$ cat /home/user/.local/share/Steam/steamapps/common/Proton\ 3.16/dist/lib64/wine/dxvk/version +60a03a29599bf1f8c73efdbcf288e91ef261bc58 dxvk (v0.90-10-g60a03a2) +``` + +### Test Vulkan + +``` +$ docker-compose run --rm --entrypoint bash steam +root@steam:/# id user >/dev/null 2>&1 +root@steam:/# [ $? -eq 0 ] || useradd -s /bin/bash -d /home/user -u ${USER_ID:-1000} user +root@steam:/# su -l user +user@steam:~$ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/hostlibs/32:/hostlibs/64:" +user@steam:~$ LD_LIBRARY_PATH=${LD_LIBRARY_PATH} vulkaninfo | more +user@steam:~$ LD_LIBRARY_PATH=${LD_LIBRARY_PATH} vulkan-smoketest +``` + +### Test DXVK + +First, you need DirectX 10/11 game. + +``` +$ docker-compose exec steam +$ echo 'user_settings = { "DXVK_HUD": "devinfo,fps", }' > .local/share/Steam/steamapps/common/Proton\ 3.16/user_settings.py +``` + +After that, launch your game and you should be able to see DXVK HUD in the left upper corner of the screen. + # Links Below is just a bunch of links, someone might find them useful. @@ -101,3 +151,15 @@ Below is just a bunch of links, someone might find them useful. - http://repo.steampowered.com/steam/archive/precise/steam_latest.deb - http://repo.steamstatic.com/steam/ + +- https://developer.nvidia.com/vulkan-driver + +- https://en.wikipedia.org/wiki/Vulkan_(API)#Compatibility + +- https://github.com/lutris/lutris/wiki/How-to:-DXVK + +- https://github.com/doitsujin/dxvk/wiki/Driver-support + +- https://www.protondb.com + +- https://lutris.net diff --git a/docker-compose.yml b/docker-compose.yml index c04fb99..a74278b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,10 @@ -version: '3.7' +version: '2' services: steam: - init: true hostname: steam network_mode: bridge - image: andrey01/steam + build: . # DNS cache is needed to avoid resolver abuse # https://github.com/ValveSoftware/steam-for-linux/issues/3401 dns: 127.0.0.1 @@ -40,6 +39,8 @@ services: # Location to your NVIDIA drivers: - /usr/lib/i386-linux-gnu:/hostlibs/32:ro - /usr/lib/x86_64-linux-gnu:/hostlibs/64:ro + # Needed for Vulkan ICD Discovery + - /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro # security_opt: # - apparmor=unconfined cap_add: