mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GMP-ECM (https://www.mersenneforum.org/forumdisplay.php?f=55)
-   -   ECM for CUDA GPUs in latest GMP-ECM ? (https://www.mersenneforum.org/showthread.php?t=16480)

fivemack 2014-01-18 16:51

Try looking for package nvidia-cuda-dev

I certainly have that installed on 13.10 on the machine that's currently running gpu-ecm; packages.ubuntu.com suggests it exists on 13.04

chris2be8 2014-01-19 17:41

I've installed packages nvidia-cuda-dev and cuda and all their pre-requisites and rebooted, but it still won't work because the nvidia driver module isn't loaded:
[code] chris@4core ~/ecm-gpu/trunk $ ./test.gpuecm ./ecm
GMP-ECM 7.0-dev [configured with GMP 5.1.3, --enable-asm-redc, --enable-gpu, --enable-assert] [ECM]
Input number is 458903930815802071188998938170281707063809443792768383215233 (60 digits)
FATAL: Module nvidia not found.
GPU: Error: no active device.
GPU: Error msg: no CUDA-capable device is detected
Segmentation fault
############### ERROR ###############
Expected return code 14 but got 139

chris@4core ~/ecm-gpu/trunk $ sudo modprobe nvidia
FATAL: Module nvidia not found.
[/code]
It could be because I'm still using the built in graphics (which has a D-Sub port that fits my monitor) instead of the GPU (which only has DVI-D ports). I could buy a monitor with a DVI-D connector, but would like to know if that will fix it before I spend money. Fivemack, are you using the GPU for graphics as well as computations? And does anyone have advice on setting up the GPU when it's not used for graphics output?

This has passed from "interesting" to "educational" and is approaching "frustrating".

Chris

chris2be8 2014-01-20 17:09

Solved!
 
I've finally got it working. The last problem was that Linux had loaded the nouveau driver (an open source driver for Nvidia cards) so the nvidia driver could not be used to access them. "lspci -v" shows which kernel driver is in use for a card.

To make the system use the nvidia driver I had to blacklist the nouveau driver by adding it to /etc/modprobe.d/blacklist.conf (this step may not be needed) and then run "update-initramfs -u" (this almost certainly is needed on Ubuntu based systems). After a reboot lspci -v showed the card was using the nvidia driver. Then ./test.gpuecm ./ecm succeeded.

Running "make ecm-params; make" caused problems though. I backed out ecm-params.h and they went away.

Other points that might help someone else installing it on Linux:
Start with post 209. The password is also anonsvn.
If you need a newer version of GMP get it from [url]http://gmplib.org/[/url].
To compile with a newer version of GMP than the one installed on the system:
[code] ./configure --enable-gpu=sm_21 --with-cuda=/usr/local/cuda --with-gmp-lib=home/chris/gmp-5.1.3/.libs --with-gmp-include=home/chris/gmp-5.1.3 | tee -a configure.out
[/code] Where --with-gmp-include is the dir containing gmp.h and --with-gmp-lib is the dir containing libgmp.a.
Get CUDA etc from [url]https://developer.nvidia.com/cuda-downloads[/url] if you need it. Follow the getting started guide for Linux (especially to set PATH and LD_LIBRARY_PATH).

This was definitely an "educational" experience.

Chris

Ralf Recker 2014-01-20 17:56

[QUOTE=chris2be8;364978]Running "make ecm-params; make" caused problems though. I backed out ecm-params.h and they went away.[/QUOTE]

Try this:

[CODE]make ecm-params
./bench_mulredc >> ecm-params.h
make[/CODE]

chris2be8 2014-01-22 15:04

Thanks, that did it. Presumably the Makefile should be updated to do that when making ecm-params.

Chris

chris2be8 2014-03-04 16:52

Would setting the GPU into persistence mode have any effect? The man page for nvidia=smi says:
[code] Persistence Mode
A flag that indicates whether persistence mode is enabled for the GPU. Value is either "Enabled" or "Disabled". When persis‐
tence mode is enabled the NVIDIA driver remains loaded even when no active clients, such as X11 or nvidia-smi, exist. This min‐
imizes the driver load latency associated with running dependent apps, such as CUDA programs. For all CUDA-capable products.
Linux only.
[/code]
Which sounds interesting.

Chris

PS. Would it affect msieve polynomial selection either?

frmky 2014-03-04 20:24

Nothing significant. By default, Linux unloads the driver if nothing is using the card. When you then start a CUDA program, that program has to wait a short amount of time, probably about 0.5 seconds on one of my older machines, for the driver to load. This has a big effect only if you run a CUDA program many times and it has a short runtime. Otherwise, it doesn't really matter.

ChristianB 2014-06-06 15:09

Hi,

I'm currently investigating new applications for yoyo@home. We want to update the server code of yoyo@home in the future and this would give us the possibility to run optimized applications and also GPU applications. I already set up a test project for this with the yoyo@home ecm application.

With my next step I would like to update ecm to a current version and also support a cuda enabled version. As I had trouble with my local cuda build system I would like to test with a working precompiled binary. Could someone provide me with one? Especially a windows one would be nice as I don't have a windows build system.

VictordeHolland 2014-06-06 15:55

[QUOTE=ChristianB;375185]Hi,

I'm currently investigating new applications for yoyo@home. We want to update the server code of yoyo@home in the future and this would give us the possibility to run optimized applications and also GPU applications. I already set up a test project for this with the yoyo@home ecm application.

With my next step I would like to update ecm to a current version and also support a cuda enabled version. As I had trouble with my local cuda build system I would like to test with a working precompiled binary. Could someone provide me with one? Especially a windows one would be nice as I don't have a windows build system.[/QUOTE]
It is still an experimental version and only runs stage 1. Stage 2 needs to be done on a CPU. Also a 200W GPU has about the same performance as an 160W CPU. I would not recommend it at this time.

wombatman 2014-06-06 15:56

If somebody can help me figure out why I get the following errors, I can provide one:

[CODE]Error 202 error LNK2001: unresolved external symbol __gmpn_mul_fft

Error 204 error LNK2001: unresolved external symbol __gmpn_fft_best_k[/CODE]

libecm_gpu.lib builds without any issue.

lorgix 2014-06-06 16:39

[QUOTE=VictordeHolland;375191]It is still an experimental version and only runs stage 1. Stage 2 needs to be done on a CPU. Also a 200W GPU has about the same performance as an 160W CPU. I would not recommend it at this time.[/QUOTE]
That doesn't sound right to me, but I might be mistaken.

I was under the impression that ECM on GPU was quite a bit more efficient than that.


All times are UTC. The time now is 22:06.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.