Rate This Document
Findability
Accuracy
Completeness
Readability

Installation Using Source Code (KAE 2.0)

The KAE 2.0 source package contains the KAE kernel driver, UADK framework, KAEOpensslEngine and KAEZlib modules. The kernel driver and UADK are mandatory, and KAEOpensslEngine and KAEZlib are optional. This document involves the zlib library. You can use scripts for installation and need to check whether the installation is successful.

Prerequisites

  • You have downloaded the KAE 2.0 source package from https://gitee.com/kunpengcompute/KAE/tree/kae2/ or by running git clone https://gitee.com/kunpengcompute/KAE.git -b kae2.
  • The system environment meets the requirements described in Preparing for the Installation.
  • Run the yum install -y make kernel-devel libtool numactl-devel openssl-devel lz4-devel libzstd-devel chrpath command to install dependencies.

Procedure

  1. Use a remote login tool to log in to the Linux CLI as the root user.
  2. Copy the KAE source package to a custom directory and decompress the package.
  3. (Optional) Install all modules using a script.

    Go to the directory of the KAE source package and run the sh build.sh all command to install all the preceding components. If the encryption and decryption module is not required, perform the following steps to install them by module.

  4. Install the kernel driver.
    1. Install the kernel driver in the KAE source code directory.
      1
      2
      cd KAE
      sh build.sh driver
      

      After compilation, uacce.ko, hisi_qm.ko, hisi_sec2.ko, hisi_hpre.ko, hisi_zip.ko, and hisi_rde.ko are generated. The installation path is /lib/modules/`uname -r`/extra.

    2. Check whether the drivers are installed.
      • Check whether the accelerator engine file system exists in /sys/class/uacce.
        1
        ll /sys/class/uacce/
        
        If the following information is displayed, the drivers have been installed:
        1
        2
        3
        4
        5
        6
        lrwxrwxrwx. 1 root root 0 Aug 22 17:14 hisi_hpre-2 -> ../../devices/pci0000:78/0000:78:00.0/0000:79:00.0/uacce/hisi_hpre-2
        lrwxrwxrwx. 1 root root 0 Aug 22 17:14 hisi_hpre-3 -> ../../devices/pci0000:b8/0000:b8:00.0/0000:b9:00.0/uacce/hisi_hpre-3
        lrwxrwxrwx. 1 root root 0 Aug 22 17:14 hisi_sec2-0 -> ../../devices/pci0000:74/0000:74:01.0/0000:76:00.0/uacce/hisi_sec2-0
        lrwxrwxrwx. 1 root root 0 Aug 22 17:14 hisi_sec2-1 -> ../../devices/pci0000:b4/0000:b4:01.0/0000:b6:00.0/uacce/hisi_sec2-1
        lrwxrwxrwx. 1 root root 0 Aug 22 17:14 hisi_zip-4 -> ../../devices/pci0000:74/0000:74:00.0/0000:75:00.0/uacce/hisi_zip-4
        lrwxrwxrwx. 1 root root 0 Aug 22 17:14 hisi_zip-5 -> ../../devices/pci0000:b4/0000:b4:00.0/0000:b5:00.0/uacce/hisi_zip-5
        
      • Use lsmod to check whether the drivers are successfully installed.
        1
        lsmod | grep uacce
        
        If the following information is displayed, the drivers have been installed:
        1
        uacce                  32768  3 hisi_sec2,hisi_qm,hisi_zip
        
    • If no device file is queried after the device is restarted and a driver is installed, a possible cause is that the OS has a built-in accelerator driver. You can uninstall the driver and then reload it. Alternatively, add the command for reloading the driver to the startup script re.local. The following uses hisi_sec2 as an example.
      1
      2
      rmmod hisi_sec2
      modprobe hisi_sec2
      
    • If no device file is queried after you run sh build.sh cleanup and then reinstall the driver, check that the license is successfully installed. For details, see "Obtaining a License" in Preparing for the Installation.
    • In KAE 2.0, the encryption and decryption as well as decompression drivers are installed together by default. You can manually uninstall unnecessary driver files.
  5. Install the user-mode driver.
    1. Run the following command in the KAEdriver source code directory to install the UADK driver development library:
      1
      sh build.sh uadk
      

      The UADK framework contains the user-mode driver. The dynamic library files of the user-mode driver are libwd.so and libwd_crypto.so. The default installation path of UADK is /usr/include/uadk. The dynamic library file is in /usr/local/lib.

    2. Check whether the UADK framework is installed.
      1
      ll /usr/local/lib/libwd*
      
      The installation is successful if the following information is displayed:
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      -rwxr-xr-x. 1 root root     961 Aug 22 17:23 /usr/local/lib/libwd_comp.la
      lrwxrwxrwx. 1 root root      19 Aug 22 17:23 /usr/local/lib/libwd_comp.so -> libwd_comp.so.2.5.0
      lrwxrwxrwx. 1 root root      19 Aug 22 17:23 /usr/local/lib/libwd_comp.so.2 -> libwd_comp.so.2.5.0
      -rwxr-xr-x. 1 root root  377872 Aug 22 17:23 /usr/local/lib/libwd_comp.so.2.5.0
      -rwxr-xr-x. 1 root root     973 Aug 22 17:23 /usr/local/lib/libwd_crypto.la
      lrwxrwxrwx. 1 root root      21 Aug 22 17:23 /usr/local/lib/libwd_crypto.so -> libwd_crypto.so.2.5.0
      lrwxrwxrwx. 1 root root      21 Aug 22 17:23 /usr/local/lib/libwd_crypto.so.2 -> libwd_crypto.so.2.5.0
      -rwxr-xr-x. 1 root root  715616 Aug 22 17:23 /usr/local/lib/libwd_crypto.so.2.5.0
      -rwxr-xr-x. 1 root root     907 Aug 22 17:23 /usr/local/lib/libwd.la
      lrwxrwxrwx. 1 root root      14 Aug 22 17:23 /usr/local/lib/libwd.so -> libwd.so.2.5.0
      lrwxrwxrwx. 1 root root      14 Aug 22 17:23 /usr/local/lib/libwd.so.2 -> libwd.so.2.5.0
      -rwxr-xr-x. 1 root root 1342080 Aug 22 17:23 /usr/local/lib/libwd.so.2.5.0
      
  6. Compile and install the KAEZlib library.
    • KAEZlib library
      1
      sh build.sh zlib
      

      The zlib library is installed in /usr/local/kaezip.

      Check whether the zlib compression library is successfully installed.
      1
      ll /usr/local/kaezip/lib/
      
      The installation is successful if the following information is displayed:
      1
      2
      3
      4
      5
      6
      7
      8
      lrwxrwxrwx. 1 root root     40 Aug 29 10:20 libkaezip.so -> /usr/local/kaezip/lib/libkaezip.so.2.0.0
      lrwxrwxrwx. 1 root root     40 Aug 29 10:20 libkaezip.so.0 -> /usr/local/kaezip/lib/libkaezip.so.2.0.0
      -rwxr-xr-x. 1 root root 148096 Aug 29 10:20 libkaezip.so.2.0.0
      -rw-r--r--. 1 root root 145674 Aug 29 10:20 libz.a
      lrwxrwxrwx. 1 root root     14 Aug 29 10:20 libz.so -> libz.so.1.2.11
      lrwxrwxrwx. 1 root root     14 Aug 29 10:20 libz.so.1 -> libz.so.1.2.11
      -rwxr-xr-x. 1 root root 144784 Aug 29 10:20 libz.so.1.2.11
      drwxr-xr-x. 2 root root   4096 Aug 29 10:20 pkgconfig
      
  7. Check whether the installation is successful.
    • Check whether the accelerator engine of the KAEZlib library takes effect by running the ldd command to confirm that KAEZlib links the libwd library.
      1
      ldd /usr/local/kaezip/lib/libz.so.1.2.11
      
      If the following information is displayed, the KAEZlib library has been installed. You can also run the ldd command to check whether the libwd library is used.
      1
      2
      3
      4
      5
      6
      7
              linux-vdso.so.1 (0x0000ffffa631d000)
      	libc.so.6 => /usr/lib64/libc.so.6 (0x0000ffffa6110000)
      	libkaezip.so => /usr/local/kaezip/lib/libkaezip.so (0x0000ffffa60df000)
      	libwd.so.2 => /usr/local/lib/libwd.so.2 (0x0000ffffa607e000)
      	libwd_comp.so.2 => /usr/local/lib/libwd_comp.so.2 (0x0000ffffa605d000)
      	/lib/ld-linux-aarch64.so.1 (0x0000ffffa62e0000)
      	libnuma.so.1 => /usr/lib64/libnuma.so.1 (0x0000ffffa6038000)