# Cudaminer

**URL:** <https://www.debian-fr.org/t/cudaminer/58292>\
**Category:** Pause Café\
**Created:** [Février 21, 2016, 5:40 UTC](https://www.debian-fr.org/t/cudaminer/58292 "2016-02-21T17:40:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dunatotatos](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Dunatotatos](https://www.debian-fr.org/u/Dunatotatos)\
**Post date:** [Février 21, 2016, 5:40 UTC](https://www.debian-fr.org/t/cudaminer/58292/1 "2016-02-21T17:40:21Z")

</div>

Salut à tous,

J’ai hésité à mettre mon message dans SD, mais comme ce n’est pas un problème attaché à Debian directement, j’ai pensé qu’il avait plus sa place ici. (Si un modo veut déplacer mon sujet, pas de souci.)

Bref, passons au souci.

Je m’intéresse aux monnaies virtuelles, et ai souhaité participer au minage des litecoins. Le client litecoin-qt fonctionne parfaitement, ainsi que la fonctionnalité de minage basée sur le CPU. Du coup, j’ai voulu aller plus loin en utilisant aussi mon GPU. (Je croyais que les litecoins étaient faits pour ne pouvoir être minés qu’avec un CPU, mais manifestement, non…)  
Du coup, je trouve cgminer qui ne fonctionne qu’avec les chipset Intel. Puis je trouve cudaminer qui fonctionne avec ma carte NVidia \o/  
Sauf que non. J’ai suivi les instructions de ce message : [forum.litecoin.net/index.php?topic=3231.0](https://forum.litecoin.net/index.php?topic=3231.0) (en anglais), et l’installation se passe bien. Le paquet Debian pour Cuda5 semble être libcuda1.  
Par contre, quand je le lance, j’ai une exception de pointeur flottant ou un erreur de segmentation. C’est un problème qui a été évoqué par l’auteur du tuto :

> [@auteur du tuto](#):
>
> First of all: you need a recent official nvidia linux driver. Without it, the cudaGetDeviceCount function will return 32767 (the max value of an unsigned int, but not any proper cuda error code that I can see), and various other functions will fail as well - at best, you’ll get a floating point exception, at worst cudaminer will segfault. The latest version as of this writing, 319.17 (download here: [us.download.nvidia.com/XFree86/L … 319.17.run](http://us.download.nvidia.com/XFree86/Linux-x86_64/319.17/NVIDIA-Linux-x86_64-319.17.run)), works perfectly.[/quote]  
> J’ai donc installé les drivers proprio des dépôts expérimentaux, qui sont bien en version 319.17 (comme le script proposé) :
> 
> [quote]dunatotatos@PC-Duna:~$ dpkg -l | grep nvidia  
> ii bumblebee-nvidia 3.2.1-2 amd64 NVIDIA Optimus support using the proprietary NVIDIA driver  
> ii glx-alternative-nvidia 0.3.0 amd64 allows the selection of NVIDIA as GLX provider  
> ii libgl1-nvidia-glx:amd64 319.17-1 amd64 NVIDIA binary OpenGL libraries  
> rc libxvmcnvidia1:amd64 304.88-3 amd64 NVIDIA binary XvMC library  
> ii nvidia-alternative 319.17-1 amd64 allows the selection of NVIDIA as GLX provider  
> ii nvidia-driver 319.17-1 amd64 NVIDIA metapackage  
> ii nvidia-glx 319.17-1 amd64 transition to nvidia-driver  
> ii nvidia-installer-cleanup 20130505+1 amd64 cleanup after driver installation with the nvidia-installer  
> ii nvidia-kernel-common 20130505+1 amd64 NVIDIA binary kernel module support files  
> ii nvidia-kernel-dkms 319.17-1 amd64 NVIDIA binary kernel module DKMS source  
> rc nvidia-libopencl1:amd64 304.88-3 amd64 NVIDIA OpenCL library  
> ii nvidia-support 20130505+1 amd64 NVIDIA binary graphics driver support files  
> ii nvidia-vdpau-driver:amd64 319.17-1 amd64 NVIDIA vdpau driver  
> ii xserver-xorg-video-nvidia 319.17-1 amd64 NVIDIA binary Xorg driver

Et je me tape encore une erreur de segmentation.

Je pourrais installer les drivers via le script, mais je ne le fais pas pour des raisons évidentes de propreté de mon système et de dépendances de bumblebee.

Ma requête : une idée me permettant de progresser vers une solution.

Merci d’avance ^^  
Duna

---

<div class="post-metadata">

**Author:** ![Dunatotatos](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Dunatotatos](https://www.debian-fr.org/u/Dunatotatos)\
**Post date:** [Février 21, 2016, 5:41 UTC](https://www.debian-fr.org/t/cudaminer/58292/2 "2016-02-21T17:41:43Z")

</div>

Puis-je me permettre un petit up ?

---

<div class="post-metadata">

**Author:** ![Dunatotatos](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Dunatotatos](https://www.debian-fr.org/u/Dunatotatos)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/3 "2016-02-21T17:45:06Z")

</div>

Dernier up. Après, je laisse couler.

---

<div class="post-metadata">

**Author:** ![flavien](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flavien](https://www.debian-fr.org/u/flavien)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/4 "2016-02-21T17:45:18Z")

</div>

Salut,

peux-tu relancer ta commande précédée de strace ? (strace [nom de la commande])  
Et avant l’erreur de segmentation, copier ici un bout de la sortie ?

---

<div class="post-metadata">

**Author:** ![Dunatotatos](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Dunatotatos](https://www.debian-fr.org/u/Dunatotatos)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/5 "2016-02-21T17:45:26Z")

</div>

Cool, une réponse ! Merci Flavien de t’intéresser à mon cas 😉

La sortie avant l’erreur :

[code]dunatotatos@PC-Duna:~$ cudaminer -u dunatotatos.\*\*\* -p \*\*\* -o [http://mining-foreman.org:10341](http://mining-foreman.org:10341)  
[blabla]  
[2013-07-01 21:57:31] Long-polling activated for [http://mining-foreman.org:10341/LP](http://mining-foreman.org:10341/LP)  
[2013-07-01 21:57:31] GPU #538976288: starting up…

[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:31] GPU #538976288: starting up…

[2013-07-01 21:57:32] GPU #538976288: with compute capability 1.0  
[2013-07-01 21:57:32] GPU #538976288: interactive: 1, tex-cache: 538976288D, single-alloc: 1  
[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:32] GPU #0: with compute capability 1.0  
[2013-07-01 21:57:32] GPU #0: interactive: 0, tex-cache: 0 , single-alloc: 0  
[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:32] GPU #0: with compute capability 1.0  
[2013-07-01 21:57:32] GPU #0: interactive: 0, tex-cache: 0 , single-alloc: 0  
[2013-07-01 21:57:31] GPU #0: starting up…

[2013-07-01 21:57:32] GPU #0: with compute capability 1.0  
Erreur de segmentation[/code]

Et un coup de strace. La sortie étant forcément énorme, je ne mets que la fin.

[code]clone(child\_stack=0x7f96f7395f30, flags=CLONE\_VM|CLONE\_FS|CLONE\_FILES|CLONE\_SIGHAND|CLONE\_THREAD|CLONE\_SYSVSEM|CLONE\_SETTLS|CLONE\_PARENT\_SETTID|CLONE\_CHILD\_CLEARTID, parent\_tidptr=0x7f96f73969d0, tls=0x7f96f7396700, child\_tidptr=0x7f96f73969d0) = 1242  
futex(0x7f9944bae640, FUTEX\_WAIT\_PRIVATE, 2, NULL[2013-07-01 21:59:20] GPU #0: starting up…

[2013-07-01 21:59:20] GPU #0: with compute capability 1.0  
[2013-07-01 21:59:20] GPU #0: interactive: 0, tex-cache: 0 , single-alloc: 1  
[2013-07-01 21:59:20] GPU #6: starting up…

[2013-07-01 21:59:20] GPU #-1792507674: starting up…

[2013-07-01 21:59:20] GPU #0: starting up…

[2013-07-01 21:59:20] GPU #0: with compute capability 1.0  
) = 0  
futex(0x7f9944bae640, FUTEX\_WAKE\_PRIVATE, 1[2013-07-01 21:59:20] GPU #0: interactive: 0, tex-cache: 0 , single-alloc: 0  
[2013-07-01 21:59:20] GPU #0: starting up…

) = 1  
mmap(NULL, 8392704, PROT\_READ|PROT\_WRITE|PROT\_EXEC, MAP\_PRIVATE|MAP\_ANONYMOUS|MAP\_STACK, -1, 0) = 0x7f96f6395000  
[2013-07-01 21:59:20] GPU #8915328: starting up…

+++ killed by SIGSEGV +++  
Erreur de segmentation[/code]  
J’ai tenté de me débrouiller avec cette sortie, mais il faut dire que je n’y comprends pas grand chose…

EDIT : Je viens d’avoir l’idée de faire tourner cudaminer en tant que root… et je crois avoir trouvé le problème. En effet, un message m’indique “FATAL: Module nvidia not found.” et l’exécution se termine par un SIGFPE. Effectivement, lsmod ne m’indique pas ce module. Il me reste à trouver pourquoi. Je reviens bientôt donner des nouvelles.

EDIT 2 : J’ai un peu avancé. Le module nvidia n’était pas présent car dkms m’indiquait des erreurs lors de la compilation pour le noyau 3.2. J’ai donc redémarré sur le noyau 3.9, avec le module nvidia :

`dunatotatos@PC-Duna:~$ lsmod | grep nvidia
nvidia 9362971 0`  
Cette fois-ci, quand je lance cudaminer en root, je tombe toujours sur une erreur de segmentation. Sachant que j’ai un portable muni de la technologie Optimus, j’ai installé bumblebee. Du coup, je tente de lancer cudaminer comme ceci :

[code]root@PC-Duna:~# optirun cudaminer -u dunatotatos.2 -p y -o [http://mining-foreman.org:10341](http://mining-foreman.org:10341)  
\*\*\* CudaMiner for nVidia GPUs by Christian Buchner \*\*\*  
This is version 2013-04-30 (alpha)  
based on pooler-cpuminer 2.2.3 © 2010 Jeff Garzik, 2012 pooler  
Cuda additions Copyright 2013 Christian Buchner  
My donation address: LKS1WDKGED647msBQfLBHV3Ls8sveGncnm

[2013-07-01 22:51:51] Long-polling activated for [http://mining-foreman.org:10341/LP](http://mining-foreman.org:10341/LP)  
[2013-07-01 22:51:51] GPU #1: starting up…

[2013-07-01 22:51:51] GPU #7: starting up…

[2013-07-01 22:51:51] GPU #2: starting up…

[2013-07-01 22:51:51] GPU #0: starting up…

[2013-07-01 22:51:51] GPU #0: starting up…

[2013-07-01 22:51:51] GPU #0: starting up…

[2013-07-01 22:51:51] GPU #0: starting up…

[2013-07-01 22:51:51] GPU #0: with compute capability 1.0  
[2013-07-01 22:51:51] GPU #0: interactive: 0, tex-cache: -2147483648D, single-alloc: 1  
[2013-07-01 22:51:51] GPU #0: starting up…

[2013-07-01 22:51:51] GPU #0: starting up…

[2013-07-01 22:51:51] GPU #3: starting up…

[2013-07-01 22:51:51] GPU #0: starting up…[/code]  
qui se termine au bout d’une seconde sans code d’erreur apparent.  
strace m’indique pourtant :

[code]root@PC-Duna:~# strace optirun cudaminer -u dunatotatos.2 -p y -o [http://mining-foreman.org:10341](http://mining-foreman.org:10341)  
[2013-07-01 22:52:56] GPU #0: starting up…

[2013-07-01 22:52:56] GPU #0: with compute capability 1.0  
[{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}], 0, NULL) = 6768  
— SIGCHLD (Child exited) @ 0 (0) —  
wait4(-1, 0x7fff0ffbb42c, 0, NULL) = -1 ECHILD (No child processes)  
rt\_sigreturn(0) = 6768  
shutdown(3, 2 /\* send and receive \*/) = 0  
close(3) = 0  
exit\_group(139) = ?[/code]

Je suis à nouveau dans une impasse dont je ne sais trouver la poubelle pour grimper sur le mur…

---

<div class="post-metadata">

**Author:** ![flavien](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flavien](https://www.debian-fr.org/u/flavien)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/6 "2016-02-21T17:45:28Z")

</div>

Le dernier essai est déjà plus encourageant en effet.

1. A quel résultat t’attend-tu à la fin de l’exécution ?
2. Tu pourrais essayer avec le driver proprio plutôt que bumblebee ?

---

<div class="post-metadata">

**Author:** ![Dunatotatos](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Dunatotatos](https://www.debian-fr.org/u/Dunatotatos)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/7 "2016-02-21T17:45:29Z")

</div>

1. Comme c’est un système de minage de litecoin, l’exécution ne devrait pas se terminer. Cudaminer devrait partir en boucle infinie avec une indication d’un certain nombre de kilohashs par seconde, et le ventilateur qui tourne à fond.
2. Bumblebee n’est pas un driver. C’est juste un utilitaire qui permet de choisir quelle carte utiliser entre mon chipset intel ou ma carte nvidia via la commande optirun. (De base, les calculs passent sur le chipset, mais si je lance “optirun commande”, les calculs passent sur la carte) Le driver NVidia installé est bien le driver propriétaire en version 319.

---

<div class="post-metadata">

**Author:** ![flavien](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flavien](https://www.debian-fr.org/u/flavien)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/8 "2016-02-21T17:45:44Z")

</div>

Je viens de tenter de le compiler mais je vois que c’est incompatible avec gcc \>= 4.7.  
Tu es en squeeze ou bien ?

---

<div class="post-metadata">

**Author:** ![Dunatotatos](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Dunatotatos](https://www.debian-fr.org/u/Dunatotatos)\
**Post date:** [Février 21, 2016, 5:45 UTC](https://www.debian-fr.org/t/cudaminer/58292/9 "2016-02-21T17:45:44Z")

</div>

Non non, en Sid, avec des bouts d’Experimental.

Je vais installer le bouzin sur une installation fraîche de Debian avec les pilotes proprios installés par le script dégueu. Je te tiens au courant, mais ce sera pour plus tard.
