Rate This Document
Findability
Accuracy
Completeness
Readability

Installing KAE Using DEB Packages

The DEB software packages include hisi_hpre, hisi_sec2, hisi_zip, libkaezip, libkae, UACCE, and libwd. UACCE and libwd are mandatory. The others can be installed as required. Currently, KAE 1.0 can be installed with DEB packages, while KAE 2.0 does not.

Prerequisites

Procedure

The hisi_zip driver package depends on the UACCE package. The libkaezip engine package depends on the libwd software package.

If only the zlib library compression algorithm needs to be accelerated, install only the UACCE, hisi_zip, libwd, and libkaezip packages.

For details about the algorithm functions provided by each software package, see Introduction.

  1. Use an SSH tool to remotely log in to the Linux CLI as the root user.
  2. Copy the KAE DEB software packages to a custom directory.
  3. Install the accelerator driver software packages.
    • Method 1: Run the dpkg -i *.deb command to install all KAE DEB software packages.
      1
      dpkg -i *.deb 
      
    • Method 2: Install the software packages separately. The following example shows how to install the uacce-1.3.1 package.
      1
      2
      dpkg -i uacce-1.3.1-1.ubuntu18.04.arm64.deb
      uacce modules installed
      

      Install the hisi_zip driver software package and the libwd and libkaezip engine packages in sequence. Install the libwd package before installing the libkaezip engine package.

  4. Check whether the DEB packages are installed in the system.
    1. Check whether UACCE is installed.
      1
      dpkg -L uacce 
      

      Command output:

      1
      2
      3
      4
      5
      6
      7
      /.
      /lib
      /lib/modules
      /lib/modules/4.15.0-70-generic
      /lib/modules/4.15.0-70-generic/extra
      /lib/modules/4.15.0-70-generic/extra/uacce.ko
      /lib/modules/4.15.0-70-generic/extra/hisi_qm.ko
      
    2. Check whether hisi-zip is installed.
      1
      dpkg -L hisi-zip
      

      Command output:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      /. 
      /lib 
      /lib/modules 
      /lib/modules/4.15.0-70-generic 
      /lib/modules/4.15.0-70-generic/extra 
      /lib/modules/4.15.0-70-generic/extra/hisi_zip.ko 
      /etc 
      /etc/modprobe.d 
      /etc/modprobe.d/hisi_zip.conf 
      
    3. Check whether the corresponding modules are generated in the installation directory.
      1
      ls -al /lib/modules/`uname -r`/extra
      

      Command output:

      1
      2
      3
      4
      5
      total 348 
      drwxr-xr-x 2 root root  4096 Apr 15 17:12 . 
      drwxr-xr-x 6 root root  4096 Apr 15 17:12 .. 
      -rw-r--r-- 1 root root 42600 Apr 15 09:15 hisi_zip.ko 
      -rw-r--r-- 1 root root 40408 Apr 15 09:15 uacce.ko 
      
    4. Check whether the corresponding configuration files are generated in /etc/modprobe.d/.
      1
      ls -al /etc/modprobe.d/
      

      Command output:

       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      total 52
      drwxr-xr-x  2 root root 4096 Apr 15 17:12 .
      drwxr-xr-x 94 root root 4096 Apr 15 09:15 ..
      -rw-r--r--  1 root root  325 Jan 28  2018 blacklist-ath_pci.conf
      -rw-r--r--  1 root root 1667 Nov 13  2018 blacklist.conf
      -rw-r--r--  1 root root  210 Jan 28  2018 blacklist-firewire.conf
      -rw-r--r--  1 root root  697 Jan 28  2018 blacklist-framebuffer.conf
      -rw-r--r--  1 root root  583 Jan 28  2018 blacklist-rare-network.conf
      -rw-r--r--  1 root root   44 Apr 15 09:15 hisi_zip.conf
      -rw-r--r--  1 root root  347 Jan 28  2018 iwlwifi.conf
      -rw-r--r--  1 root root  379 Jul  2  2018 mdadm.conf
      
  5. Load the accelerator drivers to the kernel.
    • Method 1: Restart the system.
    • Method 2: Manually load the drivers in sequence in the CLI and check whether the loading is successful.
      1. Query driver modules that have been loaded to the kernel.
        1
        lsmod | grep uacce
        

        If no command output is displayed, perform 5.b to 5.c to load the corresponding modules to the kernel.

      2. Load the UACCE driver.
        1
        modprobe uacce
        
      3. Load the hisi_zip driver to the kernel based on the configuration file in /etc/modprobe.d/hisi_zip.conf.
        1
        modprobe hisi_zip
        
      4. Query driver modules that have been loaded to the kernel again.
        1
        2
        lsmod | grep uacce
        lsmod | grep hisi_qm
        
        If the following information is displayed, the loading is successful.
        1
        uacce                  28672  1 hisi_qm
        
        1
        2
        hisi_qm               65536  4 hisi_zip
        uacce                  28672  1 hisi_qm 
        

Verifying the Installation

  1. View the KAE DEB software packages.
    1
    dpkg -s uacce  hisi-zip
    
    The query result is as follows:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    Package: uacce
    Status: install ok installed
    Priority: optional
    Section: utils
    Installed-Size: 512
    Maintainer: HiSilicon Tech. Co., Ltd.
    Architecture: arm64
    Version: 1.3.1
    Description: This package contains the Unified/User-space-access-intended Accelerator Framework.
    URL: https://support.huawei.com 
     
    Package: hisi-zip
    Status: install ok installed
    Priority: optional
    Section: utils
    Installed-Size: 512
    Maintainer: HiSilicon Tech. Co., Ltd.
    Architecture: arm64
    Version: 1.3.1
    Description: This package contains the Huawei HiSilicon ZIP Accelerator Driver.
    URL: https://support.huawei.com
     
    
  2. Check accelerator devices in the /sys/ directory.
    1
    ls -al /sys/class/uacce/
    
    The query result is as follows:
    1
    2
    3
    4
    5
    total 0
    drwxr-xr-x  2 root root 0 Apr    15 17:42 .
    drwxr-xr-x 65 root root 0 Apr    15 16:49 ..
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_zip-6 -> ../../devices/pci0000:74/0000:74:00.0/0000:75:00.0/uacce/hisi_zip-6
    lrwxrwxrwx  1 root root 0 Apr  15 17:42 hisi_zip-7 -> ../../devices/pci0000:b4/0000:b4:00.0/0000:b5:00.0/uacce/hisi_zip-7
    
  3. Check whether the accelerator engines of the zlib library take effect.
    Run the ldd command to check whether the zlib library is linked to libwd and libkaezip.
    1
    ldd /usr/local/kaezip/lib/libz.so.1.2.11
    
    If the following information is displayed, the zlib library has been installed. You can also run the ldd command to check whether libwd and libkaezip are used.
    1
    2
    3
    4
    5
            linux-vdso.so.1 =>  (0x0000ffff80280000)
            libc.so.6 => /lib64/libc.so.6 (0x0000ffff80080000)
            libwd.so.1 => /lib64/libwd.so.1 (0x0000ffff80040000)
            /lib/ld-linux-aarch64.so.1 (0x0000ffff80290000)
            libkaezip.so => /usr/local/kaezip/lib/libkaezip.so (0x0000ffff80830000)