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
- You have downloaded the KAE 1.0 source package from https://gitee.com/kunpengcompute/KAE/tree/kae1/.
- The system environment meets the requirements described in Preparing for the Installation.
Procedure
- Use a remote login tool to log in to the Linux CLI as the root user.
- Copy the KAE source package to a custom directory.
- 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).
- 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.
- (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.
- 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.
- Query UACCE driver modules that have been loaded to the kernel.
1lsmod | grep uacce
If no command output is displayed, perform 6.b to 6.c to load the corresponding modules to the kernel.
- Load the UACCE driver.
1modprobe uacce - Load the hisi_zip driver to the kernel based on the configuration file in /etc/modprobe.d/hisi_zip.conf.
1modprobe hisi_zip - Query UACCE driver modules that have been loaded to the kernel again.
1lsmod | grep uacce
If the following information is displayed, the loading is successful.1uacce 36864 3 hisi_qm,hisi_zip
- Query UACCE driver modules that have been loaded to the kernel.
- Compile and install the zlib compression library.
Verifying the Installation
- Run the cd command to go to the /usr/local/lib directory or a user-defined directory.
- Check the soft link status.
- Check the soft link status of libwd.
1ls -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
- Check the soft link status of the zlib library.
1ll /usr/local/kaezip/libIf 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
- Check the soft link status of libwd.
- Check the accelerator devices in the virtual file system.
1ls -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
- 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.
1ldd /usr/local/kaezip/lib/libz.so.1.2.11If 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)