Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <af0602f369ab1585abf56ceb12ecae39@smtp.hushmail.com>
Date: Mon, 4 Feb 2013 21:46:02 +0100
From: magnum <john.magnum@...hmail.com>
To: "john-dev@...ts.openwall.com" <john-dev@...ts.openwall.com>
Subject: Re: OpenCL problems (was: off-list)

[I felt I should cc the list, this might be of interest to someone. This is about the bleeding-jumbo tree.]

How about returning the number of devices? Then we could do this *inside* john_register_all():

#ifdef HAVE_OPENCL
    if (init_opencl_devices()) {
	john_register_one(some opencl format);
	john_register_one(other opencl format);
	...
    }
#endif

Maybe you meant something like that. I think this might be a really good idea. We just need to take care that --list=opencl-devices still give a proper and descriptive error. I think it already does.

Hopefully the same can be done to CUDA.

BTW I learned that Milen's Hashkill doesn't link against OpenCL at all. Instead, he loads the library if available. So he can distribute the same one binary to all users, OpenCL or not.

magnum


On 4 Feb, 2013, at 21:11 , Claudio André <claudioandre.br@...il.com> wrote:

> Or better (if possible) we can put this:
> #ifdef HAVE_OPENCL
>    init_opencl_devices();
> #endif
> 
> Before any call to:
> - john_register_all()
> 
> There are some john internals that prevent this?
> 
> 
> Em 04-02-2013 17:16, magnum escreveu:
>> We still have problems with running a bleeding OpenCL build on a host without *any* working OpenCL device or platform.
>> 
>> $ ../run/john -t -form:mschapv2
>> Invalid OpenCL device id 0
>> 
>> There's no hurry at all but we should fix this. This hack make it work (but is not a complete solution):
>> 
>> --- a/src/common-opencl.c
>> +++ b/src/common-opencl.c
>> @@ -265,7 +265,7 @@ static void add_device_to_list(int sequential_id)
>> 
>>         if (sequential_id >= get_number_of_available_devices()) {
>>                 fprintf(stderr, "Invalid OpenCL device id %d\n", sequential_id);
>> -               exit(EXIT_FAILURE);
>> +               return;
>>         }
>> 
>>         for (i = 0; i < get_devices_being_used() && !found; i++) {
>> @@ -417,7 +417,7 @@ void init_opencl_devices(void)
>> 
>>         if (get_devices_being_used() == 0) {
>>                 fprintf(stderr, "No OpenCL devices found\n");
>> -               exit(1);
>> +               //exit(1);
>>         }
>>         ocl_gpu_id = ocl_device_list[0];
>>         platform_id = get_platform_id(ocl_gpu_id);
>> 
>> 
>> This gives unwanted errors (that should only be seen if you try to use an OpenCL format) but works fine when running a non-OpenCL format.
>> 
>> You can emulate this situation by temporarily renaming /etc/OpenCL/vendors to /etc/OpenCL/vendors_disabled (or whatever). Now you don't "have" any devices or platforms at all. You should still be able to run any non-GPU format with a GPU build. The reason I care about this is it's important for VCL and other clusters.
>> 
>> I'm not sure how to best fix this.
>> 
>> 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.