firoorg / ccminer

mtp ccminer developpment
GNU General Public License v3.0
102 stars 55 forks source link

Building CCMiner 1.3.2 on Linux with Cuda 11.2 #70

Open chandlerpl opened 3 years ago

chandlerpl commented 3 years ago

Hello, I was wondering if there was any support for CCMiner to run on Linux with CUDA 11.2, I tried to compile it myself but I get this error, I am using Debian 10 as well and can't find any supporting CUDA drivers for CUDA 10.1 as suggested, any help on this would be great :)

nvcc -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=ute_75,code=\"sm_75,compute_75\" -I/usr/local/cuda/include -I. -I./compat/bos-jansson -std=c++11 --ptxas-options="-v" --megcount=128 -o cuda_mtp/cuda_mtp_forlib.o -c cuda_mtp/cuda_mtp_forlib.cu
cuda_mtp/cuda_mtp_forlib.cu:894: warning: "G" redefined
 #define G(r,i,a,b,c,d) \

cuda_mtp/cuda_mtp_forlib.cu:232: note: this is the location of the previous definition
 #define G(r,i,a,b,c,d) \

cuda_mtp/cuda_mtp_forlib.cu(349): error: function "__ldlu(const uint4 *)" has already been defined

1 error detected in the compilation of "cuda_mtp/cuda_mtp_forlib.cu".
make[2]: *** [Makefile:2606: cuda_mtp/cuda_mtp_forlib.o] Error 1
make[1]: *** [Makefile:2031: all-recursive] Error 1
make: *** [Makefile:656: all] Error 2
djm34 commented 3 years ago

Hello,

you need to remove the line device forceinline uint4 ldlu(const uint4 * restrict ptr) { uint4 ret; asm volatile ("ld.global.lu.v4.u32 {%0,%1,%2,%3}, [%4];" : "=r"(ret.x), "=r"(ret.y), "=r"(ret.z), "=r"(ret.w) : LDG_PTR(ptr)); return ret; } which is around line 325 in cuda_mtp/cuda_mtp_forlib.cu

Also if you are compiling for 11.2, I assume you want to use an rtx 30x card,

in this case you need to modify the nvcc command line and add support for those card ie:

-gencode=arch=compute_80,code=\"sm_80,compute_80\" -gencode=arch=compute_86,code=\"sm_86,compute_86\" (I think the 86 target only the 3080/3090)

Regarding debian particular matter, I can't really help you, I work only with ubuntu, but you should be able to get drivers for nvidia website for various linux distro (including debian)

djm34 commented 3 years ago

small correction: only this gencode is required for rtx 30xx: (not the other one) -gencode=arch=compute_86,code="sm_86,compute_86"

chandlerpl commented 3 years ago

Hello, thanks for the fast response, I have performed these changes and it compiled successfully however the miner now crashes with Segmentation fault a couple of seconds into mining

djm34 commented 3 years ago

what does it say when it crashes ?

chandlerpl commented 3 years ago

All it says is Segmentation fault and closes immediately

djm34 commented 3 years ago

yeah, I have the same problem in windows, I am looking into it... Alternatively, I would suggest to install cuda 11.1 (which is working, was tested yesterday...)

djm34 commented 3 years ago

ok I committed a change to the .cu for mtp which correct those crashes

chandlerpl commented 3 years ago

Hello! Thank you for the fast work, it also fixed my segmentation fault, my issue is now that the hashrate is far lower than usually, on my 1080 on Windows I could get 2.6Mh/s but now I barely get 900Kh/s, using another miner I also get 2.6Mh/s, do you have an idea of why that is happened? Sorry for all the questions :)

djm34 commented 3 years ago

I am not sure may-be the new cuda version (I can't check at the moment, I will check a bit later). I would suggest to try cuda 11.1 may-be that will solve the problem. Can it be a power issue ?

chandlerpl commented 3 years ago

Hi I will install CUDA 11.1 either tonight or tomorrow and give you an update it, thanks for all your support, I don't believe it can be a power issue

djm34 commented 3 years ago

Ok you are lucky my air cooled 1070 fit below the tube of the water cooled 3090 :D So I ran a small test with 11.2 it does around 400kh/s and with 11.1 2.5MH/s... so there is a problem with cuda 11.2

I'll try to understand the problem but for now, it is probably better to switch the cuda version to 11.1

chandlerpl commented 3 years ago

A watercooled 3090?? very nice! Been after one myself but having a hard time hahaha, thanks I will downgrade later, want me to close this ticket now or wait for a fix to the problem?

djm34 commented 3 years ago

https://www.gigabyte.com/Graphics-Card/GV-N3090AORUSX-WB-24GD#kf :)

nice card, a little problematic with large fitting though (because of a built-in leak detector) yeah they don't stay for sale really long have to keep watching

STRATZ-Ken commented 3 years ago

Any chance anyone can build this for Windows? I cannot run MTP on my 3070.

djm34 commented 3 years ago

I'll put later in the day in release binaries for windows but will be based on cuda 11.1. But technically there is already one in the latest release... https://github.com/firoorg/ccminer/releases/download/1.3.2/ccminer_cuda11.exe This release support already rtx 30xx

STRATZ-Ken commented 3 years ago

Weird, when I try to run it on my 3070 on the latest, it just sits there, no errors. I tried on my 2070 (same version) and it works fine.

djm34 commented 3 years ago

what do you mean by the latest ? with cuda 11.1, both card works for me:

[2021-01-26 11:23:01] GPU #1: Intensity set to 21.1719, 2457600 cuda threads number of multiproc 15 [2021-01-26 11:23:02] GPU #0: Intensity set to 23.2812, 10747904 cuda threads number of multiproc 82 [2021-01-26 11:23:05] GPU #1: EVGA GTX 1070, 653.14 kH/s [2021-01-26 11:23:05] GPU #0: Gigabyte RTX 3090, 2664.97 kH/s [2021-01-26 11:23:09] GPU #1: EVGA GTX 1070, 2528.56 kH/s [2021-01-26 11:23:10] GPU #0: Gigabyte RTX 3090, 7089.09 kH/s

make sure you don't select a particular card with "-d " in the command line. may-be I can't check (before next week) with a combination of rtx20xx and rtx30xx needs more fitting to put back my 2080ti in the system... but usually cards are treated independently...

bitfabrikken commented 3 years ago

Just tried compiling and when starting it also just sits there. No activity in nvtop. Doesn't matter if I use -d or not. And seems like no matter which algo I use, it says it's using blake.

Debian GNU/Linux bullseye/sid, Linux 5.10.0-3-amd64 ASRock Z68 Pro3 with bios P.2.30 + Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz GPU's: RTX 2060 rev a, GTX 960, GTX 980 Ti Cuda compilation tools, release 11.2, V11.2.142 Build cuda_11.2.r11.2/compiler.29558016_0 ccminer-1.3.2

me@mine:~/mine/ccminer-firoorg/ccminer-1.3.2$ ./ccminer -a mtp --devices 0
*** ccminer 1.3.2L-djm34 for nVidia GPUs by djm34 ***
    Built with the nVidia CUDA Toolkit 11.2

  Originally based on Christian Buchner and Christian H. project based on tpruvot 1.8.4 release
  Include algos from alexis78, djm34, sp, tsiv and klausT.
  *** News (07/06/2018): MTP algo for ZCoin

  MTP algo based on krnlx kernel

  BTC donation address: 1NENYmxwZGHsKFmyjTc5WferTn5VTFb7Ze (djm34)
  ZCoin donation address: aChWVb8CpgajadpLmiwDZvZaKizQgHxfh5 (djm34)

[2021-02-28 20:06:40] POOL 0: stratum.eu.miners-pool.eu:8421 USER ShGCAFrspnLDo414EzUyJm4k5Qr2Kkrmvh -s 30
[2021-02-28 20:06:40] Starting on stratum+tcp://stratum.eu.miners-pool.eu:8421
[2021-02-28 20:06:40] 1 miner thread started, using 'blake' algorithm.