Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Dec 2012 20:39:09 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Opencl build from binary

On 18 Dec, 2012, at 15:39 , Claudio André <claudioandre.br@...il.com> wrote:
> 2012/7/5 SAYANTAN DATTA <std2048@...il.com>:
>> I want to make a patch for JtR for building opencl programs from binaries.
>> So should I make  a seperate file or should I modify the common-opencl.c ?
>> If I am given the permission to modify the common-opencl.c, I will ensure
>> that it doesn't create any problems for the current build.

Is the intention to "cache" compiled kernels for later runs? Nvidida's drivers already do this, but not AMD from what I can tell.

> Hi, i created a new patch using this. Unfortunately, i had to change common-opencl a little. Please check if the change is acceptable.
> - it doesn't impact or hurt legacy code.
> - if anyone want to use it, only code inside the format xxx_fmt.c file has to be created.
> - everything seems fine, but more tests are needed. Specially on different platforms (i mean OSX).

I just tried applying it and built under OSX with no problems, I see no problems with committing it.

> Patch attached (also at: https://github.com/claudioandre/magnum-jumbo/commit/20051ce33d52ff8c40777c86567f441cb24484ee).

From a quick look at opencl_cryptsha512_fmt.c in your repo, I wonder why you didn't make more of it shared? The format could just call opencl_build_kernel() and the common code could use the binary if available, transparent to the format. However, I guess we need some kind of version-control. Or is there already? I didn't look very closely. It could be like

if (no binary) OR (timestamp of source is newer than timestamp of binary)
	build [and write/overwrite binary]
else
	use binary

Or is that too simple? I can't think of any problems with that.

> BTW: should we move the .cl files to a new folder, e,g. "../run/kernels" and save binary files there? We have dozens of OpenCL files now.

I had that idea too but then we'd need to ensure that system-wide builds doesn't break. And I'm too lazy to test that :-)

magnum

Powered by blists - more mailing lists

Your e-mail address:

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