mersenneforum.org Faster GPU-ECM with CGBN
 Register FAQ Search Today's Posts Mark Forums Read

2023-01-22, 17:16   #155
Denial140

Dec 2021

22·11 Posts

My understanding was that the process for building it for GPU is the same, expect for additional parameters to the configure step. If this is wrong, then that may well explain it.

I managed to get fully through INSTALL-ecm when not trying to add GPU capability.

Quote:
 When I set the compiler to gcc (have tried gcc, gcc-10 and gcc-9 commands), the configure fails with "cuda.h present but cannot be compiled". I tried also to get gcc-8 as suggested in readme.gpu, but installing gcc-8 seems to uninstall the Nvidia toolkit (whether I use version 12.0 or 11.2 of the toolkit), and vice versa. If instead I set it to nvcc, I get a similar error for gmp.h. The only thing that gets past this stage is setting it to g++, which causes issues further down the line.
For this, it fails in the mentioned ways when running
Code:
./configure --enable-gpu --with-cgbn-include=../CGBN/include/cgbn CC="g++ -fpermissive" CFLAGS="-02 -pedantic -fomit-rame-pointer -m64 -mtune=skylake -march=broadwell"
, or when removing the --with-cgbn-include parameter and/or the CFLAGS.

Quote:
 The configure works fine with g++, but make gives several implicit type conversion errors (presumably as a result of treating main.c as C++? This was the impression I got from google.) Adding -fpermissive bypasses these, but gives a couple of errors about definitions crossing label jumps in cudawrapper.c. After adding some variable declarations to account for this, I get stuck with the following errors:
This, and the code block below it, happened when running make after the above configure.

 2023-01-22, 17:28 #156 paulunderwood     Sep 2002 Database er0rr 24·281 Posts What arguments do you give ./configure when compiling ECM and what arguments do you give it when compiling for GPU capability? (ps. surely CC="g++...." is plain wrong!) Last fiddled with by paulunderwood on 2023-01-22 at 17:42
 2023-01-22, 18:36 #157 Denial140   Dec 2021 22×11 Posts I have successfully compiled with GPU capability and CGBN - the important thing I was missing was the line "egrep -w '(CC|CFLAGS)' config.log" in INSTALL-ecm to get the compiler options used to compile GMP. My initial attempts at adding these failed, as I had unwittingly recompiled GMP with g++, which seems to leave certain things missing given the errors I was getting. The successful line in the end was Code: ./configure --enable-gpu --with-cgbn-include=../../gmp-ecm/CGBN/include/cgbn --with-cuda=/usr/local/cuda-12.0 CFLAGS="-O2 -pedantic -fomit-frame-pointer -m64 -mtune=skylake -march=broadwell" You may well be right that CC="g++ -fpermissive" is wrong - I must admit I have no idea what I'm doing, but it did reduce the type conversion errors to warnings. Last fiddled with by Denial140 on 2023-01-22 at 18:41

 Similar Threads Thread Thread Starter Forum Replies Last Post moytrage Software 50 2021-07-21 05:55 indomit Information & Answers 4 2020-10-07 10:50 paulunderwood Miscellaneous Math 13 2016-08-02 00:05 lidocorc Software 2 2008-11-08 09:26 clowns789 Miscellaneous Math 3 2004-05-27 23:39

All times are UTC. The time now is 13:21.

Wed Feb 8 13:21:49 UTC 2023 up 174 days, 10:50, 1 user, load averages: 1.48, 1.18, 1.14