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
- Disk space: The Toolkit needs over 10 GB of free space in the installation directory. If there is less than 10 GB free, free up space or choose another directory.
- Local repository: Configure the local openEuler repository by referring to the following example. If the local repository has been configured, skip this step.
- Upload the OS image file xxx.iso to the /home directory.
- 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
- 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
- Create a repository file.
1vi local.repo - 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
- Update the repository index.
1yum clean all && yum makecache
Preparing Software Packages
- 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 Command
Installation
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:
1yum install -y make dkms gcc kernel-headers-$(uname -r) kernel-devel-$(uname -r)
dkms
-
gcc
>=7.3.0
kernel-headers
-
kernel-devel
-
Installing the NPU Driver and Firmware
Run the installation commands by referring to Installing the NPU Driver and Firmware.
Installing the CANN Software
Run the installation commands by referring to Installing CANN.
Parent topic: Appendix B: Common Operations