Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 02 Jul 2013 22:01:15 -0300
From: Claudio André <claudioandre.br@...il.com>
To: john-dev@...ts.openwall.com
Subject: Re: bug: GPU use in CPU-only formats

> > Can't we do all initial "opening" of anything GPU-related in the
> > format's init(), if the format is GPU-enabled, and not any sooner?
> > 
> > Perhaps there's some implementation difficulty that I am missing.

It is possible, but if the user ask for -dev=7, i have to check if there
is such device, counting all available devices in each platform (this is
why we need to do more than only parse the command line). On unstable,
-device is always related to only one platform (no need to care about
other platforms). On bleeding, -device is a sequential number.

Seems to me this kind of check is always done at initialization. Is it
possible to give an error message and exit using the JtR way if this
check is moved to init()? 

> In unstable, it works like you say. In bleeding, iirc the support for selecting multiple devices got us into a series of catch 22's depending on situation. I can't remember all details but I recall it was trickier than expected. I'll try to re-read the code and some old mail and see how we came to this situation.
>
> We could start off with just doing what Claudio says and see if it solves the problem.

You can disable all OpenCL stuff and analyse the results (running non
GPU formats). Is it enough to fix the problem?

diff --git a/src/john.c b/src/john.c
index ec79393..9187391 100644
--- a/src/john.c
+++ b/src/john.c
@@ -362,7 +362,7 @@ static void john_register_all(void)
     john_register_one(&fmt_ssh);
     john_register_one(&fmt_wpapsk);
     john_register_one(&fmt_zip);
-
+/*
 #ifdef HAVE_OPENCL
     if (any_opencl_device_exists()) {
         john_register_one(&fmt_opencl_NSLDAPS);
@@ -408,6 +408,7 @@ static void john_register_all(void)
         john_register_one(&fmt_opencl_DES);
     }
 #endif
+*/
 
 #ifdef HAVE_CUDA
     john_register_one(&fmt_cuda_cryptmd5);
@@ -1067,10 +1068,10 @@ static void john_init(char *name, int argc, char
**argv)
         options.listconf)
         listconf_parse_late();
 
-#ifdef HAVE_OPENCL
-    if (any_opencl_device_exists())
-        init_opencl_devices();
-#endif
+//#ifdef HAVE_OPENCL
+//    if (any_opencl_device_exists())
+//        init_opencl_devices();
+//#endif
 
     common_init();
     sig_init();
@@ -1212,11 +1213,11 @@ static void john_done(void)
         fmt_done(database.format);
     }
     log_done();
-#ifdef HAVE_OPENCL
-    if (!(options.flags & FLG_FORK) || john_main_process)
-        //Release OpenCL stuff.
-        clean_opencl_environment();
-#endif
+//#ifdef HAVE_OPENCL
+//    if (!(options.flags & FLG_FORK) || john_main_process)
+//        //Release OpenCL stuff.
+//        clean_opencl_environment();
+//#endif
 
     path_done();
 

[ CONTENT OF TYPE text/html SKIPPED ]

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ