akmalsabri / engine-cuda

Automatically exported from code.google.com/p/engine-cuda
GNU General Public License v3.0
0 stars 0 forks source link

Problem with cudaSetDevice using CUDA 2.3 #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am not able to run aes encryption. More precisely, after loading the engine 
as described in the documentation, I get the following error and the openssl 
shell terminates:

Cuda error in file 'aes_cuda.cu' in line 1718: setting the device when a 
process is active is not allowed.

Here my installation:
- Fedora 11 x86_64
- CUDA toolkit 2.3
- Nvidia driver 190.53
- gcc 3.4
- OpenSSL 0.9.8n

Unfortunately I cannot upgrade my installation since I have not the privileges 
on the machine I am using. Any Clue?

Daniele

Original issue reported on code.google.com by mUogoro on 1 Feb 2012 at 4:05

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, this is quite strange.

Can you give me some detail about your hardware configuration?
Do you have the same issue also using the openssl engine autoloading?

NOTE: I've looked at that you are trying to run the test speed using the 
aes-cbc, be carefull while evaluating the performance of that test.

If you want you can write directly to my email address ( using the italian 
language ;-) ), you could find it looking at the source code.

Paolo

Original comment by paolo.ma...@gmail.com on 1 Feb 2012 at 4:53

GoogleCodeExporter commented 9 years ago
Now I am at home, and I don't exactly remember the whole machine
configuration, just the GPU that it's a GTX260. Tomorrow morning I'll
send you the remaining hardware information. I'll try the autoloading as
well. I'm a CUDA newbie, so it's pretty difficult for me to find a
solution looking at the code.

Daniele

Original comment by mUogoro on 1 Feb 2012 at 6:12

GoogleCodeExporter commented 9 years ago
Hi,

here some more info about my hardware configuration:
- Intel Core 2 Quad Q9400;
- 4GB Ram
- GeForce GTX260, driver version 190.53

I've found incompatibilities with CUDA >3.0 and the installed drivers, so I've 
downgraded CUDA to version 2.3 and managed to compile the engine.
Regarding the reported error, I've managed to load the engine and perform some 
encryptions in the following ways:
- loading the engine from the OpenSSL prompt WITHOUT the -t dynamic flag;
- specifying an alternative configuration path (with the same setting described 
in the wiki) setting the OPENSSL_CONF env variable.

Anyway the engine still randomly crashes or stops working. For example, using 
the custom conf file and getting two consecutive times the engine list, the 
second time I get this error and the engine becomes unusable:

OpenSSL> engine -t
Successfully found a device supporting CUDA (CUDART_VERSION 2030).
Using pinned memory: cudaHostAllocDefault.
The current buffer size is 8388608.

(dynamic) Dynamic engine loading support
     [ unavailable ]
(cudamrg) cuda engine for AES encrypting/decrypting developed by MRG
     [ available ]
OpenSSL> engine -t
Error configuring OpenSSL
4056:error:26078067:engine routines:ENGINE_LIST_ADD:conflicting engine 
id:eng_list.c:116:
4056:error:2606906E:engine routines:ENGINE_add:internal list 
error:eng_list.c:288:
4056:error:260B6067:engine routines:DYNAMIC_LOAD:conflicting engine 
id:eng_dyn.c:540:
4056:error:260BC065:engine routines:INT_ENGINE_CONFIGURE:engine configuration 
error:eng_cnf.c:204:section=cudamrg_section, name=dynamic_path, 
value=/media/casper-rw/public/Univ/sicurezza/gpgpu_crypto_report/tools/opt/lib/e
ngines/libcudamrg.so
4056:error:0E07606D:configuration file routines:MODULE_RUN:module 
initialization error:conf_mod.c:235:module=engines, value=engine_section, 
retcode=-1      
error in engine

Same error with two consecutive encryptions:

OpenSSL> enc -e -engine cudamrg -in r100MB -out cr100MB -aes-128-ecb
Successfully found a device supporting CUDA (CUDART_VERSION 2030).
Using pinned memory: cudaHostAllocDefault.
The current buffer size is 8388608.

engine "cudamrg" set.
enter aes-128-ecb encryption password:
Verifying - enter aes-128-ecb encryption password:
OpenSSL> enc -e -engine cudamrg -in r100MB -out cr100MB -aes-128-ecb
Error configuring OpenSSL
4096:error:26078067:engine routines:ENGINE_LIST_ADD:conflicting engine 
id:eng_list.c:116:
4096:error:2606906E:engine routines:ENGINE_add:internal list 
error:eng_list.c:288:
4096:error:260B6067:engine routines:DYNAMIC_LOAD:conflicting engine 
id:eng_dyn.c:540:
4096:error:260BC065:engine routines:INT_ENGINE_CONFIGURE:engine configuration 
error:eng_cnf.c:204:section=cudamrg_section, name=dynamic_path, 
value=/media/casper-rw/public/Univ/sicurezza/gpgpu_crypto_report/tools/opt/lib/e
ngines/libcudamrg.so
4096:error:0E07606D:configuration file routines:MODULE_RUN:module 
initialization error:conf_mod.c:235:module=engines, value=engine_section, 
retcode=-1      
error in enc

Daniele

Original comment by mUogoro on 2 Feb 2012 at 11:00

GoogleCodeExporter commented 9 years ago
First, it appear that there is an issue while using the openssl command line.
You could bypass this by using directly the openssl command (and adding the 
options that you need on the command line) like I do in usage example in the 
wiki (normally I use the engine in this manner).

Second, I think that your system environment isn't setup correctly, you may 
also consider a fresh install for your test (for example fedora 11 is a three 
years old distribution,  driver 190.53 should not be used with cuda 3.0, last 
but not least: gcc 3.4? I know that fedora 11 use gcc 4.4 that has problem with 
cuda 3.0 but this leaves me surprised).
Are you using the patched version of openssl?
Have you tried other cuda software on that system? They are working correctly?

And last, I think to known where are located the pc that you are using...you 
are writing from Politecnico di Torino, right? ;-)

Sicuro di non voler una consulenza sul posto? Se vuoi mi puoi contattare 
direttamente al mio indirizzo email, lo trovi all'interno dei sorgenti 
dell'engine.

Paolo Margara

Original comment by paolo.ma...@gmail.com on 2 Feb 2012 at 1:57