CUDALucas is a program implementing the Lucas-Lehmer primality test for Mersenne numbers using the Fast Fourier Transform implemented by nVidia's cuFFT library. You need a CUDA-capable nVidia card with compute compatibility >= 1.3.

Mersenne numbers are numbers of the form 2^p - 1; it is possible that some of these numbers are prime. For instance, 2^7-1 is prime, 2^127-1 is prime, and 2^43,112,609-1 is prime (and is also the largest known prime number in the world). For various reasons explained in the Wikipedia articles, throughout almost all known history, the largest known prime number has been a Mersenne prime.

Most CUDALucas' users that the developers are aware of use this program to help search for Mersenne primes in coordination with the Great Internet Mersenne Prime Search. It is one of the internet's first distributed computing projects, started in 1996, and since that year has found all of the largest known prime numbers. GIMPS searches for primes by doing some "trial factoring" to find a small factor of a Mersenne number; if that fails, then GIMPS performs the Lucas-Lehmer test to determine once and for all if a Mersenne number is prime. You can participate without needing to be aware of the mathematics involved; all you need to do is download and run the free program GIMPS provides called Prime95.

However, Prime95 is optimized for CPUs; in the last few years, volunteer developers from the GIMPS community have ported various parts of Prime95's functionality to GPUs. Shoichiro Yamada took a CPU-based Lucas-Lehmer testing program (written in generic C, as opposed to the x86-specific assembly of Prime95) and ported it to CUDA; this is now known as CUDALucas. Mr. Yamada remains the primary developer of the mathematics code; his username on MersenneForum.org is 'msft' (and I hope to add him as an admin of this SourceForge project as soon as possible). The other GPU programs are mfaktc, a program using CUDA GPUs to perform the "trial factoring" mentioned above, and mfakto which is a port of mfaktc to OpenCL, supporting AMD/ATI graphics cards. (mfakto's developer maintains a GitHub page for it; both programs are free-and-open-source software under the GPL. Source and executables for mfakto and mfaktc are available from here and here respectively.)

To participate in GIMPS yourself using CUDALucas (assuming you have the necessary CUDA hardware listed above), all you need to do is optionally create an account with GIMPS' server called PrimeNet (an account is necessary to keep track of your stats). Then you can go to PrimeNet's Manual Testing page, select a worktype with the word "test" in it, and use the information PrimeNet gives you to run CUDALucas. More details about how to do that last part are in the README file.

The program is run from the command line, however it can be configured without using a terminal. Take a look at "CUDALucas.ini".

You can get help from the CUDALucas thread on MersenneForum.org:

Alternately, you can report bugs or get help using SourceForge's bug tracker:


Project Admins:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks