Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Bare Metal Server/ User Guide/ Instance/ Installing Drivers and Toolkits/ Installing the NVIDIA GPU Driver and CUDA Toolkit on a P3 BMS

Installing the NVIDIA GPU Driver and CUDA Toolkit on a P3 BMS

Updated on 2024-03-18 GMT+08:00

Scenarios

After a GPU-accelerated P3 BMS (using the physical.p3.large flavor) is created, the NVIDIA GPU driver and CUDA Toolkit must be installed on it for computing acceleration.

Prerequisites

The procedure of installing the NVIDIA GPU driver and CUDA Toolkit varies depending on the OS.

CentOS 7.4

  1. Log in to the target BMS and run the following command to switch to user root:

    su root

  2. (Optional) If the gcc, gcc-c++, make, and kernel-devel dependency packages do not exist, run the following commands to install the gcc, gcc-c++, make, and kernel-devel tools:

    yum install gcc

    yum install gcc-c++

    yum install make

    yum install kernel-devel-`uname -r`

  3. (Optional) Add the Nouveau driver to the blacklist.

    If the Nouveau driver has been installed and loaded, perform the following operations to add the Nouveau driver to the blacklist to avoid conflicts:

    1. Add blacklist nouveau to the end of the /etc/modprobe.d/blacklist.conf file.
    2. Run the following commands to back up and reconstruct initramfs:

      mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

      dracut -v /boot/initramfs-$(uname -r).img $(uname -r)

    3. Run the reboot command to restart the BMS.

  4. (Optional) If the X service is running, run the systemctl set-default multi-user.target command and restart the BMS to enter multi-user mode.
  5. (Optional) Install the NVIDIA GPU driver.

    If you selected a specified version of NVIDIA GPU driver rather than a version contained in the CUDA Toolkit, perform this step.

    1. Download NVIDIA GPU driver installation package NVIDIA-Linux-x86_64-xxx.yy.run from https://www.nvidia.com/Download/index.aspx?lang=en, and upload this package to the /tmp directory on the BMS.
      Figure 1 Searching for the NVIDIA GPU driver package (CentOS 7.4)
    2. Run the following command to install the NVIDIA GPU driver:

      sh ./NVIDIA-Linux-x86_64-xxx.yy.run

    3. Run the following command to delete the installation package:

      rm -f NVIDIA-Linux-x86_64-xxx.yy.run

  6. Install the CUDA Toolkit.

    1. Download CUDA Toolkit installation package cuda_a.b.cc_xxx.yy_linux.run from https://developer.nvidia.com/cuda-downloads, and upload this package to the /tmp directory on the BMS.
    2. Run the following command to change the permission to the installation package:

      chmod +x cuda_a.b.cc_xxx.yy_linux.run

    3. Run the following command to install the CUDA Toolkit:

      ./cuda_a.b.cc_xxx.yy_linux.run --toolkit --samples --silent --override --tmpdir=/tmp/

    4. Run the following command to delete the installation package:

      rm -f cuda_a.b.cc_xxx.yy_linux.run

    5. Run the following commands to check whether the installation is successful:

      cd /usr/local/cuda/samples/1_Utilities/deviceQueryDrv/

      make

      ./deviceQueryDrv

      If the command output contains "Result = PASS", the CUDA Toolkit and the NVIDIA GPU driver have been installed successfully.

Ubuntu 16.04

  1. Log in to the target BMS and run the following command to switch to user root:

    sudo root

  2. (Optional) If the gcc, g++, and make dependency packages do not exist, run the following commands to install the gcc, g++, and make tools:

    apt-get install gcc

    apt-get install g++

    apt-get install make

  3. (Optional) Add the Nouveau driver to the blacklist.

    If the Nouveau driver has been installed and loaded, perform the following operations to add the Nouveau driver to the blacklist to avoid conflicts:

    1. Add the following information to the end of the /etc/modprobe.d/blacklist.conf file:
      blacklist nouveau
      options nouveau modeset=0
    2. Run the following commands to back up and reconstruct initramfs:

      mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

      sudo update-initramfs -u

    3. Run the sudo reboot command to restart the BMS.

  4. (Optional) If the X service is running, run the systemctl set-default multi-user.target command and restart the BMS to enter multi-user mode.
  5. (Optional) Install the NVIDIA GPU driver.

    If you selected a specified version of NVIDIA GPU driver rather than a version contained in the CUDA Toolkit, perform this step.

    1. Download NVIDIA GPU driver installation package NVIDIA-Linux-x86_64-xxx.yy.run. from https://www.nvidia.com/Download/index.aspx?lang=en, and upload this package to the /tmp directory on the BMS.
      Figure 2 Searching the NVIDIA GPU driver package
    2. Run the following command to install the NVIDIA GPU driver:

      sh ./NVIDIA-Linux-x86_64-xxx.yy.run

    3. Run the following command to delete the installation package:

      rm -f NVIDIA-Linux-x86_64-xxx.yy.run

  6. Install the CUDA Toolkit.

    1. Download CUDA Toolkit installation package cuda_a.b.cc_xxx.yy_linux.run from https://developer.nvidia.com/cuda-downloads, and upload this package to the /tmp directory on the BMS.
    2. Run the following command to change the permission to the installation package:

      chmod +x cuda_a.b.cc_xxx.yy_linux.run

    3. Run the following command to install the CUDA Toolkit:

      ./cuda_a.b.cc_xxx.yy_linux.run --toolkit --samples --silent --override --tmpdir=/tmp/

    4. Run the following command to delete the installation package:

      rm -f cuda_a.b.cc_xxx.yy_linux.run

    5. Run the following commands to check whether the installation is successful:

      cd /usr/local/cuda/samples/1_Utilities/deviceQueryDrv/

      make

      ./deviceQueryDrv

      If the command output contains "Result = PASS", the CUDA Toolkit and the NVIDIA GPU driver have been installed successfully.

    6. Run the following command to check whether the driver is running properly:

      nvidia-smi topo -m

      If GPU information is displayed in the command output, the driver is running properly.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback