Guest User

3 ways to run windows games on linux

a guest
Oct 21st, 2018
1,362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. For: https://www.youtube.com/watch?v=Somp8w1oZhY
  2.  
  3. My original plan was to run GTX560 for a host and GTX970 inbetween systems since that's what I've been running with for a while with PCI passthrough.
  4.  
  5. So my first problem was that I dedicate the GPU to the guest. Fix to this is to rebind it. Doing this manually with something like:
  6.  
  7. sudo sh -c 'echo "0000:02:00.0" > /sys/bus/pci/devices/0000:02:00.0/driver/unbind'
  8. sudo sh -c 'echo "0000:02:00.1" > /sys/bus/pci/devices/0000:02:00.1/driver/unbind'
  9. sudo sh -c 'echo "0000:02:00.0" > /sys/bus/pci/drivers/nvidia/bind'
  10. sudo sh -c 'echo "0000:02:00.1" > /sys/bus/pci/drivers/snd_hda_intel/bind'
  11.  
  12. And a lot of checking with commands like:
  13.  
  14. lspci -nnk -d 10de: <- tells if driver is bound
  15. lsmod|grep nvidia <- tells if nvidia driver is initialized and if somethings using it (number over 0)
  16. lsof | grep /dev/nvidia <- tells what is using the driver
  17.  
  18. While this does work fine to unbind vfio-pci and even nvidia if you're lucky. There are multiple pitfalls that can cause the device to end up unresponsive and requiring a reboot. Mainly if xorg attaches itself to it or nvidia_modeset gets loaded requiring it to be removed before unbinding (sudo rmmod nvidia_modeset nvidia).
  19. Around this time I also gave up on the idea of having GTX560 be part of it since it was causing too much of a headache for rebinding. It also was probably just making the system slower with having to have older drivers.
  20.  
  21. In the end I end up avoiding manual rebinding with telling xorg to use intel iGPU for the x server:
  22.  
  23. sudo nano /etc/X11/xorg.conf
  24. # Use iGPU for X Server
  25. Section "Device"
  26. Identifier "intel"
  27. Driver "intel"
  28. BusId "PCI:0:2:0"
  29. EndSection
  30.  
  31. This combined with removing the vfio-pci binding I had from before:
  32.  
  33. # sudo nano /etc/modprobe.d/vfio.conf
  34. # options vfio-pci ids=10de:13c2,10de:0fbb
  35. # sudo mkinitcpio -p linux-vfio
  36.  
  37. I end up with no driver attaching itself to the GTX970 during bootup. Now if I want to run windows in a virtual machine vfio-pci manages to bind it by itself and clear it afterwards, same with running nvidia-xrun for DXVK later on. Only Bumblebee primusrun leaves the card with nvidia driver attached but it is still without nvidia_modeset so all the other options manage to rebind themselves cleanly just fine.
  38.  
  39. Now I have a gpu back to the host but there's not much to do with it except maybe NVENC for video encoding.
  40. So I installed Bumblebee. And even though it is meant for Optimus laptops it works here aswell as a way to run opengl games.
  41.  
  42. [Bumblebee]
  43. https://wiki.archlinux.org/index.php/bumblebee
  44.  
  45. sudo nano /etc/pacman.conf
  46. [multilib]
  47. Include = /etc/pacman.d/mirrorlist
  48. sudo pacman -Syyu
  49.  
  50. sudo pacman -S bumblebee mesa primus lib32-primus
  51. sudo pacman -S lib32-virtualgl nvidia-utils lib32-nvidia-utils nvidia-dkms
  52. sudo pacman -S mesa-vdpau libva-mesa-driver mesa xf86-video-intel
  53. sudo gpasswd -a jukka bumblebee
  54. sudo systemctl enable bumblebeed.service
  55. reboot
  56.  
  57. sudo rm /etc/X11/xorg.conf.d/20-nvidia.conf <- sddm refused to start with Bumblebee and old nvidia configs
  58.  
  59. bumblebeed -vv
  60.  
  61. sudo pacman -S mesa-demos
  62. optirun glxgears -info
  63. yay -S unigine-heaven
  64. vblank_mode=0 primusrun unigine-heaven
  65.  
  66. [Steam]
  67. sudo pacman -S steam steam-native-runtime
  68.  
  69. [Lutris]
  70. sudo pacman -S wine-staging wine-mono wine_gecko
  71. sudo pacman -S winetricks zenity
  72. sudo pacman -S lutris
  73.  
  74. https://github.com/lutris/lutris/wiki/How-to:-DXVK
  75. sudo pacman -S vulkan-icd-loader lib32-vulkan-icd-loader
  76. yay -S vkcube-git
  77.  
  78. https://github.com/lutris/lutris/wiki/How-to:-Esync
  79. ulimit -Hn
  80. sudo nano /etc/systemd/system.conf
  81. DefaultLimitNOFILE=1048576
  82. sudo nano /etc/systemd/user.conf
  83. DefaultLimitNOFILE=1048576
  84.  
  85. [Overwatch]
  86. https://lutris.net/games/overwatch/
  87. https://github.com/lutris/lutris/wiki/Game:-Blizzard-App
  88. yay -S ttf-ms-fonts
  89. sudo pacman -S lib32-gnutls lib32-libldap lib32-libgpg-error lib32-sqlite
  90.  
  91. Steam gameservers unreachable. Was fixed for me when I installed steam on linux aswell.
  92. Overwatch getting stuck updating was fixed for me by removing C:\ProgramData\Battle.net https://forums.lutris.net/t/solved-cannot-install-game-from-battle-net-client/2770/4
  93.  
  94. [Nvidia-xrun]
  95. https://forum.manjaro.org/t/how-to-use-vulkan-on-bumblebee-a-guide-to-nvidia-xrun/56260
  96. yay -S nvidia-xrun
  97. sudo pacman -S openbox obmenu
  98. nano ~/.nvidia-xinitrc
  99. openbox-session
  100. nvidia-xrun
  101.  
  102. [Looking glass]
  103. I already had a working PCI passthrough/Looking glass installation but for those interested:
  104. PCI passthrough page on archwiki has very in depth guide on passthrough; https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
  105. And looking glass' own website is very straightforward aswell: https://looking-glass.hostfission.com/quickstart
  106.  
  107. Other might be useful sites:
  108. https://arseniyshestakov.com/2016/03/31/how-to-pass-gpu-to-vm-and-back-without-x-restart/
  109. https://linuxconfig.org/improve-your-wine-gaming-on-linux-with-dxvk
  110. https://www.reddit.com/r/VFIO/comments/5nqr5e/you_can_share_the_use_of_a_2nd_gpu/
Add Comment
Please, Sign In to add comment