Installing CANN Offline

This section describes how to install CANN in an offline environment where network connection is unavailable by copying the pre-downloaded OS image file, dependency packages, driver, firmware, and CANN software package to the offline environment.

Environment Requirements

  • OS: openEuler 22.03 LTS SP4
  • Storage: The available space of the Toolkit installation directory is greater than 10 GB. If the space is insufficient, clear the space or change the installation directory.
  • Local repository: Configure the local openEuler repository by referring to the following example. If the local repository has been configured, skip this step.
    1. Upload the OS image file xxx.iso to the /home directory.
    2. Create a mount directory and mount the OS image file xxx.iso. Replace the file name with the actual one.
      1
      2
      3
      mkdir -p /mnt/iso
      cd /home
      mount xxx.iso /mnt/iso
      
    3. Back up the existing repository file xxx.repo in the environment.
      1
      2
      cd /etc/yum.repos.d
      mv /etc/yum.repos.d/xxx.repo /etc/yum.repos.d/xxx.repo.bak
      
    4. Create a repository file.
      1
      vi local.repo
      
    5. Add the following content to local.repo, save the content, and exit.
      1
      2
      3
      4
      5
      [openeuler]
      name=openeuler
      baseurl=file:///mnt/iso
      enabled=1
      gpgcheck=0
      
    6. Update the repository index.
      1
      yum clean all && yum makecache
      

Software Package Preparation

  • Download the NPU driver and firmware, and the CANN software package by referring to Software Package Preparation, and copy them to any directory (for example, /home) in the target environment.
  • Some dependencies are required for installing the NPU driver and firmware. For details, see Table 1. After configuring the local repository, obtain the dependencies from the local OS image and install them.
    Table 1 Dependencies

    Name

    Required Version

    Dependency Check Commands

    Installation Method

    make

    -

    make -v
    rpm -qa | grep dkms
    rpm -qa | grep gcc
    rpm -qa | grep kernel-headers-$(uname -r)
    rpm -qa | grep kernel-devel-$(uname -r)
    • If the software package version information is displayed, the software package has been installed.
    • If it is not installed, run the installation command.

    Example installation command:

    1
    yum install -y make dkms gcc kernel-headers-$(uname -r) kernel-devel-$(uname -r)
    

    dkms

    -

    gcc

    >=7.3.0

    kernel-headers

    -

    kernel-devel

    -

NPU Driver and Firmware Installation

Run the installation commands by referring to NPU Driver and Firmware Installation.

CANN Software Installation

Run the installation commands by referring to Installing CANN.