Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Debian based distros ?! #8

Closed
martin-g opened this issue Mar 16, 2020 · 6 comments
Closed

Support for Debian based distros ?! #8

martin-g opened this issue Mar 16, 2020 · 6 comments

Comments

@martin-g
Copy link
Contributor

Hi,

Is KAE supported for Debian based distros ? Because the README seems to be about RedHat based ones.

I've tried to install it on Ubuntu 18.04.4 LTS aarch64 with the following changes:

iff --git README.md README.md
index d238959..20bc70e 100644
--- README.md
+++ README.md
@@ -48,6 +48,7 @@ It is licensed under the [APACHE LICENSE, VERSION 2.0](https://www.apache.org/l
   * SuSE 15.1 4.12.14-195-default arch64 version
   * NeoKylin 7.6 4.14.0-115.5.1.el7a.06.aarch64 version
   * EulerOS 2.8 4.19.36-vhulk1907.1.0.h410.eulerosv2r8.aarch64 version
+  * Ubuntu 18.04.4 LTS aarch64 version
 * OpenSSL 1.1.1a  or later OpenSSL
 
 ## Installation Instructions
@@ -58,7 +59,7 @@ Clone OpenSSL from Github at the following location:
 
     git clone https://github.com/openssl/openssl.git
 
-You are advised to check out and build the OpenSSL 1.1.1a git tag specified in the release notes.
+You are advised to check out and build the OpenSSL 1.1.1d git tag specified in the release notes.
 Versions of OpenSSL before OpenSSL 1.1.0 are not supported.
 
 Note: You are not advised to install the accelerated version of OpenSSL as your default system library. Otherwise, acceleration may be used unexpectedly by other applications on the system, resulting in undesired/unsupported behavior. The `--prefix` can be used with the `./config` command to specify the location that `make install` will copy files to. Please see the OpenSSL INSTALL file for full details on usage of the `--prefix` option.
@@ -81,19 +82,19 @@ Download the release version of Kunpeng Accelerator Engine Driver from:
 <https://github.com/kunpengcompute/KAEdriver>
 
 Firstly, build and install the accelerator driver:
-Note: To build the Kunpeng Accelerator Engine Driver, install the `kernel-devel` package first.
+Note: To build the Kunpeng Accelerator Engine Driver, install the `kernel-devel` / `linux-headers-generic` package first.
 
 ``
 tar -zxf Kunpeng_KAE_driver.tar.gz
 cd kae_driver
 make
-make install
-modprobe uacce
-modprobe hisi_qm
-modprobe hisi_sec2
-modprobe hisi_hpre
-modprobe hisi_zip
-modprobe hisi_rde
+sudo make install
+sudo modprobe uacce
+sudo modprobe hisi_qm
+sudo modprobe hisi_sec2
+sudo modprobe hisi_hpre
+sudo modprobe hisi_zip
+sudo modprobe hisi_rde
 ``
 Secondly, install the accelerator library:
 
@@ -102,7 +103,7 @@ cd warpdrive
 sh autogen.sh 
 ./configure 
 make 
-make install
+sudo make install
 
 Then, install the  Kunpeng Accelerator Engine:

But those:

sudo modprobe hisi_sec2
sudo modprobe hisi_zip 
sudo modprobe hisi_rde 

fail with No such device.

I was not able to finish the setup because I've installed OpenSSL in a custom path, so that it does not override the one installed from Ubuntu packages, but now I face some linking errors. I'll report here if I face any issues with KAE!

@mystery-nobody
Copy link
Collaborator

These messages indicate that you have not installed the License for Kunpeng Accelerator. To get more information about How to install the License, please refer the follow location at
https://bbs.huaweicloud.com/forum/forum.php?mod=viewthread&tid=34245&page=1&extra=#pid105027

In addition, since your OpenSSL is a custom installation, you need to specify the OpenSSL installation path when compiling KAE.
The --openssl_path can be used with the ./configure command to specify the OpenSSL location.

cd KAE
./configure --openssl_path=/usr/local/youropenssl/lib
make
make install

@martin-g
Copy link
Contributor Author

These messages indicate that you have not installed the License for Kunpeng Accelerator

I see. It would be nice to add this info to the README..

The --openssl_path can be used with the ./configure command to specify the OpenSSL location.

Yes, I've done this. Same for warpdriver.

Still I am doing something wrong because it links to the global libssl.so:

ubuntu@ubuntu ~/g/K/openssl-build> ./bin/openssl --help
./bin/openssl: relocation error: ./bin/openssl: symbol EVP_mdc2 version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference
ubuntu@ubuntu ~/g/K/openssl-build> ldd bin/openssl 
	linux-vdso.so.1 (0x0000ffff9e82e000)
	libssl.so.1.1 => /usr/lib/aarch64-linux-gnu/libssl.so.1.1 (0x0000ffff9e6ba000)
	libcrypto.so.1.1 => /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000ffff9e476000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff9e44a000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff9e2f1000)
	/lib/ld-linux-aarch64.so.1 (0x0000ffff9e803000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff9e2dc000)

not to the one in the custom build:

ubuntu@ubuntu ~/g/K/openssl-build> ls -la lib/
total 9.2M
drwxrwxr-x 2 ubuntu ubuntu 4.0K Mar 15 22:17 engines-1.1/
-rw-r--r-- 1 ubuntu ubuntu 4.9M Mar 15 22:17 libcrypto.a
lrwxrwxrwx 1 ubuntu ubuntu   16 Mar 15 22:17 libcrypto.so -> libcrypto.so.1.1*
-rwxr-xr-x 1 ubuntu ubuntu 2.8M Mar 15 22:17 libcrypto.so.1.1*
-rw-r--r-- 1 ubuntu ubuntu 922K Mar 15 22:17 libssl.a
lrwxrwxrwx 1 ubuntu ubuntu   13 Mar 15 22:17 libssl.so -> libssl.so.1.1*
-rwxr-xr-x 1 ubuntu ubuntu 601K Mar 15 22:17 libssl.so.1.1*
drwxrwxr-x 2 ubuntu ubuntu 4.0K Mar 15 22:17 pkgconfig/

Due to the license issue I won't be able to continue testing this on Ubuntu. I am doing it out of curiosity. Feel free to close this issue!

Thank you!

@mystery-nobody
Copy link
Collaborator

This problem is because the OpenSSL you installed does not link to the correct dynamic library at runtime, please reinstall your OpenSSL via ./config -Wl, -rpath=/your/custom/path/ . If symbol EVP_mdc2 not defined still occurs, please upgrade OpenSSL to version 1.1.1a or later

@martin-g
Copy link
Contributor Author

I use 1.1.1d.
Until now I was using: ./config --prefix=/home/ubuntu/git/KAE/openssl-build --openssldir=/home/ubuntu/git/KAE/openssl-build.

With

./config --prefix=/home/ubuntu/git/KAE/openssl-build --openssldir=/home/ubuntu/git/KAE/openssl-build -Wl,-rpath=/home/ubuntu/git/KAE/openssl-build

it is still the same:

buntu@ubuntu ~/g/K/o/bin> pwd
/home/ubuntu/git/KAE/openssl-build/bin
ubuntu@ubuntu ~/g/K/o/bin> ldd openssl 
	linux-vdso.so.1 (0x0000ffffbeebf000)
	libssl.so.1.1 => /usr/lib/aarch64-linux-gnu/libssl.so.1.1 (0x0000ffffbed4b000)
	libcrypto.so.1.1 => /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000ffffbeb07000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffffbeadb000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffffbe982000)
	/lib/ld-linux-aarch64.so.1 (0x0000ffffbee94000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffffbe96d000)

I will read carefully OpenSSL's INSTALL file in the coming evenings to see what I do wrong.

@mystery-nobody
Copy link
Collaborator

-Wl, -rpath should specify the correct location of OpenSSL libcrypto.so, please try the config as follow:
-Wl,-rpath=/home/ubuntu/git/KAE/openssl-build/lib

@martin-g
Copy link
Contributor Author

This fixed it! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants