heipei / engine-cuda Goto Github PK
View Code? Open in Web Editor NEWengine-cuda is a CUDA/OpenCL engine for the popular OpenSSL cryptography framework.
License: GNU General Public License v3.0
engine-cuda is a CUDA/OpenCL engine for the popular OpenSSL cryptography framework.
License: GNU General Public License v3.0
Here's my command:
./configure --prefix=/opt --with-cudatoolkitpath=/usr/local/cuda --disable-libopencl
and here's the output
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ANSI C header files... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for stdint.h... (cached) yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking for memory.h... (cached) yes
checking openssl/aes.h usability... yes
checking openssl/aes.h presence... yes
checking for openssl/aes.h... yes
checking openssl/blowfish.h usability... yes
checking openssl/blowfish.h presence... yes
checking for openssl/blowfish.h... yes
checking openssl/camellia.h usability... yes
checking openssl/camellia.h presence... yes
checking for openssl/camellia.h... yes
checking openssl/cast.h usability... yes
checking openssl/cast.h presence... yes
checking for openssl/cast.h... yes
checking openssl/des.h usability... yes
checking openssl/des.h presence... yes
checking for openssl/des.h... yes
checking openssl/idea.h usability... no
checking openssl/idea.h presence... no
checking for openssl/idea.h... no
configure: error: openssl/idea.h required
idea.h seems to be in his place:
ls /opt/include/openssl/
aes.h cast.h dsa.h e_os2.h md2.h ossl_typ.h rc2.h ssl3.h ui_compat.h
asn1.h comp.h dso.h err.h md4.h pem2.h rc4.h ssl.h ui.h
asn1_mac.h conf_api.h dtls1.h evp.h md5.h pem.h ripemd.h stack.h x509.h
asn1t.h conf.h ebcdic.h hmac.h objects.h pkcs12.h rsa.h store.h x509v3.h
bio.h crypto.h ecdh.h idea.h obj_mac.h pkcs7.h safestack.h symhacks.h x509_vfy.h
blowfish.h des.h ecdsa.h krb5_asn.h ocsp.h pq_compat.h sha.h tls1.h
bn.h des_old.h ec.h kssl.h opensslconf.h pqueue.h ssl23.h tmdiff.h
buffer.h dh.h engine.h lhash.h opensslv.h rand.h ssl2.h txt_db.h
Here I am again :(
invalid engine "cudamrg"
139868566857424:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(/usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines/libcudamrg.so): /usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines/libcudamrg.so: undefined symbol: cudaGetDeviceCount
139868566857424:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139868566857424:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
139868566857424:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:417:id=cudamrg
139868566857424:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libcudamrg.so): libcudamrg.so: cannot open shared object file: No such file or directory
139868566857424:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139868566857424:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
when I run
optirun ./test-speed.sh
(optirun is needed as I'm using Bumblebee/nVidia Optimus)
Hi! Try to install lib :
My system is
x86_64
DISTRIB_ID=LinuxMint
DISTRIB_DESCRIPTION="Linux Mint 21 Vanessa"
NAME="Linux Mint"
CUDA toolkit installed - yes
patched OpenSSL - yes
gcc - gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Сonfigure with path - that's ok
./configure --with-cudatoolkitpath=/usr/local/cuda
But make writes a lot of errors!
Such as:
e_cuda.c:195:41: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
195 | BF_set_key(&key_schedule,ctx->key_len,key);
or
e_cuda.c:222:13: error: unknown type name ‘IDEA_KEY_SCHEDULE’; did you mean ‘IDEA_KEY_SIZE’?
222 | IDEA_KEY_SCHEDULE idea_key_schedule, idea_dec_key_schedule;
OR
e_cuda.c:365:27: error: storage size of ‘cuda_cast_ecb’ isn’t known
365 | #define cuda_cast_128_ecb cuda_cast_ecb
| ^~~~~~~~~~~~~
e_cuda.c:343:25: note: in expansion of macro ‘cuda_cast_128_ecb’
343 | static const EVP_CIPHER cuda_##lciph##_##ksize##_##lmode = { \
| ^~~~~
e_cuda.c:393:1: note: in expansion of macro ‘DECLARE_EVP’
393 | DECLARE_EVP(cast,CAST,128,ecb,ECB);
| ^~~~~~~~~~~
e_cuda.c:360:25: error: storage size of ‘cuda_des_cbc’ isn’t known
360 | #define cuda_des_64_cbc cuda_des_cbc
| ^~~~~~~~~~~~
e_cuda.c:343:25: note: in expansion of macro ‘cuda_des_64_cbc’
343 | static const EVP_CIPHER cuda_##lciph##_##ksize##_##lmode = { \
| ^~~~~
e_cuda.c:394:1: note: in expansion of macro ‘DECLARE_EVP’
394 | DECLARE_EVP(des,DES,64,cbc,CBC);
| ^~~~~~~~~~~
e_cuda.c:378:26: error: storage size of ‘cuda_idea_cbc’ isn’t known
378 | #define cuda_idea_64_cbc cuda_idea_cbc
| ^~~~~~~~~~~~~
e_cuda.c:343:25: note: in expansion of macro ‘cuda_idea_64_cbc’
343 | static const EVP_CIPHER cuda_##lciph##_##ksize##_##lmode = { \
| ^~~~~
e_cuda.c:396:1: note: in expansion of macro ‘DECLARE_EVP’
396 | DECLARE_EVP(idea,IDEA,64,cbc,CBC);
I tried to fix e_cuda.c regarding type matching. But perhaps this is the wrong way - by correcting one thing I get a lot of other errors.
Please advise what could be wrong
Hi,
ive just followed your instructions and compiled the source, if i wanna test with openssl its not working:
OpenSSL> engine -t dynamic -pre SO_PATH:/usr/local/lib/engines/libcudamrg.so -pre ID:cudamrg -pre LIST_ADD:1 -pre LOAD
(dynamic) Dynamic engine loading support
140018746762912:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(/usr/local/lib/engines/libcudamrg.so): /usr/local/lib/engines/libcudamrg.so: undefined symbol: cudaGetDeviceCount
140018746762912:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140018746762912:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
[ unavailable ]
on the other issue i saw the compiler flag -Wl,--no-as-needed but its still not working :(
Im using Ubuntu 12.04 x64
gcc-Version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
Cuda compilation tools, release 5.5, V5.5.0
EDIT: Ive tested it on Debian Wheezy and its working! YaY
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.