

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 设置一台远程 Amazon EC2 计算机对 Proton 进行故障排除
<a name="troubleshoot-compatibility-setup-remote"></a>

 如果您没有本地 Ubuntu 机器，请改为按照以下说明设置远程计算机。

 在本步骤中，您将使用亚马逊弹性计算云 (Amazon EC2) 设置远程 Ubuntu 计算机，您将使用该云来排除应用程序与 Proton for Amazon Streams 的兼容性问题。 GameLift 本主题介绍如何使用 Ubuntu 22.04 LTS、必要的 GPU 驱动程序和用于可视远程桌面的亚马逊 DCV 服务器来设置 Amazon EC2 实例。

## 使用 Ubuntu 22.04 LTS AMI 启动亚马逊 EC2 实例
<a name="troubleshoot-compatibility-setup-remote-launch-ec2"></a>

1.  在 AWS 管理控制台中导航至 Amazon EC2。

1.  选择**启动实例**。

1.  在**名称**中输入 “Amazon GameLift 直播测试”。

1.  为**应用程序和操作系统映像（亚马逊计算机映像）选择 Ubuntu Server 22.04 LTS (****HVM)**。

1.  **为实例类型选择 **g4dn.2xlarge。****

1.  对于**密钥对（登录）**，如果您想使用 SSH 访问实例，请选择密钥对。我们建议使用带有`AmazonSSMManagedInstanceCore`策略的实例配置文件来连接您的实例 AWS Systems Manager Session Manager。有关更多详细信息，请参阅为[现有 IAM 角色添加会话管理器权限](https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-add-permissions-to-existing-profile.html)。

1.  对于**网络设置**，请创建一个新的安全组：

1.  在**安全组名称**中，输入 **DCV**。

1.  添加包含**类型`Custom TCP`、**端口范围**和**源类型的******入站安全组规则**`8443`，`Anywhere`以允许使用 Amazon DCV 进行访问。

1.  将存储空间增加到至少 **256 GiB**，然后选择 **gp3** 作为存储类型。

1.  选择**启动实例**。

您的实例现在应该已启动。

 按照 [Connect to 您的 Linux 实例](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html)中的说明使用 SSH 或连接到该实例 AWS Systems Manager Session Manager。

## 安装 GPU 驱动程序
<a name="troubleshoot-compatibility-setup-remote-install-gpu"></a>

### g4dn-NVIDIA GPU
<a name="troubleshoot-compatibility-setup-remote-install-gpu-nvidia"></a>

 通过运行以下命令安装其他模块和 Linux 固件：

```
sudo apt install linux-modules-extra-aws linux-firmware 

# Install the AWS CLI required for NVIDIA driver installation 
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" 
sudo apt install unzip
unzip awscliv2.zip 
sudo ./aws/install
```

 按照在 Linux 上[安装 NVIDIA 驱动程序中适用于 Ubuntu 和 Debian 的 NVIDIA GRID 驱动程序](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html)中的说明进行操作。

## 设置用户环境
<a name="troubleshoot-compatibility-setup-remote-user-env"></a>

通过运行以下命令设置您的用户环境，使其可以使用 GPU。这会做以下事情：
+ 将您添加到允许您访问视频设备的`video`群`render`组，以及允许您访问渲染设备的群组。
+ 安装 AWS CLI，这是 NVIDIA 驱动程序以及从 Amazon S3 下载应用程序或游戏所必需的。

```
sudo adduser {{user}} 

# Add the current user to the video and render group 
sudo usermod -a -G video {{user}} 
sudo usermod -a -G render {{user}} 
sudo adduser {{user}} sudo 

# Install the AWS CLI 
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" 
sudo apt install unzip 
unzip awscliv2.zip 
sudo ./aws/install 

sudo reboot
```

## 安装和配置 Amazon DCV
<a name="troubleshoot-compatibility-setup-remote-nice-dcv"></a>

 使用 SSH 重新连接到实例，或者 AWS Systems Manager Session Manager 按照在 [Linux 上安装 Ubuntu 版 Amazon DCV 服务器中的说明进行](https://docs.aws.amazon.com/dcv/latest/adminguide/setting-up-installing-linux.html)操作。
+  确认服务器配置正确，如文档中所述。
+  按照为 NVIDIA GPU [安装和配置 NVIDIA 驱动程序](https://docs.aws.amazon.com/dcv/latest/adminguide/setting-up-installing-linux-prereq.html#linux-prereq-gpu)中的步骤操作。
+  按照《[安装服务器》指南（导航至 Ubuntu 选项卡）的第 7 步](https://docs.aws.amazon.com/dcv/latest/adminguide/setting-up-installing-linux-server.html)中所述，将 Amazon DCV 用户添加到视频群组。

无需安装 Amazon DCV 服务器的任何可选部件。

完成后，运行以下命令启动 Amazon DCV 服务器：

```
sudo systemctl start dcvserver 
sudo systemctl enable dcvserver
```

## 使用亚马逊 DCV 客户端连接到 Ubuntu 服务器
<a name="troubleshoot-compatibility-setup-remote-nice-dcv-connect"></a>

 通过运行以下命令重新连接到您的 Ubuntu 实例并为用户创建会话：

```
sudo dcv create-session --owner {{user}} --user {{user}} my-session --type console
```

 现在，您可以使用 Amazon DCV 客户端使用其公有 IP 地址访问您的 Ubuntu 实例。当您启动 Amazon DCV 客户端时，会出现一个窗口，允许您通过可视显示屏访问您的 Ubuntu 实例。

![当您启动 Amazon DCV 客户端时，会出现一个窗口，允许您通过可视显示屏访问您的 Ubuntu 实例。](http://docs.aws.amazon.com/zh_cn/gameliftstreams/latest/developerguide/images/troubleshoot-compatibility-setup-remote-dcv.png)


## 验证 GPU 驱动程序
<a name="troubleshoot-compatibility-setup-remote-verify-gpu"></a>

 确认 GPU 驱动程序已安装且运行正常。验证这一点的一种方法是在终端中运行 [vkcube](https://github.com/krh/vkcube) 应用程序。

1.  使用以下命令安装 `vulkan-tools` apt 软件包。

   ```
   sudo apt install -y vulkan-tools
   ```

1.  运行 `vkcube`。

1.  检查输出。
   +  如果您的系统正确使用了正确的 GPU，您将看到类似于以下内容的输出，其中包含您的 GPU 名称：`Selected GPU 0: AMD Radeon Pro V520 (RADV NAVI12), type: 2`
   +  如果您的应用程序能够正确使用 GPU，则可能会看到类似于以下内容的不同输出：`Selected GPU 0: llvmpipe (LLVM 15.0.7, 256 bits), type: 4`

      在这种情况下，请检查 GPU 驱动程序并在需要时重新安装。

## 设置 Podman（仅限 Proton）
<a name="troubleshoot-compatibility-setup-remote-podman"></a>

如果你使用的是 Proton 运行时，你必须安装 P [odman](https://wiki.debian.org/Podman)，这是一个 Proton 构建过程使用的容器。在终端中完成以下步骤。

1.  安装 Podman，这是一款 Proton 构建过程使用的容器。

   ```
   sudo apt install podman
   ```

1.  在文件中`/etc/subgid`和 `/etc/subgid` 

   1. 确认文件中列出了您的 Linux 计算机用户名和 ID。您可以打开文件，也可以使用`cat`命令查看文件中的内容。格式示例：`test:165536:65536`，其中`test`对应于您的用户名。

   1.  如果未列出，请将其添加进去。格式示例：`test:165536:65536`，其中`test`对应于您的用户名。

   ```
   $ cat /etc/subuid
                 ceadmin:100000:65536
                 test:165536:65536
                 
                 $ cat /etc/subgid
                 ceadmin:100000:65536
                 test:165536:65536
   ```

    有关更多信息，请参阅 [Podman 文档中的基本设置和在无根环境中使用](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md#basic-setup-and-use-of-podman-in-a-rootless-environment) Podman。

## 后续步骤
<a name="troubleshoot-compatibility-setup-remote-setup-local-next-step"></a>

 现在，您已经设置好了 Amazon EC2 实例和环境，可以解决与 Amazon GameLift Streams 的兼容性问题。下一步是设置 Proton。有关说明，请参阅[在 Proton 上进行故障排除](troubleshoot-compatibility-wp-proton.md)。