Debian安装Lutris运行Overwatch

前言

要在Linux上玩游戏首先需要显卡驱动,然后则是运行库
DXVK是Direct3D图形库基于Vulkan的兼容层,使用它可改进性能,但必须有显卡驱动和Vulkan依赖

下载安装Lutris程序

1
2
3
wget https://download.opensuse.org/repositories/home:/strycore/Debian_10/amd64/lutris_0.5.6_amd64.deb
sudo dpkg -i lutris_0.5.6_amd64.deb
sudo apt install -f

安装驱动和运行库

1
2
3
4
5
6
7
8
9
10
11
# 由于暴雪战网是32位程序需要启用系统32位支持
sudo dpkg --add-architecture i386
sudo apt update

# 使用DXVK需要安装Vulkan支持
sudo apt install libvulkan1 libvulkan1:i386
sudo apt install mesa-vulkan-drivers mesa-vulkan-drivers:i386

# 安装Mesa驱动和Nvidia驱动
sudo apt install libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
sudo apt install nvidia-settings libgl1-nvidia-glx:i386

Gnome全局使用Nvidia显卡

  1. 获取显卡的PCI端口号,如下的0:2:0和1:0:0
1
2
3
leux@K680:~$ lspci
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop)
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
  1. 使系统默认使用xorg而不是wayland
1
2
3
4
5
# 编辑 /etc/gdm3/daemon.conf 去掉下面行的注释
# WaylandEnable=false

# 查看目前使用的是Wayland还是Xorg
echo $XDG_SESSION_TYPE
  1. 使Gnome启动后自动调用Nvidia显卡
1
2
3
4
5
6
7
8
9
# /usr/share/gdm/greeter/autostart/optimus.desktop
# 编辑下面内容到这两个文件:/etc/xdg/autostart/optimus.desktop

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer
  1. 把如下内容添加到 /etc/X11/xorg.conf 后重启
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
Identifier "nvidia"
Device "nvidia"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection

其他问题

1
2
3
4
5
6
7
# 安装Wine的依赖及中文字体显示
sudo apt install libfreetype6:i386 wine
cp Win10/Windows/Fonts/simsun.ttc ~/Games/overwatch/drive_c/windows/Fonts/

# 解决Gnome下Wine System Tray的迷你窗口问题
# 在Gnome软件商店里搜索并安装扩展TopIcons Plus
# 再到gnome-tweek-tool中的扩展里启用TopIcons Plus即可