|
Message-ID: <aeb47f3ac841365482f4b11b42f727fe@smtp.hushmail.com> Date: Wed, 3 Jul 2013 12:41:48 +0200 From: magnum <john.magnum@...hmail.com> To: john-dev@...ts.openwall.com Subject: Re: Re: bug: GPU use in CPU-only formats On 3 Jul, 2013, at 3:16 , Claudio André <claudioandre.br@...il.com> wrote: > On 02-07-2013 22:01, Claudio André wrote: >>> > 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. > > As Jim showed us recently (on john-users), a listed device is not an available device. You have to create a context to get its real situation. > >> >> diff --git a/src/john.c b/src/john.c >> index ec79393..9187391 100644 >> --- a/src/john.c >> >> #ifdef HAVE_OPENCL >> if (any_opencl_device_exists()) { >> john_register_one(&fmt_opencl_NSLDAPS); > > As you can see above, JtR only register and list an OpenCL format if the user can use it (devices detected). If we do nothing during initialization, we can't do a check like this. Yes, bleeding currently does not even list opencl formats if you type just "./john" using an opencl build but on a platform with no valid devices. But this is actually a bit confusing, it may be better to still list them. I tried this yesterday: * drop the "if (any_opencl_device_exists())" quoted above [so we always register the opencl formats]. * also drop the init_opencl_devices() from john.c. * add that initialization to opencl_init_opt() [which is called by format's init] instead, but only at first invocation. * make clean_opencl_environment() safe to call without being initialized in the first place. For some reason, it didn't work but it's gotta be just a minor detail. The idea is that absolutely no OpenCL code is called until calling an opencl-format's init(). If we at that point find that the --device option is invalid, we'll bail out at that point. If that is after 10 seconds of loading millions of hashes, so be it. magnum
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.