The CUDA app

Message boards : Number crunching : The CUDA app

To post messages, you must log in.

1 · 2 · 3 · Next

AuthorMessage
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1502 - Posted: 2 Feb 2010, 2:20:07 UTC
Last modified: 2 Feb 2010, 2:22:33 UTC

I've just wrote an email to the author of the Parallel bombe simulator http://www.cvnguyen.net/tech/enigma/ and asked for permission to use this app for distributed search.

The app is available as CPU (Windows and Linux), CPU Multithread (Linux only) and GPU (CUDA, theoretically Linux only but I'll do everything I can to port it to Windows).

I hope that the author will give me green light, running distributed bombe attack with multiple cribs would probably be a nice way to attack the remaining M3 and perhaps M4 messages.

The speed comparison table looks nice on the author's webpage - GF8800 runs at around 5x the speed of Phenom 9550 (all 4 cores used), so probably even the slowest cards are going to be usefull.
M4 Project homepage
M4 Project wiki
ID: 1502 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1504 - Posted: 3 Feb 2010, 1:27:32 UTC - in response to Message 1502.  

EXCELLENT! Now I have a GOOD reason to Overclock, and melt down my current video card so I can upgrade! ;-) Lemmie know when you're ready!

Mike D
ID: 1504 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
thinking_goose

Send message
Joined: 12 Nov 07
Posts: 119
Credit: 2,750,621
RAC: 0
Message 1505 - Posted: 3 Feb 2010, 3:49:34 UTC

Awesome, I hope you get the green light. I can't wait to give it a shot!
ID: 1505 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1506 - Posted: 4 Feb 2010, 13:32:00 UTC

Well, I have the permission to use the app if I'll publish the sources, which is not a problem.
Right now I'm tweaking the project to use app sources with MS Visual Studio 2008.
The app was designed to compile with Cygwin, but I think that it's not the best environment to build app with BOINC API included. That's why I'm switching.
The code looks very clean and after less than hour I've got most of the things sorted out, except for linker errors %-)

M4 Project homepage
M4 Project wiki
ID: 1506 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
cvnguyen

Send message
Joined: 4 Feb 10
Posts: 6
Credit: 0
RAC: 0
Message 1507 - Posted: 4 Feb 2010, 14:13:58 UTC

Hi TJM,

I'm very glad to see that my work can help your project.

Maybe you've misunderstood my email. If you simply integrate my code into your project and release them in binary, you won't have to release any source code. In this case, GPL will be applied only if you release my work in source code. Anyhow, if you decide to release source code, it will be a good opportunity for me to learn new things.

Handling cribs would be a hard job. I failed to find a good way to automate the task sweeping and evaluating crib-and-position possibilities. In WWII, Bletchley Park's staffs did this by paper and pencil. AFAIK, nobody has announced any algorithm to deal with this job. It will be nice if you are the first.

Cheers,

CVN
ID: 1507 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1508 - Posted: 5 Feb 2010, 0:00:46 UTC

DOH! But MS Visual doesn't work on Linux....;)

Guess I'll just have to wait until the beta is tested.....

Mike D
ID: 1508 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
cvnguyen

Send message
Joined: 4 Feb 10
Posts: 6
Credit: 0
RAC: 0
Message 1509 - Posted: 5 Feb 2010, 5:47:56 UTC - in response to Message 1508.  

DOH! But MS Visual doesn't work on Linux....;)

Guess I'll just have to wait until the beta is tested.....

Mike D


Well, almost all CUDA programmers have faced this problem. In Windows, the program kernels (running on GPU) had to be compiled/linked codes using MS Visual C, at least the command-line version ("free" version). Thus, to design a multi-OS project with CUDA, they need different compiling scripts for Win and Linux.
ID: 1509 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1510 - Posted: 6 Feb 2010, 0:34:04 UTC - in response to Message 1509.  
Last modified: 6 Feb 2010, 0:38:21 UTC

Well, Bletchley Park surely didn't have all the computing power we have here.

I'm aiming for half automated system.

First step - a page where anyone will be able to submit a crib. It will be passed to a script which will then apply it to all unbroken ciphertexts available in the database (and all future ones) at all possible positions and create bombe menus.
This step will produce certain amount of workunits, they'll be passed to another script, which will put everything together as a BOINC-workunits and insert it into the BOINC db.
The received result will be passed through enigma simulator and then a scoring system, probably something similar to the bigram/trigram scoring that Stefan's app uses. This step will produce a table (sorted by score) of result for each combination of ciphertext and crib.
I think that the number of results for each crib will be low enough to check it manually for possible decrypts. This can be easily verified by taking average length crib and applying it at all possible position; while a max theoretical possible # of results should be around (n/m)*(n-m) where n is ciphertext and m is crib length (if I'm not wrong).
M4 Project homepage
M4 Project wiki
ID: 1510 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Sword

Send message
Joined: 18 Nov 09
Posts: 11
Credit: 1,052,256
RAC: 0
Message 1511 - Posted: 6 Feb 2010, 11:52:33 UTC - in response to Message 1510.  

This is very interesting indeed.I am looking forward to propose some cribs for the prosject.
ID: 1511 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1517 - Posted: 15 Feb 2010, 1:17:14 UTC
Last modified: 15 Feb 2010, 8:03:23 UTC

There's a small incompatibility with Microsoft Visual Studio 2008; (almost) everything works except these 2 marked lines:

[...]
#ifndef PATTERN_USED
    for (i = 0; i < NUM_LETTERS; i++)
    {
        k = 0;
        point_t *p1 = &points[i][0];
        for (j = 0; j < NUM_LETTERS; j++)
            if (p1[j])
[...]


point_t *p1 = &points[i][0]; causes error C2275 and then there are more errors caused by 'undeclared identifier' (p1).

1>..\..\..\..\..\Pulpit\parallel_enigma_bombe_1.5\parallel_enigma_bombe_1.5\turing.c(390) : error C2275: 'point_t' : illegal use of this type as an expression
1>        c:\documents and settings\tjm\pulpit\parallel_enigma_bombe_1.5\parallel_enigma_bombe_1.5\core.h(65) : see declaration of 'point_t'
1>..\..\..\..\..\Pulpit\parallel_enigma_bombe_1.5\parallel_enigma_bombe_1.5\turing.c(390) : error C2065: 'p1' : undeclared identifier
1>..\..\..\..\..\Pulpit\parallel_enigma_bombe_1.5\parallel_enigma_bombe_1.5\turing.c(392) : error C2065: 'p1' : undeclared identifier
1>..\..\..\..\..\Pulpit\parallel_enigma_bombe_1.5\parallel_enigma_bombe_1.5\turing.c(392) : error C2109: subscript requires array or pointer type

This is the only place where p1 is used, so it should be easy to fix. Any ideas how to do that without breaking compatibility with Linux ?



DOH! But MS Visual doesn't work on Linux....;)

Guess I'll just have to wait until the beta is tested.....

Mike D


Actually, I think that the app works on Linux without changing anything.
At least the CPU version.
Compiling it with BOINC API might be a lot more difficult, I'll work on that as soon as I finish the Windows version.
For the CPU app there's a workaround - it's relatively easy to use the wrapper. However, I have no idea if the wrapper could also be used to run GPU app, that's why I'm aiming for BOINC API first.
M4 Project homepage
M4 Project wiki
ID: 1517 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile [AF>Libristes] Dudumomo

Send message
Joined: 15 Feb 09
Posts: 20
Credit: 196,260
RAC: 0
Message 1519 - Posted: 16 Feb 2010, 12:43:07 UTC - in response to Message 1517.  

If you need any kind of help from us, let us know !
Seems to be very interesting !
ID: 1519 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
cvnguyen

Send message
Joined: 4 Feb 10
Posts: 6
Credit: 0
RAC: 0
Message 1521 - Posted: 17 Feb 2010, 12:48:48 UTC - in response to Message 1517.  



point_t *p1 = &points[i][0]; causes error C2275 and then there are more errors caused by 'undeclared identifier' (p1).


Well, MS Visual C seems to reject declaring variables in the middle of functions by default. I am not sure if there are compiler switches/options to overcome this weird behavior.

In Windows, I still compile the CPU app with GCC (via Cygwin), so here comes the problem. But that would not happen with the GPU app.
ID: 1521 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1522 - Posted: 18 Feb 2010, 14:29:06 UTC

With minor changes, I've got the basic (standalone) version compiled under MS VS 2008. That's a big step ahead, because it's much easier to build the entire BOINC API with Visual Studio than any other compiler environment that I know.



M4 Project homepage
M4 Project wiki
ID: 1522 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Sailor

Send message
Joined: 21 Sep 07
Posts: 7
Credit: 616,761
RAC: 0
Message 1523 - Posted: 19 Feb 2010, 8:29:28 UTC

Will be there a version for ATi Cards? Probably not I guess.
ID: 1523 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
cvnguyen

Send message
Joined: 4 Feb 10
Posts: 6
Credit: 0
RAC: 0
Message 1524 - Posted: 19 Feb 2010, 11:00:54 UTC - in response to Message 1523.  

Will be there a version for ATi Cards? Probably not I guess.


I'll rewrite the simulation using OpenCL if I have spare time. However, ATi cards would not have MIPS/dollar performance as good as that of NVIDIA products. I do not have an ATi card anyway, so it will take much consideration to give this a try.
ID: 1524 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Sailor

Send message
Joined: 21 Sep 07
Posts: 7
Credit: 616,761
RAC: 0
Message 1525 - Posted: 19 Feb 2010, 19:34:40 UTC

In Collatz my ATi 4770 blows any 275 GTX straight out of the water =)
Not using OpenCL but ATi CAL vs CUDA there.

Anyway im avaiable for testing any ATi application, can offer 4770/3450/Mob 3400/3300 onboard and 99% sure 5770 aswell soo. Just give me a shout.
ID: 1525 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
cvnguyen

Send message
Joined: 4 Feb 10
Posts: 6
Credit: 0
RAC: 0
Message 1526 - Posted: 20 Feb 2010, 3:23:12 UTC - in response to Message 1525.  

In Collatz my ATi 4770 blows any 275 GTX straight out of the water =)
Not using OpenCL but ATi CAL vs CUDA there.


That does not mean your ATi always outperforms 275GTX in any algorithm.

AFAIK, an ATi card has more CUs*clocks than a NVIDIA card at the same price does. However, its local memory bandwidth is much slower than NVIDIA's. That bottle-neck seems to let NVIDIA cards win in most general-purpose algorithms. My Turing bombe simulation requires many inter-CU data exchanges and does not have high data-parallelism, so I hardly think that it will be faster on an ATi.
ID: 1526 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Sailor

Send message
Joined: 21 Sep 07
Posts: 7
Credit: 616,761
RAC: 0
Message 1527 - Posted: 20 Feb 2010, 8:04:18 UTC

I know that it depends on the application and what part of the card it stress most, thats why I was naming Collatz, which doesnt need much memory access.

And dont jump too fast to conclusions, the 128 bit GDDR5 bus of the 4770 and other midrange ATis has about the same bandwidth as the 256bit GDDR3 used by nVidia midrange - or 256 bit GDDR5 on the higher Series vs 448bit GDDR3 on the GTX 260/275 ;)
ID: 1527 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
cvnguyen

Send message
Joined: 4 Feb 10
Posts: 6
Credit: 0
RAC: 0
Message 1528 - Posted: 20 Feb 2010, 8:55:57 UTC - in response to Message 1527.  


And dont jump too fast to conclusions, the 128 bit GDDR5 bus of the 4770 and other midrange ATis has about the same bandwidth as the 256bit GDDR3 used by nVidia midrange - or 256 bit GDDR5 on the higher Series vs 448bit GDDR3 on the GTX 260/275 ;)


These are just for the global memory. How about registers/local memory ("shared memory" in CUDA term)?
ID: 1528 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1530 - Posted: 27 Feb 2010, 20:59:00 UTC
Last modified: 27 Feb 2010, 21:07:13 UTC

I have serious troubles compiling the latest BOINC API.
Everything worked fine until I reinstalled Visual Studio - I had to switch from 2005 to 2008 for other reasons.
I used to build my own core client/managers without any problems. Right now 6.5.0 is the highest version that works for me, everything higher results in so many errors and warnings that I have no idea where should I start looking for the solution.
I'll try a fresh install tomorrow, perhaps one of the many installed library/headers packs is incompatible with VS2008 or broken, or I messed with configuration too much while trying to build some CUDA test apps.


EDIT: I got the bugfix via email, thanks. I'll include it in the CUDA code, but first I have to fix the API problem. This is going to be my first app including BOINC API, so I'm starting with (almost) zero experience here - the other app uses wrapper, it was easier to run it that way.

Btw, if anyone wants to take a look at the complete Visual Studio 2008 project - I've placed it in my shared Dropbox folder (always the latest copy), I'll include a full project tree with the API and all libraries as soon as I'll get it working.
M4 Project homepage
M4 Project wiki
ID: 1530 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
1 · 2 · 3 · Next

Message boards : Number crunching : The CUDA app




Copyright © 2024 TJM