
# 手动安装GPU加速型ECS的GRID驱动
#### 操作场景
GPU加速型实例如需使用OpenGL/DirectX/Vulkan等图形加速能力则需要安装GRID驱动并自行购买和配置使用GRID License。此外，GRID驱动配合vDWS类型License，也支持CUDA，用来满足既需要计算加速也需要图形加速的场景。
- 使用公共镜像创建GPU加速型云服务器时，支持选择已包含特定版本GPU驱动的公共镜像或通过勾选"自动安装GPU驱动"的方式为云服务器安装GPU驱动。 若创建时未安装GPU驱动，则可参考本节操作完成GRID驱动的安装以及和GRID License的购买和配置使用。
  
- 使用私有镜像创建的GPU加速型实例，则需要安装GRID驱动并自行购买和配置使用GRID License。
![](https://support.huaweicloud.com/usermanual-ecs/public_sys-resources/note_3.0-zh-cn.png)
当前部分实例规格以及公共镜像已支持使用自动化脚本安装GPU驱动，建议优先使用自动安装方式，脚本获取以及安装指导请参考[（推荐）自动安装GPU加速型ECS的GPU驱动（Windows）](https://support.huaweicloud.com/usermanual-ecs/ecs_03_0222.html)。
本节操作介绍如何安装GRID驱动，购买或者申请GRID License，以及如何配置License服务器。
#### 约束与限制
- NVIDIA支持用户申请90天试用版License。
- 仅支持为GPU加速型实例安装GPU驱动，GPU加速型的介绍和应用场景请参见[GPU加速型](https://support.huaweicloud.com/productdesc-ecs/ecs_01_0045.html)。
- GPU加速型实例按GPU挂载方式分为GPU虚拟化型实例和GPU直通型实例。
  - GPU虚拟化型实例：需确保下载与主机配套的驱动版本，请严格按照[表1]所示选择合适的驱动版本下载使用。
  
  - GPU直通型实例：可根据需求选择GRID驱动版本。
   
- 云服务器需绑定弹性公网IP。
 
#### 操作流程
为GPU加速型实例安装GRID驱动的操作步骤：
1. [购买GRID License]
2. [下载GRID驱动及License软件包]
3. [部署和配置License Server]
4. [安装GRID驱动并配置License]
 
 #### 购买GRID License
- 购买License 如果需要正式版本License，请联系NVIDIA或者所在国家/地区的NVIDIA代理商。
  
- 申请试用版License。 打开[NVIDIA官方网站](https://www.nvidia.com/object/nvidia-enterprise-account.html)，填写相关信息。
  注册账号和申请试用版License的注意事项请参见[NVIDIA官方帮助页](https://nvid.nvidia.com/NvidiaUtilities/#/needHelp)。
  ![](https://support.huaweicloud.com/usermanual-ecs/public_sys-resources/note_3.0-zh-cn.png)
  试用版License的使用方法和正式版本的License一致，可以保留试用版账号激活正式版本的License，无需重新注册。试用版License有限期限为90天，账号过期将无法使用，请尽快购买正式版本。
  图1申请试用版License   
  ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000002114597602.png "点击放大") 
 
 #### 下载GRID驱动及License软件包
1. 请根据[表1]对应操作系统下载驱动安装包。
   了解更多GRID驱动信息请参考[NVIDIA vGPU驱动](https://docs.nvidia.com/grid/index.html)。
   ![](https://support.huaweicloud.com/usermanual-ecs/public_sys-resources/note_3.0-zh-cn.png)
   - GPU虚拟化型实例：需确保下载与主机配套的驱动版本，请严格按照[表1](https://support.huaweicloud.com/usermanual-ecs/zh-cn_topic_0149610914.html#ZH-CN_TOPIC_0149610914__table188851534175019)所示选择合适的驱动版本下载使用。
   
   - GPU直通型实例：可根据需求选择GRID驱动版本。
    
    表1GPU实例类型支持的GRID驱动版本 
   | 实例类型         | GPU挂载方式   | 操作系统                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | 驱动版本                  | CPU架构  |
   |:---|:---|:---|:---|:---|
   | G6v          | GPU虚拟化型实例 | - CentOS 8.2 64bit  - CentOS 7.6 64bit  - Ubuntu 20.04 server 64bit  - Ubuntu 18.04 server 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | GRID 11.1             | x86_64 |
   | G6           | GPU直通型实例  | - Huawei Cloud EulerOS 2.0 64bit  - CentOS 8.2 64bit  - CentOS 8.1 64bit  - CentOS 8.0 64bit  - CentOS 7.9 64bit  - CentOS 7.8 64bit  - CentOS 7.7 64bit  - CentOS 7.6 64bit  - CentOS 7.5 64bit  - Ubuntu 22.04 64bit  - Ubuntu 20.04 64bit  - Ubuntu 18.04 64bit  - Ubuntu 16.04 64bit  - Windows Server 2022 Standard 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2022 Datacenter 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                          | 按需选择版本                | x86_64 |
   | G5.8xlarge.4 | GPU直通型实例  | - CentOS 8.2 64bit  - CentOS 7.6 64bit  - CentOS 7.5 64bit  - Ubuntu 20.04 64bit  - Ubuntu 18.04 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | 按需选择版本                | x86_64 |
   | G3           | GPU直通型实例  | - Windows Server 2019 Standard 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | 按需选择版本                | x86_64 |
   | G1           | GPU虚拟化型实例 | - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | vGPU 4.1：GRID for UVP | x86_64 |
   | P2vs         | GPU直通型实例  | - CentOS 7.5 64bit  - Ubuntu 16.04 server 64bit  - Windows Server 2016 Standard 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | 按需选择版本                | x86_64 |
   | P2s          | GPU直通型实例  | - Huawei Cloud EulerOS 2.0 64bit  - CentOS 8.2 64bit  - CentOS 8.1 64bit  - CentOS 8.0 64bit  - CentOS 7.9 64bit  - CentOS 7.8 64bit  - CentOS 7.7 64bit  - CentOS 7.6 64bit  - Ubuntu 22.04 server 64bit  - Ubuntu 20.04 server 64bit  - Ubuntu 18.04 server 64bit  - Ubuntu 16.04 server 64bit  - Windows Server 2022 Standard 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2022 Datacenter 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                            | 按需选择版本                | x86_64 |
   | P2v          | GPU直通型实例  | - Huawei Cloud EulerOS 2.0 64bit  - CentOS 7.4 64bit  - EulerOS 2.2 64bit  - Ubuntu 20.04 server 64bit  - Ubuntu 18.04 server 64bit  - Ubuntu 16.04 server 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | 按需选择版本                | x86_64 |
   | P1           | GPU直通型实例  | - CentOS 7.3 64bit  - Ubuntu 16.04 server 64bit  - EulerOS 2.2 64bit  - Debian 8.0.0 64bit  - Windows Server 2022 Standard 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2022 Datacenter 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | 按需选择版本                | x86_64 |
   | Pi2          | GPU直通型实例  | - Huawei Cloud EulerOS 2.0 64bit  - CentOS 8.2 64bit  - CentOS 8.1 64bit  - CentOS 8.0 64bit  - CentOS 7.9 64bit  - CentOS 7.8 64bit  - CentOS 7.7 64bit  - CentOS 7.6 64bit  - CentOS 7.5 64bit  - Ubuntu 22.04 server 64bit  - Ubuntu 20.04 server 64bit  - Ubuntu 18.04 server 64bit  - Ubuntu 16.04 server 64bit  - Windows Server 2022 Standard 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2022 Datacenter 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit   | 按需选择版本                | x86_64 |
   | Pi1          | GPU直通型实例  | - Huawei Cloud EulerOS 2.0 64bit  - CentOS 7.3 64bit  - Ubuntu 20.04 server 64bit  - Ubuntu 16.04 server 64bit  - Ubuntu 14.04 server 64bit  - Windows Server 2019 Standard 64bit  - Windows Server 2019 Datacenter 64bit  - Windows Server 2016 Datacenter 64bit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | 按需选择版本                | x86_64 |
      
   
2. 注册成功后，登录[NVIDIA官网](https://nvid.nvidia.com/dashboard/)，填写账户信息。
3. 判断是否为首次注册使用NVIDIA。
   1. 是，执行[4]。
   
   2. 否，执行[6]。
    
4. 在注册NVIDIA用户成功的邮件中，查询PAK，如[图2]所示。
   图2注册PAK   
   ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0178334448.png "点击放大") 
5. 将[4]中查找的PAK填写在"Redeem Product Activation Keys"页面 ，并单击"Redeem"。
   图3Redeem Product Activation Keys   
   ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0178334449.png "点击放大") 
6. 输入"用户名"和"密码"，并单击"登录"。
   图4登录NVIDIA官网   
   ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0178334450.png) 
7. 根据界面提示，进入NVIDIA网站，并选择"SOFTWARE DOWNLOADS"。
   图5打开NVIDIA网站   
   ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001093447741.png "点击放大") 
8. 对照[表1]选择相应版本的GRID驱动下载。
9. 解压缩GRID驱动包，并选择和弹性云服务器操作系统匹配的驱动进行安装。
10. 在"SOFTWARE DOWNLOADS"页面，单击"ADDITIONAL SOFTWARE"，下载License软件包。
    图6选择SOFTWARE DOWNLOADS   
    ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001093667097.png "点击放大") 
 
 #### 部署和配置License Server
以CentOS 7.5操作系统的云服务器为例演示部署和配置License Server。
![](https://support.huaweicloud.com/usermanual-ecs/public_sys-resources/note_3.0-zh-cn.png)
- 云服务器规格不小于2vCPU，内存不小于4GiB。
- 请提前记录云服务器MAC地址。
- 如用作生产用途，建议采用高可用模式部署，主备高可用模式部署License Server 请参考[NVIDIA官方License Server高可用部署文档](https://docs.nvidia.com/grid/ls/2019.05/grid-license-server-user-guide/index.html#license-server-high-availability)。
 
1. 配置网络：
   - 如使用VPC网络访问License Server：请确保License Server和使用GRID驱动的GPU加速型实例处在同一个VPC子网内。
   
   - 如使用公网IP访问License Server：请配置License Server所在的安全组，增加入方向规则：TCP 7070和TCP 8080。
    

2. 安装License Server。
   1. 执行以下命令，解压缩安装包。其中"安装程序.zip"为[10]获取到的安装包名称。
      **unzip 安装程序.zip**
      
   
   2. 执行以下命令，为安装程序添加执行权限。 **chmod +x setup.bin**
      
   
   3. 以root用户运行安装程序。 **sudo ./setup.bin -i console**
      
   
   4. 在Introduction部分，单击回车键继续。 ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001674064185.png "点击放大")
      
   
   5. 在License Agreement部分，通过单击回车键进行翻页，翻页结束后接受许可协议。 当您达成许可协议时，系统会提示您接受许可协议条款，请输入"Y"，并单击回车键。
      ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001625786470.png "点击放大")
      
   
   6. 在Choose Install Folder部分，单击回车键，保持默认的License Server软件安装路径。
   
   7. 在Choose Local Tomcat Server Path部分，输入Tomcat的本地路径，默认为/var/lib/tomcat版本号，例如：/var/lib/tomcat8。
   
   8. 在Choose Firewall Options部分，确认需要在防火墙中打开的端口，单击回车键，保持默认选项即可。 ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001674067605.png "点击放大")
      
   
   9. 在Pre-Installation Summary部分，确认信息并单击回车键启动安装。 ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001625473206.png "点击放大")
      
   
   10. 在Install Complete部分，单击回车键，结束安装。 ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001673953273.png "点击放大")
       
    
3. 获取License文件。
   1. 新建页签，登录[NVIDIA网站](https://nvid.nvidia.com/dashboard/)，选择"LICENSE SERVERS"。
      图7选择LICENSE SERVERS   
      ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001093449637.png "点击放大") 
   
   2. 单击"CREATE SERVER"。
   
   3. 在"Create License Server"界面，根据界面提示配置参数。
      图8填写LICENSE SERVERS信息   
      ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001626671598.png "点击放大")
      表2LICENSE SERVERS信息填写说明 
      | 参数          | 说明                                                                                                                                                       |
      |:---|:---|
      | Server Name | 自定义需要的License Server名称。                                                                                                                                  |
      | Description | License Server的描述信息。                                                                                                                                     |
      | MAC Address | 填写用于搭建License Server的ECS实例的MAC地址。 您可以登录实例，使用ipconfig -a命令进行查询。                                                   |
      | Feature     | 在Licenses框中输入需要的license数目，单击"ADD"。 如果是主备部署的情况需要把备服务器的名称填入 Failover License Server，MAC地址填入Failover MAC Address中。 |
         
      
   
   4. 单击"CREATE LICENSE SERVER"。
   
   5. 下载License文件。
      图9下载License文件   
      ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0000001093310123.png "点击放大") 
    
4. 在Web浏览器中，根据安装时配置的管理页面链接，访问License Server管理界面的主页。 默认访问链接为：http://*弹性公网IP地址*:8080/licserver。
   
5. 在左侧导航树中，单击"License Server \> License Management"。
6. 使用License服务器配置菜单导入，并单击"Upload"上传许可证\*.bin文件，完成License Server的配置。
   图10上传许可证文件   
   ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0178325096.png "点击放大") 
 
 #### 安装GRID驱动并配置License
1. 以Windows操作系统GPU加速型实例为例，选择合适版本的GRID驱动进行安装。
   ![](https://support.huaweicloud.com/usermanual-ecs/public_sys-resources/note_3.0-zh-cn.png)
   微软的远程登录协议不支持使用GPU的3D硬件加速能力，如需使用请安装VNC/PCoIP/NICE DCV等第三方桌面协议软件，并通过相应客户端连接GPU实例，使用GPU图形图像加速能力。
   
2. 使用第三方桌面协议连接后，在Windows控制面板中打开NVIDIA控制面板 。
3. 在一级许可证服务器中填入部署的License server的IP和端口，并单击应用。当出现"您的系统已获GRID vGPU许可"则代表安装GRID驱动成功，并且可以在License Server管理控制台Licensed Clients中看到已安装GRID驱动并使用了License的GPU实例的MAC地址。
   图11License Server管理控制台   
   ![](https://support.huaweicloud.com/usermanual-ecs/zh-cn_image_0178370293.png "点击放大") 
 
#### 相关文档
- [（推荐）自动安装GPU加速型ECS的GPU驱动（Windows）](https://support.huaweicloud.com/usermanual-ecs/ecs_03_0222.html)
- [在Linux操作系统的GPU加速型实例中，GPU驱动不可用怎么办？](https://support.huaweicloud.com/trouble-ecs/ecs_trouble_1202.html)
- [在Linux操作系统的GPU加速型实例中，GPU驱动异常怎么办？](https://support.huaweicloud.com/trouble-ecs/ecs_trouble_1201.html)
- [在Windows系统的G系列弹性云服务器中，无法打开NVIDIA 控制面板，GPU驱动无法使用或GPU驱动显示异常时怎么办？](https://support.huaweicloud.com/trouble-ecs/ecs_trouble_0109.html)
 
