Recent from talks
Contribute something
Nothing was collected or created yet.
Prime95
View on Wikipedia| Prime95 | |
|---|---|
Prime95 icon in its "on" state | |
| Developer | George Woltman |
| Initial release | 3 January 1996 |
| Stable release | 30.19 build 20[1]
/ June 2, 2024 |
| Preview release | 31.04 build 3[2]
/ January 4, 2026 |
| Written in | ASM, C |
| Operating system | Microsoft Windows, macOS, Linux, FreeBSD |
| Type | Mersenne prime finder / system stability tester |
| License | Freeware[3] |
| Website | mersenne |
Prime95, also distributed as the command-line utility mprime for FreeBSD, Linux, and MacOS is a freeware application written by George Woltman. It is the official client of the Great Internet Mersenne Prime Search (GIMPS), a volunteer computing project dedicated to searching for Mersenne primes. It is also used in overclocking to test for system stability.[4]
Although most[5] of its source code is available, Prime95 is not free and open-source software because its end-user license agreement[3] states that if the software is used to find a prime qualifying for a bounty offered by the Electronic Frontier Foundation,[6] then that bounty will be claimed and distributed by GIMPS.
Finding Mersenne primes by volunteer computing
[edit]Prime95 tests numbers for primality using the Fermat primality test (referred to internally as PRP, or "probable prime"). For much of its history, it used the Lucas–Lehmer primality test, but the availability of Lucas–Lehmer assignments was deprecated in April 2021[7] to increase search throughput. Specifically, to guard against faulty results, every Lucas–Lehmer test had to be performed twice in its entirety, while Fermat tests can be verified in a small fraction of their original run time using a proof generated during the test by Prime95. Current versions of Prime95 remain capable of Lucas–Lehmer testing for the purpose of double-checking existing Lucas–Lehmer results, and for fully verifying "probably prime" Fermat test results (which, unlike "prime" Lucas–Lehmer results, are not conclusive).
To reduce the number of full-length primality tests needed, Prime95 first checks numbers for trivial compositeness by attempting to find a small factor. As of 2024, test candidates are mainly filtered using Pollard's p − 1 algorithm. Trial division is implemented, but Prime95 is rarely used for that work in practice because it can be done much more efficiently using a GPU, due to the type of arithmetic involved. Finally, the elliptic-curve factorization method and Williams's p + 1 algorithm are implemented, but are considered not useful at modern GIMPS testing levels and mostly used in attempts to factor much smaller Mersenne numbers that have already undergone primality testing.
GIMPS has discovered 18 new Mersenne primes since its foundation in 1996, the first 17 of which using Prime95. The 18th and most recent, M136279841, was discovered in October 2024 using an Nvidia GPU, being the first GIMPS discovery to not have used Prime95 and its CPU computation.[8][9][10] 15 of the 17 primes discovered with Prime95 were the largest known prime number at the time of their respective discoveries, the exceptions being M37156667 and M42643801, which were discovered out of order from the larger M43112609.[11]
gwnum
[edit]gwnum is the code for most mathematical operations in Prime95. It is written in hand-tuned assembly code for a number of microarchitectures. For large number modular multiplication it implements the irrational base discrete weighted transform in double precision, exploiting the oversized (compared to integer operations) floating-point capacity of x86 CPUs. It also implements polynomial multiplication for use in P-1 and ECM Stage 2.
gwnum is also used by other distributed computing projects such as PrimeGrid's PRST.
Use for stress testing
[edit]
To maximize search throughput, most of Prime95's math library (gwnum) is written in hand-tuned assembly, which makes its system resource usage much greater than most other computer programs. Additionally, due to the high precision requirements of primality testing, the program is very sensitive to computation errors and proactively reports them. These factors make it a commonly used tool among overclockers to check the stability of a particular configuration.[4]
Prime95 has a built-in "torture test" (formerly "Self-Test") feature for this purpose. In this mode, it checks the results of stress testing against known-good results that comes with the program. As a result, any miscalculation is definitively spotted. The "small" and "medium" FFT modes have a memory access pattern that fits into the CPU's cache, making them ideal for placing maximal stress on the CPU cores. The "large" FFT mode needs to frequently access the RAM. As a result, it produces less stress on the CPU but is able to test the memory controller as well as the memory modules. There is also a "blend" mode that mixes these modes.[12]
See also
[edit]References
[edit]- ^ "GIMPS - Free Prime95 software downloads - PrimeNet". Archived from the original on 2023-02-03. Retrieved 2023-02-04.
- ^ "Gimps/V31/_pre-release/31.04 - download.mersenne.ca".
- ^ a b "GIMPS Legalese - PrimeNet". Great Internet Mersenne Prime Search. Archived from the original on 2019-04-27. Retrieved 2019-05-08.
- ^ a b "How To Run a CPU Stress Test Using Prime95". Appuals.com. 2015-12-10. Archived from the original on 2019-08-22. Retrieved 2019-05-23.
- ^ Woltman, George. "The security code or checksum is hard to forge. This is the only source code that is not published". Archived from the original on 2019-02-16. Retrieved 2019-06-09.
- ^ "EFF Cooperative Computing Awards". Electronic Frontier Foundation. 2008-02-29. Archived from the original on 2008-11-09. Retrieved 2019-05-08.
- ^ Woltman, George (2021-04-08). "First time LL is no more".
- ^ "GIMPS History - PrimeNet". Great Internet Mersenne Prime Search. Archived from the original on 2019-05-09. Retrieved 2019-05-09.
- ^ "GpuOwl - GitHub". GitHub. Archived from the original on 2025-08-26. Retrieved 2024-10-21.
- ^ "GIMPS Discovers Largest Known Prime Number:2136,279,841-1". Archived from the original on 2024-11-04. Retrieved 2024-10-21.
- ^ "GIMPS Milestones". www.mersenne.org. Archived from the original on 2021-10-13. Retrieved 2021-10-17.
- ^ stress.txt, Prime95 documentation, available online at https://www.mersenne.org/download/stress.txt Archived 2025-08-03 at the Wayback Machine
External links
[edit]- Official website
with downloads for various architectures - How to use Prime95 for stress (torture) testing[1]
- ^ "Torture test your CPU with Prime95". www.playtool.com. Archived from the original on 2011-11-10. Retrieved 2022-09-15.
Prime95
View on GrokipediaDevelopment and History
Origins and Creator
Prime95 was developed by George Woltman, a computer programmer and mathematician, who began work on the software in late 1995 with the primary goal of enabling efficient searches for Mersenne primes using volunteer computing resources.[6] Woltman's motivation stemmed from a desire to advance number theory by creating accessible tools that could harness the growing power of personal computers for distributed prime hunting, particularly targeting the form where is prime.[1] This initiative was closely tied to the founding of the Great Internet Mersenne Prime Search (GIMPS) project in January 1996, for which Prime95 served as the core client software.[1] The initial version of Prime95, 1.0, was released in 1996 as a Windows application, marking the program's debut as a freeware tool optimized for the era's consumer hardware.[7] Designed from the outset for large-scale prime testing, it emphasized volunteer participation by allowing users to contribute idle CPU cycles without requiring specialized equipment.[1] One of the key early challenges Woltman faced was optimizing the software for standard Intel i386 processors prevalent in mid-1990s personal computers, as there were no readily available specialized mathematical libraries for high-precision arithmetic.[1] To address this, he implemented hand-tuned assembly code for the computationally intensive operations, ensuring the program could perform effectively on everyday hardware while minimizing resource demands.[6] This approach laid the foundation for Prime95's reputation as a robust tool for mathematical computing in distributed environments.Release Timeline and Major Versions
Prime95 was initially released on January 3, 1996, as version 1.0, developed by George Woltman to facilitate the Great Internet Mersenne Prime Search (GIMPS).[3] Early development focused on optimizing Lucas-Lehmer primality testing, with version 2.0 in 1997 introducing multi-threading to better utilize multi-processor systems.[8] Version 27, released in December 2012 with build 27.9, shifted to 64-bit architecture, enabling higher memory addressing and improved efficiency on contemporary hardware.[9] In 2016, version 28 introduced probabilistic prime (PRP) testing, allowing quicker identification of likely primes and reducing the need for resource-intensive full proofs in initial screening.[10] Version 29, starting with builds in late 2017, incorporated numerous bug fixes, deprecated obsolete FFT implementations to modernize the codebase, and enhanced error-checking mechanisms for greater reliability. AVX-512 support was introduced in version 29.8 (late 2018), with further optimizations in the version 30 series, which began in early 2020 and significantly accelerated computations on compatible Intel CPUs.[10] The latest stable release is version 30.19 build 20 from June 2024, with source code build 21 released in September 2024. This version includes faster ECM stage 2 processing when ample memory is available and automatic merging of configuration files for easier management.[2] Although the core Prime95 executable remains closed-source under a custom end-user license agreement, source code for the Windows, Linux, and other ports is publicly available for non-commercial use, while certain utility tools like configuration scripts are released under the GNU General Public License (GPL).[11] These version milestones have been instrumental in Prime95's contributions to GIMPS, aiding discoveries such as the 51st known Mersenne prime in 2018 and the 52nd known Mersenne prime () on October 12, 2024.[5]Role in Mersenne Prime Search
Integration with GIMPS
The Great Internet Mersenne Prime Search (GIMPS) is a collaborative distributed computing project founded in 1996 by George Woltman to harness volunteer computing power in the search for Mersenne primes, which are prime numbers of the form where is itself a prime number.[1] Launched as one of the earliest large-scale volunteer efforts in computational number theory, GIMPS coordinates participants worldwide to test enormous candidate numbers for primality, contributing to advancements in understanding prime distribution and record-breaking discoveries.[1] Prime95 serves as the official and primary client software for GIMPS, enabling users to download specific work assignments—typically ranges of exponents to test—from the project's central PrimeNet server and to upload the resulting data automatically.[12] This integration allows Prime95 to function seamlessly within the GIMPS framework, where it performs the core computations on participants' personal computers, focusing on CPU-intensive tasks while minimizing manual intervention.[2] Communication between Prime95 and the PrimeNet server occurs via the HTTP protocol, facilitating automated coordination of tasks such as assigning new exponents, reporting test outcomes hourly, and scheduling double-checking of previous results to confirm primality claims with high reliability.[12] This server-client architecture ensures efficient distribution of workload and verification, preventing duplication and maintaining the integrity of the search.[12] By 2025, GIMPS has engaged thousands of volunteers globally, with Prime95 handling the majority of CPU-based computations that drive the project's progress in testing billions of candidates.[13] This scale underscores Prime95's pivotal role in enabling a decentralized yet coordinated effort that has sustained the hunt for Mersenne primes over nearly three decades.[1]Search Process and Assignments
Prime95 facilitates the search for Mersenne primes through various assignment types coordinated via the Great Internet Mersenne Prime Search (GIMPS) project. These include first-time tests on new exponents using probabilistic prime (PRP) methods to identify potential candidates, double-checks of prior Lucas-Lehmer (LL) test results to verify reported residues, and advanced PRP trials on promising exponents to confirm probable primality before full verification.[14][12] The operational workflow begins with Prime95 connecting to the PrimeNet server to download an assigned exponent based on user preferences for work type and computational capacity. Once downloaded, the software executes the appropriate test—such as an LL or PRP computation—on the Mersenne number 2^p - 1, where p is the exponent. Upon completion, Prime95 uploads the resulting residue or primality certificate back to PrimeNet, allowing the assignment to be marked as complete and enabling the next task to be queued. This cycle repeats for unproven exponents in ongoing ranges, with hourly progress reports ensuring seamless integration into the distributed search effort.[12][3] A notable contribution occurred in 2018 when volunteer Patrick Laroche used Prime95 on an Intel i5-4590T processor to discover the 51st known Mersenne prime, 2^82,589,933 - 1, comprising 24,862,048 digits, which took about 17 days of computation on his hardware. This finding underscored Prime95's role in advancing GIMPS discoveries, with the primality proof taking 12 days on his hardware and the result independently verified using three different programs on three different hardware configurations.[15] More recently, in October 2024, the 52nd known Mersenne prime, 2^{136279841} - 1, was discovered through GIMPS, though using GPU-based computation, underscoring Prime95's continued importance for CPU-intensive tasks.[16] To handle interruptions, Prime95 automatically saves progress every 30 minutes to intermediate files, such as those named pNNNNNNN or backup variants, enabling recovery from power failures, crashes, or user pauses. Upon restart, the program resumes from the last save point via the Test/Continue menu, minimizing lost work and ensuring reliable continuation of long-running assignments even after errors or system halts.[17]Stress Testing Capabilities
Purpose and Test Types
Prime95's primary purpose in stress testing is to simulate intensive computational loads on computer hardware, thereby identifying instabilities in components such as CPUs, RAM, and cooling systems. By leveraging the Fast Fourier Transform (FFT) algorithm originally developed for prime number searches, the program pushes systems to their limits, revealing issues like overheating, faulty memory, or inadequate power delivery that might not surface under normal usage. This makes it particularly valuable for validating hardware stability before or after modifications like overclocking.[17][18] The software offers several distinct test modes, each targeting different aspects of hardware performance. The Small FFTs mode focuses on stressing the CPU cores and onboard cache, using computations that fit entirely within the processor's cache to maximize heat generation and computational intensity without significant memory involvement. In contrast, the Large FFTs mode emphasizes memory bandwidth and the CPU-RAM interface by employing larger data sets that require frequent access to main system memory, making it ideal for detecting issues in high-capacity RAM configurations. The Blend mode combines elements of both, cycling through a range of FFT sizes to provide a balanced assessment of CPU, cache, and RAM under varied loads, and is often recommended as the default for comprehensive system diagnostics. Additionally, a Custom mode allows users to specify memory allocation limits for targeted testing.[17][19][18] Common usage scenarios include pre-overclocking validation to ensure safe operation at elevated speeds, troubleshooting system crashes or freezes during heavy workloads, and routine diagnostics on newly assembled or upgraded PCs. For optimal results, tests are typically run for extended periods, such as 24 hours or more, to catch intermittent faults. Output metrics primarily consist of error reports logged in a results.txt file, including rounding errors exceeding thresholds (e.g., "ROUND OFF > 0.40"), input-output sum mismatches (e.g., "SUMINP != SUMOUT"), or explicit "Torture Test failed" messages, which signal hardware instability requiring further investigation or correction. Successful completion without errors indicates robust system stability.[17][19]Configuration and Results Interpretation
To configure Prime95 for stress testing, users can launch the program and select "Just Stress Testing" from the initial menu, which skips prime search setup and focuses on the torture test. Within the torture test options, presets include Blend mode, which exercises both CPU and RAM using Fast Fourier Transform (FFT) sizes from 512K to 4M; Small FFTs, targeting CPU caches and floating-point units with smaller sizes like 8K to 64K; Large FFTs, emphasizing RAM with sizes up to 4096K or more; and Custom mode for manual FFT range selection. Alternatively, the command-line optionprime95.exe -t directly starts the torture test without the GUI. For modern CPUs, consider adjusting AVX support in the local.txt file (e.g., adding CpuSupportsAVX=0) to moderate stress intensity if excessive heat is an issue.[17][18][4]
Runtime parameters allow customization of test behavior, such as the number of worker threads, which Prime95 automatically sets to match the system's logical CPU cores but can be adjusted via the "Worker Threads" menu or by editing the local.txt file (e.g., setting NumCPUs=4 for fewer threads). Stopping conditions include manual interruption via the "Test > Stop" menu or ESC key, or automated halting upon detecting the first error. The test runs continuously by default, saving progress every 30 minutes to resume if interrupted.[17]
Interpreting results involves monitoring the worker windows for output messages; a test completing millions of iterations with "No errors" confirms system stability under load. Errors are flagged as fatal when computations deviate from expected values, such as "FATAL ERROR: Rounding was 0.5, expected less than 0.4," which typically indicates RAM timing or voltage issues, while "Hardware failure detected" or consistent mismatches at varying spots point to CPU instability, overheating, or power supply problems. Repeated errors in the same location may suggest a software issue, warranting a report to the developers.[20]
Best practices recommend running the torture test overnight or for 6-24 hours to uncover intermittent faults, starting with Blend mode for comprehensive coverage before isolating components. Combine Prime95 with dedicated RAM tools like MemTest86 for deeper analysis if rounding errors appear, and monitor temperatures using utilities such as HWMonitor to ensure they remain below the CPU's specified maximum safe temperature (typically 90-100°C, depending on the model; check manufacturer specifications). Always run at high priority (set via Task Manager) to maximize CPU utilization.[20][18]
