The CUDA app |
Message boards : Number crunching : The CUDA app
Author | Message |
---|---|
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
thinking_goose Send message Joined: 12 Nov 07 Posts: 119 Credit: 2,750,621 RAC: 0 |
Awesome, I hope you get the green light. I can't wait to give it a shot! |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
cvnguyen Send message Joined: 4 Feb 10 Posts: 6 Credit: 0 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
DOH! But MS Visual doesn't work on Linux....;) Guess I'll just have to wait until the beta is tested..... Mike D |
cvnguyen Send message Joined: 4 Feb 10 Posts: 6 Credit: 0 RAC: 0 |
DOH! But MS Visual doesn't work on Linux....;) 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. |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
Sword Send message Joined: 18 Nov 09 Posts: 11 Credit: 1,052,256 RAC: 0 |
This is very interesting indeed.I am looking forward to propose some cribs for the prosject. |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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....;) 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 |
[AF>Libristes] Dudumomo Send message Joined: 15 Feb 09 Posts: 20 Credit: 196,260 RAC: 0 |
If you need any kind of help from us, let us know ! Seems to be very interesting ! |
cvnguyen Send message Joined: 4 Feb 10 Posts: 6 Credit: 0 RAC: 0 |
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. |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
Sailor Send message Joined: 21 Sep 07 Posts: 7 Credit: 616,761 RAC: 0 |
Will be there a version for ATi Cards? Probably not I guess. |
cvnguyen Send message Joined: 4 Feb 10 Posts: 6 Credit: 0 RAC: 0 |
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. |
Sailor Send message Joined: 21 Sep 07 Posts: 7 Credit: 616,761 RAC: 0 |
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. |
cvnguyen Send message Joined: 4 Feb 10 Posts: 6 Credit: 0 RAC: 0 |
In Collatz my ATi 4770 blows any 275 GTX straight out of the water =) 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. |
Sailor Send message Joined: 21 Sep 07 Posts: 7 Credit: 616,761 RAC: 0 |
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 ;) |
cvnguyen Send message Joined: 4 Feb 10 Posts: 6 Credit: 0 RAC: 0 |
These are just for the global memory. How about registers/local memory ("shared memory" in CUDA term)? |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
Message boards :
Number crunching :
The CUDA app