Rate This Document
Findability
Accuracy
Completeness
Readability

Installation Using Source Code (KAE 1.0)

The KAE 1.0 source package contains four modules: kernel driver, user-mode driver, OpenSSL-based KAE engine, and zlib library. The kernel driver and user-mode driver are mandatory, and the other two are optional. In this document, the zlib library is installed. During the installation, you need to run commands to compile and install the library, and then check whether the installation is successful.

Prerequisites

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.
  3. Install the kernel driver.

    In the kae_driver source code directory, go to the kae_driver directory and install the kernel driver.

    1
    2
    3
    cd kae_driver/kae_driver
    make
    make install
    
    After compilation, uacce.ko, hisi_qm.ko, hisi_sec2.ko, hisi_hpre.ko, and hisi_zip.ko are generated. The installation path is /lib/modules/`uname -r`/extra.

    The SUSE and CentOS kernel directory is /lib/modules/`uname -r`/, and the driver installation path is /lib/modules/`uname -r`/extra. The `uname -r` command is used to obtain the current kernel information. If other OSs do not use this directory, modify the kernel directory specified by install in the Makefile file.

    install:

    Change $(shell mkdir -p /lib/modules/`uname -r`/extra) to $(shell mkdir -p kernel_directory/extra).

  4. Install the user-mode driver.
    In the kae_driver source code directory, go to the warpdrive directory and install the warpdrive driver development library.
    1
    2
    3
    4
    5
    cd kae_driver/warpdrive
    sh autogen.sh
    ./configure
    make
    make install
    

    The --prefix option can be added to the ./configure compile command to specify the location where the user-mode driver needs to be installed. The dynamic library file of the user-mode driver is libwd.so. The default installation path of warpdrive is /usr/local. The dynamic library file is in /usr/local/lib.

  5. (Optional) If a SUSE OS is used, set allow_unsupported_modules in the /etc/modprobe.d/10-unsupported-modules.conf configuration file to 1 before loading external drivers.
  6. 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 UACCE driver modules that have been loaded to the kernel.
        1
        lsmod | grep uacce
        

        If no command output is displayed, perform 6.b to 6.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 UACCE driver modules that have been loaded to the kernel again.
        1
        lsmod | grep uacce
        
        If the following information is displayed, the loading is successful.
        1
        uacce                36864  3 hisi_qm,hisi_zip
        
  7. Compile and install the zlib compression library.
    1. Download zlib-1.2.11.tar.gz from the zlib website and copy it to the kae_zip_engine/open_source directory.
    2. Compile and install the zlib library.
      1
      2
      cd kae_zip_engine
      sh setup.sh install
      

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

Verifying the Installation

  1. Run the cd command to go to the /usr/local/lib directory or a user-defined directory.
  2. Check the soft link status.
    1. Check the soft link status of libwd.
      1
      ls -al /usr/local/lib/ |grep libwd
      
      If the command output shows the soft links and SO files, libwd has been installed.
      1
      2
      3
      lrwxrwxrwx. 1 root root      14 Jun 25 11:16 libwd.so -> libwd.so.1.0.1
      lrwxrwxrwx. 1 root root      14 Jun 25 11:16 libwd.so.0 -> libwd.so.1.0.1
      -rwxr-xr-x. 1 root root  137280 Jun 24 11:37 libwd.so.1.0.1
      
    2. Check the soft link status of the zlib library.
      1
      ll /usr/local/kaezip/lib
      
      If the command output shows the soft links and SO files, the zlib library has been installed.
      1
      2
      3
      4
      -rw-r-r-. 1 root root 161162 Jul 10 12:54 libz.a
      lrwxrwxrwx. 1 root root     14 Jul 10 12:54 libz.so -> libz.so.1.2.11
      lrwxrwxrwx. 1 root root     14 Jul 10 12:54 libz.so.1 -> libz.so.1.2.11
      -rwxr-xr-x. 1 root root 146656 Jul 10 12:54 libz.so.1.2.11   
      
  3. Check the accelerator devices in the virtual file system.
    1
    ls -al /sys/class/uacce/
    
    Command output:
    1
    2
    3
    total 0
    lrwxrwxrwx. 1 root root 0 Nov 17 22:09 hisi_zip-6 -> ../../devices/pci0000:74/0000:74:00.0/0000:75:00.0/uacce/hisi_zip-6
    lrwxrwxrwx. 1 root root 0 Nov 17 22:09 hisi_zip-7 -> ../../devices/pci0000:b4/0000:b4:00.0/0000:b5:00.0/uacce/hisi_zip-7
    
  4. 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)