Open Kewei-Lu opened 5 months ago
$ openssl speed -engine qatengine -elapsed -async_jobs 8 rsa2048
Can you try with 4 jobs? It could be that the qatlib allocation limitation triggers the problem you're seeing. Try settin QAT_POLICY=1
environment variable. If that helps, we'll need to update our docs a bit.
Ref: https://github.com/intel/qatlib/blob/ec817626e7de237b24cfb91b7cad076902df603a/INSTALL#L519-L522
Nice catch! Will not see the error if adding that ENV in container. Really appreciate :)
Describe the bug Some processes report "No devices found" during running
openssl speed
command whenprivilege
is not set to containerTo Reproduce
Build the docker image based on
demo/openssl-qat-engine/Dockerfile
Deploy qat device-plugin and check resources are available
Deploy
openssl-qat-engine
with below manifestLogin to the container and verify using
openssl
This works fine
$ openssl speed -engine qatengine -elapsed -async_jobs 8 rsa2048 Engine "qatengine" set. You have chosen to measure elapsed time instead of user CPU time. Doing 2048 bits private rsa's for 10s: 199083 2048 bits private RSA's in 10.00s Doing 2048 bits public rsa's for 10s: 959389 2048 bits public RSA's in 10.00s version: 3.0.2 built on: Fri Feb 16 08:51:30 2024 UTC options: bn(64,64) compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-olCZw9/openssl-3.0.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 CPUINFO: OPENSSL_ia32cap=0x7ffef3ffffebffff:0xfb417ffef3bfb7ef sign verify sign/s verify/s rsa 2048 bits 0.000050s 0.000010s 19908.3 95938.9
When setting multiple processes, the error pop up
$ openssl speed -engine qatengine -elapsed -async_jobs 8 -multi 8 rsa2048
Forked child 0 Forked child 1 Forked child 2 Forked child 3 Forked child 4 Forked child 5 Forked child 6 Forked child 7 No devices found No devices found No devices found No device found No device found No device found Engine "qatengine" set. Engine "qatengine" set. Engine "qatengine" set. +DTP:2048:private:rsa:10 +DTP:2048:private:rsa:10 +DTP:2048:private:rsa:10 No devices found No device found ... Got: +F2:2:2048:6680.100000:83645.800000 from 0 Got: +F2:2:2048:6630.500000:83514.600000 from 1 Don't understand line 'ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SHIM' from child 2 Got: +F2:2:2048:11644.800000:144419.200000 from 2 Got: +F2:2:2048:6952.300000:84143.700000 from 3 Don't understand line 'ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SHIM' from child 4 Got: +F2:2:2048:11627.200000:142830.069930 from 4 Don't understand line 'ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SHIM' from child 5 Got: +F2:2:2048:11668.800000:143320.000000 from 5 Don't understand line 'ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SHIM' from child 6 Got: +F2:2:2048:11376.800000:127321.378621 from 6 Don't understand line 'ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SHIM' from child 7 Got: +F2:2:2048:11647.200000:142272.027972 from 7
The result seems also get boosted somehow, but not sure via qat_sw or qat_hw
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-olCZw9/openssl-3.0.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 CPUINFO: OPENSSL_ia32cap=0x7ffef3ffffebffff:0xfb417ffef3bfb7ef sign verify sign/s verify/s rsa 2048 bits 0.000013s 0.000001s 78227.7 951466.8