Installing KAE on a Physical Machine
The installation of KAE on a physical machine includes applying for and installing the KAE license, installing the dependencies, obtaining the KAE source package, installing KAE using the source code, and verifying the KAE installation.
- Apply for and install the KAE license. For details, see Obtaining a License in the Accelerator User Guide (KAE).
- Install dependencies.
yum -y install kernel-devel-$(uname -r) openssl-devel numactl-devel gcc make autoconf automake libtool patch
- Obtain the KAE 2.0 source package.
git clone https://gitee.com/kunpengcompute/KAE.git -b kae2

- Install KAE using the source code.
The sh build.sh all installation command can be used for one-click installation of KAE. Before using this command, you are advised to run the sh build.sh cleanup command for cleanup.
- Go to the KAE source code directory and perform the cleanup operation before the installation.
cd KAE sh build.sh cleanup

- Install KAE in one-click mode.
sh build.sh all

- Go to the KAE source code directory and perform the cleanup operation before the installation.
- Check whether KAE is successfully installed.
- Check whether related PCI drivers exist in the /sys/bus/pci/drivers directory.
ls /sys/bus/pci/drivers
If files similar to hisi_hpre, hisi_sec2, and hisi_zip exist (hisi_rde not implemented currently), the related drivers have been successfully installed.

- Check whether the KAE drivers contain a virtualization device. hisi_sec2 is used as an example here.
ls -lt /sys/bus/pci/drivers/hisi_sec2
If the corresponding device files are listed, the hisi_sec2 driver is successfully associated with the PCI device.

- Check kae.so to see whether KAE is successfully installed.
ll /usr/local/lib/engines-1.1
Expected result:

KAE is successfully installed.
Check the devices and modules in the OS.
ls -al /sys/class/uacce lsmod | grep uacce modprobe uacce modprobe hisi_zip modprobe hisi_sec2 modprobe hisi_hpre modprobe hisi_rde (hisi_rde not implemented currently) ls -lt /sys/bus/pci/drivers/hisi_sec2 lspci |grep HPRE lspci |grep RDE

If KAE devices such as hisi_zip, hisi_sec2, and hisi_hpre cannot be found, restart the server and check again whether KAE is successfully installed.
reboot
Check the KAE devices again.
ls -al /sys/class/uacce

- Check whether related PCI drivers exist in the /sys/bus/pci/drivers directory.
- Verify the acceleration capability of the KAE feature.
- Modify the OpenSSL configuration file to use KAE.
Add the following content to the openssl.cnf file and save the file to the /home directory:
openssl_conf=openssl_def [openssl_def] engines=engine_section [engine_section] kae=kae_section [kae_section] engine_id=kae dynamic_path=/usr/local/lib/engines-1.1/kae.so KAE_CMD_ENABLE_ASYNC=1 KAE_CMD_ENABLE_SM3=1 KAE_CMD_ENABLE_SM4=1 default_algorithms=ALL init=1
- Run the openssl speed command to compare the RSA encryption and decryption performance when KAE is enabled with that when KAE is disabled.
- Obtain the performance metrics before KAE is enabled.
openssl speed -elapsed rsa2048

- Obtain the performance metrics after KAE is enabled.
export OPENSSL_CONF=/home/openssl.cnf openssl speed -engine kae -elapsed rsa2048

The performance metrics before and after KAE is enabled are 774.2 and 3,184.8 sign/s, respectively. The performance is improved by about 300%.
- Obtain the performance metrics before KAE is enabled.
- Modify the OpenSSL configuration file to use KAE.