View Single Post
Old 2021-08-25, 18:24   #8
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

70418 Posts
Default

I got CGBN set up and configured your code with the proper cgbn include path.

Needed to make the following changes to get it to compile:

Code:
Lines 510 and 587, replace 100'000'000 with 1000000000

Around line 640:
//const std::vector<uint32_t> available_kernels = { 512, 1024 };
  uint32_t available_kernels[2] = { 512, 1024 };
  uint32_t num_available_kernels = 2;

and then in the following loop:
//for (kernel_bits : available_kernels) {
  for (i=0; i<num_available_kernels; i++) {
    kernel_bits = available_kernels[i];
Running with -gpu -cgbn gives me an error:

Code:
echo "((2^499-1)/20959)" | ./ecm -gpu -cgbn -sigma 3:1000 20000 0
GMP-ECM 7.0.5-dev [configured with GMP 6.2.0, --enable-asm-redc, --enable-gpu, --enable-assert] [ECM]
Input number is ((2^499-1)/20959) (146 digits)
Using B1=20000, B2=0, sigma=3:1000-3:6119 (5120 curves)
CUDA error occurred: cannot set while device is active in this process
While running cudaSetDeviceFlags (cudaDeviceScheduleBlockingSync)   (file cgbn_stage1.cu, line 591)
Running with -gpu still works fine.

[edit]
Just commenting out line 591 makes it work. cpu usage does go up during gpu execution though.

Note the factor of 10 increase in B1 compared to before. Speedup is about 8x! Awesome!

Code:
% echo "((2^499-1)/20959)" | ./ecm -gpu -cgbn -sigma 3:1000 200000 0
GMP-ECM 7.0.5-dev [configured with GMP 6.2.0, --enable-asm-redc, --enable-gpu, --enable-assert] [ECM]
Input number is ((2^499-1)/20959) (146 digits)
Using B1=200000, B2=0, sigma=3:1000-3:6119 (5120 curves)
Computing 5120 Step 1 took 3587ms of CPU time / 6088ms of GPU time

Last fiddled with by bsquared on 2021-08-25 at 18:30 Reason: new results
bsquared is offline   Reply With Quote