Quick start
Run Gaussian-Mersenne tests with PrMers
PrMers uses OpenCL GPUs for shared GM/GQ trial factoring and Gaussian-Mersenne P-1, ECM, PRP, and deterministic Proth testing. GMRelay obtains GMNet assignments and submits schema-v2 JSON results with an explicit GM, GQ, or GM+GQ target.
Concept
What PrMers tests
For a prime exponent p, GMNet studies the rational norm G_p = 2^p - (2/p)·2^((p+1)/2) + 1. PrMers performs the long GPU arithmetic through an exact lift into the existing 2^(4p)-1 arithmetic engine.
- P-1 searches for a factor whose
q-1is sufficiently smooth. - ECM searches for factors using smooth elliptic-curve group orders.
- PRP is a probable-prime test. A positive PRP result is not yet a proof.
- Proth is the deterministic primality test used here. A successful Proth result proves that the norm is prime, subject to correct computation and independent verification.
4p, not p. Start with small factoring bounds when checking a new installation.Installation
Binary releases or source
Binary releases
Open the PrMers Releases page and choose the archive for Windows, macOS, or Linux. Select a release whose notes mention Gaussian-Mersenne support, then verify the accompanying checksum.
# Linux
sha256sum -c DOWNLOADED_FILE.sha256
# macOS
shasum -a 256 -c DOWNLOADED_FILE.sha256
# Windows PowerShell
Get-FileHash .\DOWNLOADED_FILE -Algorithm SHA256After extraction, verify that the binary exposes the Gaussian modes:
# Linux or macOS
./prmers -h 2>&1 | grep -E 'gm-proth|gm-prp|gm-pm1|gm-ecm'
# Windows PowerShell
.\prmers.exe -h | Select-String 'gm-proth|gm-prp|gm-pm1|gm-ecm'macOS source build
xcode-select --install
brew install git gmp
git clone https://github.com/cherubrock-seb/PrMers.git
cd PrMers
make clean
make -j"$(sysctl -n hw.ncpu)" KERNEL_PATH=./kernels/
./prmers -hOn Apple Silicon, use the packaged release when available. It includes the expected libraries and is the simplest path.
Windows source build with Visual Studio and vcpkg
git clone https://github.com/cherubrock-seb/PrMers.git
cd PrMers
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
cmake -S . -B build `
-DCMAKE_TOOLCHAIN_FILE=.\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseCopy the required DLL files from vcpkg\installed\x64-windows\bin next to prmers.exe, or add that directory to PATH.
Recommended Linux path
Ubuntu build from current GitHub source
sudo apt update
sudo apt install -y git build-essential g++ make cmake python3 \
ocl-icd-opencl-dev opencl-headers libgmp-dev clinfo
cd "$HOME"
rm -rf PrMers-gmnet-test
git clone --recurse-submodules \
https://github.com/cherubrock-seb/PrMers.git \
PrMers-gmnet-test
cd PrMers-gmnet-test
chmod +x scripts/build_gaussian_mersenne_ubuntu.sh
JOBS="$(nproc)" ./scripts/build_gaussian_mersenne_ubuntu.shThe build script runs the Gaussian source tests, builds the embedded Aevum engine, builds PrMers, and verifies that the Gaussian CLI is present.
clinfo -l
./prmers -h 2>&1 | grep -E 'gm-proth|gm-prp|gm-pm1|gm-ecm'nvidia-smi works before compiling. Change -d 0 to the device index shown by your system.Commands
P-1, ECM, PRP, and Proth
P-1 Stage 1 and Stage 2
./prmers P -gm-pm1 -b1 B1 -b2 B2 -aevum -d DEVICE \
-gm-sieve 0 -f ./gm-results/P-pm1ECM campaign
./prmers P -gm-ecm -b1 B1 -b2 B2 -K CURVES -aevum -d DEVICE \
-gm-sieve 0 -f ./gm-results/P-ecmProbable-prime screening
./prmers P -gm-prp -gm-base 3 -aevum -d DEVICE \
-gm-sieve 0 -f ./gm-results/P-prpDeterministic Proth proof
./prmers P -gm-proth -gm-safe -aevum -d DEVICE \
-gm-sieve 0 -f ./gm-results/P-prothA positive PRP candidate should be followed by a deterministic Proth test, a second run on another contributor or device, and independent validation for a major discovery.
Ubuntu integration test
Small factoring passes above the current record exponent
The largest listed Gaussian-Mersenne prime exponent is 15317227. The prime exponent 15317251 is above it and is suitable for an installation smoke test. These bounds are deliberately small, so finding a factor is unlikely. The goal is to exercise P-1, Stage 2, ECM, checkpoints, Aevum, and JSON output.
cd "$HOME/PrMers-gmnet-test"
DEVICE=0
P=15317251
mkdir -p "./gm-smoke/p${P}/pm1" "./gm-smoke/p${P}/ecm"
./prmers "$P" -gm-pm1 -b1 5000 -b2 100000 \
-gm-base 3 -gm-sieve 0 -gm-factor-chunk-bits 262144 \
-aevum -d "$DEVICE" -t 300 -f "./gm-smoke/p${P}/pm1" \
2>&1 | tee "./gm-smoke/p${P}/pm1.log"
./prmers "$P" -gm-ecm -b1 2000 -b2 50000 -K 2 \
-seed 20260728 -gm-sieve 0 -gm-factor-chunk-bits 131072 \
-aevum -d "$DEVICE" -t 300 -f "./gm-smoke/p${P}/ecm" \
2>&1 | tee "./gm-smoke/p${P}/ecm.log"Use DEVICE=1 when the RTX GPU is OpenCL device 1 on your machine.
Automatic coordination
How GMNet chooses the next assignment
GMNet does not store every possible prime exponent in advance. The search space is generated lazily from a persistent frontier, beginning above the largest listed record exponent. When the available queue drops below its configured watermark, the server finds the next prime exponents and creates a shared GM/GQ GPU TF assignment before the P-1 tiers.
- GPU TF: shared GM/GQ classification over q bits 40–52.
- P-1 tier 1: B1=5,000 and B2=100,000, with the specialized sieve to 10^12.
- P-1 tier 2: B1=25,000 and B2=500,000.
- P-1 tier 3: B1=100,000 and B2=2,000,000.
- P-1 tier 4: B1=500,000 and B2=10,000,000.
- ECM tiers: progressively larger B1/B2 bounds and 2, 5, 10, then 20 distinct deterministic curves.
- PRP: two independent contributors test both surviving family targets.
- Final test: GM receives deterministic Proth; GQ is recorded honestly as a Fermat PRP.
Each verified factor stops later work for its own family. A BOTH exponent is fully eliminated once GM and GQ are both factorized; GM-only campaigns may stop as soon as GM is factorized. A completed no-factor result creates only the next tier, so the network never assigns deeper work before the prerequisite coverage exists. Manual administrator imports remain available and their explicit priority can override scheduler work.
Public scheduler status
curl --fail \
https://gmnet.gaussianmersenne.workers.dev/api/scheduler/status \
| python3 -m json.toolAdministrator configuration
export GMNET_ADMIN_KEY="$(tr -d '\r\n' < ~/.config/gmnet/admin-key)"
python3 scripts/gmnet-admin.py scheduler-configure \
--url https://gmnet.gaussianmersenne.workers.dev \
--enable --frontier 15317227 \
--high-watermark 40 --batch-size 20
unset GMNET_ADMIN_KEYQueues
Create and run worktodo files
GMTF=p,from_bits,to_bits[,GM|GQ|BOTH[,chunk_candidates[,sieve_prime]]]
GMPROTH=p[,sieve_limit[,GM|GQ|BOTH]]
GMPRP=p[,sieve_limit[,GM|GQ|BOTH]]
GMPMINUS1=p,B1,B2[,base[,sieve_limit[,chunk_bits[,GM|GQ|BOTH]]]]
GMECM=p,B1,B2,curves[,sigma[,sieve_limit[,chunk_bits[,GM|GQ|BOTH]]]]
GMCHAIN=p,pm1_B1,pm1_B2[,ecm_B1[,ecm_B2[,curves[,sieve_limit[,chunk_bits[,finish[,GM|GQ|BOTH]]]]]]]Backend policy: TF is a direct OpenCL integer kernel. P-1, ECM, PRP and GM Proth use the existing workload-aware Aevum/Marin engine policy. In BOTH mode, non-TF arithmetic currently runs GM then GQ sequentially.
Create one P-1 and one ECM line with the bundled Python generator
mkdir -p ./gm-smoke
python3 scripts/generate_gaussian_worktodo.py \
--start 15317227 --count 1 \
--output ./gm-smoke/worktodo.txt --mode pm1 \
--pm1-b1 5000 --pm1-b2 100000 --base 3 \
--sieve 0 --chunk-bits 262144
python3 scripts/generate_gaussian_worktodo.py \
--start 15317227 --count 1 \
--output ./gm-smoke/worktodo.txt --append --mode ecm \
--ecm-b1 2000 --ecm-b2 50000 --curves 2 --sigma 0 \
--sieve 0 --chunk-bits 131072
cat ./gm-smoke/worktodo.txt
./prmers -worktodo ./gm-smoke/worktodo.txt -aevum -d 0 \
-f ./gm-smoke/worktodo-resultsThe generator treats --start as a strict lower bound and writes only prime exponents.
GMNet integration
Use GMRelay with one nickname
The normal setup no longer asks for the GMNet address or an API key. GMRelay contacts the official server, completes a short proof-of-work registration, creates the contributor profile, stores the generated key with private file permissions, and starts the assignment loop.
cd "$HOME/PrMers-gmnet-test"
curl --fail --remote-name \
https://gmnet.gaussianmersenne.workers.dev/downloads/gmrelay.py
curl --fail --remote-name \
https://gmnet.gaussianmersenne.workers.dev/downloads/gmrelay.py.sha256
sha256sum -c gmrelay.py.sha256
chmod +x gmrelay.py
python3 gmrelay.py --start YOUR_NICKNAMEgm_*_result.json and gq_*_result.json files, and submits them automatically. The generated API key is not displayed in normal operation.Run PrMers in another terminal
./prmers -worktodo ./worktodo.txt -aevum -d 0 \
-f ./gmnet-resultsOther useful commands
# Register only, without starting the continuous loop
python3 gmrelay.py --join YOUR_NICKNAME
# Existing installation
python3 gmrelay.py --loop
# One synchronization and exit
python3 gmrelay.py --once
# Advanced interactive setup
python3 gmrelay.py --setupThe CLI registration challenge is bound to the requesting network, expires after five minutes, is single-use, rate-limited, and requires a small SHA-256 proof-of-work. GMRelay never executes downloaded programs.
Targeted assignments
Request standard, deep Stage 1, or mixed work
GMRelay can request one exact prime exponent or keep a large exponent range filled automatically. GMNet selects only prime exponents, skips known factored cases, and does not duplicate an identical completed campaign.
Shared GM/GQ GPU trial factoring
One modular exponentiation classifies candidates against both Gaussian families. The default GMNet profile records GQ discoveries for free while keeping GM elimination as the main search goal.
python3 gmrelay.py --campaign tf \
--range 15317251 16000000 \
--tf-from-bits 40 --tf-to-bits 52 \
--target-family BOTH --loopThe native worktodo line is GMTF=p,40,52,BOTH,4194304,65536.
Deep P-1 Stage 1 only
This profile uses a larger P-1 B1 and sets B2 equal to B1. PrMers performs the Stage 1 exponentiation and final GCD, writes a normal JSON result, and does not enter Stage 2.
# One batch of up to four assignments below the largest listed exponent
python3 gmrelay.py --request p1s1 \
--range 10000019 15317226 \
--b1 250000 --count 4
# Keep the same range full continuously
python3 gmrelay.py --campaign pm1-stage1 \
--range 10000019 15317226 \
--b1 250000 --loopMixed P-1 Stage 2 plus ECM, then stop
The mixed profile creates a native GMCHAIN assignment. PrMers runs P-1 through B2 and, only when no factor is found, continues with the requested ECM curves, then stops without running PRP or Proth.
python3 gmrelay.py --campaign mixed \
--range 15317251 16000000 \
--b1 100000 --b2 2000000 \
--ecm-b1 5000 --ecm-b2 250000 --curves 5 \
--loopOther explicit requests
python3 gmrelay.py --request p1 --exponent 15317251 --target-family BOTH
python3 gmrelay.py --request ecm --range 15317251 15400000 --count 4 --target-family BOTH
python3 gmrelay.py --request prp --exponent 15317251 --target-family BOTH
python3 gmrelay.py --request exact --exponent 15317251 --target-family BOTHThe aliases p1s1, pm1s1, p1-stage1, and stage1 select the deep Stage-1-only profile. The aliases mixed and chain select the mixed profile.
Output
Result files and manual submission
PrMers writes one combined gm_tf_p<P>_..._result.json for TF, plus separate gm_* and gq_* JSON files for P-1, ECM, PRP and the final test. GMRelay submits them automatically. You can also upload one JSON result or a batch of up to 50 results on the GMNet home page.
References