Bitcoin miner

I am curious if someone has built a bitcoin miner that exploits the hardware available on the TX2… any pointers would be appreciated.

Y-

I don’t think that’s worth it. The large ASIC farms have the GPUs pretty much beat, no matter how power efficient the GPU is at being a GPU. You’re paying for generality you don’t need.

For example, the cost of an AntMiner S7 is about the same as a Jetson TX2 module, and it hashes several 100x faster at only 15x the power draw.

But, by all means, install CUDAMiner and see what it does :-)

ASICs are an order of magnitude more efficient. ASIC mining in general is only profitable if you have lots of money to drop and lots of cheap/free electricity. GPU mining on the other hand…
It would be interesting to see someone get an auto-switching algo interface like nicehash or any of the command-line GPU miners working with the jetson tegra modules, just to see what they’re capable of

Interesting subject. What could one generate, a nickel a day? A dollar? Just looking for some scale here.

I spent some time to make sure CudaMiner could be built and run on Jetson TX2. Please check out my repository.

https://github.com/jkjung-avt/CudaMiner

Running the benchmark (scrypt algorithm) on Jetson TX2, I got roughly 80 khash/s.

According to the documentation (https://github.com/jkjung-avt/CudaMiner/blob/master/README.txt), CudaMiner does not support BitCoin. I wonder what would be a good coin to mine with CudaMiner today…

We're not supporting Quark, ProtoShares (Momentum) or any other
highly specialized "CPU-only" coin. And certainly no BitCoin: 
This train has left the station quite some time ago!
-a, --algo=ALGO       specify the algorithm to use (default is scrypt)
                          scrypt       scrypt Salsa20/8(1024, 1, 1), PBKDF2(SHA2)
                          scrypt:N     scrypt Salsa20/8(N, 1, 1), PBKDF2(SHA2)
                          scrypt-jane  scrypt Chacha20/8(N, 1, 1), PBKDF2(Keccak)
                          scrypt-jane:Coin
                                       Coin must be one of the supported coins.
                          scrypt-jane:Nfactor
                                       scrypt-chacha20/8(2*2^Nfactor, 1, 1)
                          scrypt-jane:StartTime,Nfmin,Nfmax
                                       like above nFactor derived from Unix time.
                          sha256d      SHA-256d (don't use this! No GPU acceleration)
                          keccak       Keccak256 as used in MaxCoin

Huh, so the TX2 has several co-processors: Pascal GPU, Video CODEC, do the miners use the GPU ?

Bitcoin mining can be done with CPU, GPU, or ASIC (application specific integrated circuits – custom chips.) Because there’s about a 10x energy-efficiency ratio bump at each step on that chain, almost all bitcoin mining in the world uses ASICs. And while the Jetson TX2 is an energy-efficient GPU, it is not as efficient at Bitcoin mining as the ASIC based mining systems, and thus Jetson-based mining would only be a curiosity, not a way to make money out of consuming electricity.
(GPU miners dropping bitcoin support comes from this problem – that industry moves fast!)

Ethereum mining can be done using CPU and GPU, but Ethereum is designed to not be easily accelerated by ASICs for … unclear reasons. Thus, it may be possible to energy-efficiently mine Ethereum on the Jetson TX2.

I previously took a look at building the tools needed to do this, but unfortunately the various tools I checked either use x86_64 specific code, or have sub-dependencies on tools that are newer than what’s available on Ubuntu 16.04 that’s on the Jetson, so that would require more effort than I wanted to spend to make work. If someone else makes it work, I’d love to see a patch set.

I forked the CudaMiner repository from https://github.com/noxo/CudaMiner, and did some modification so as to make it build and work on Jetson TX2.

https://github.com/jkjung-avt/CudaMiner

From what I can see, this CudaMiner mainly implemented “scrypt” algorithms in CUDA. I managed to have my Jetson TX2 successfully mining “LTC” coin from https://coinotron.com/, but very slowly. I think this is just for learning, instead of really making money out of it.

Ethereum hasn’t been the most profitable coin to mine for a long time with maxwell and pascal, just FYI. There are much more profitable coins to mine, and algos that auto-switch every hour based on market rates.

Try nicehash on windows sometime to see an example of what I mean, it’s good stuff. I’ve made enough to upgrade nicely to dual an 1800x dual 1080ti (with evga hybrid cooling) for modeling. It’s also paid for this jetson, and will pay for an x399 system and a threadripper and vega FE once it’s out.

Tons of money out there to be made if you’re into crypto, especially on the GPU front, but it’s more of a curiosity on the jetson. Though if someone could make it run properly, a cluster of them might be power efficient enough to be worth it (total speculation there, it’s just as likely to be a dead end).

double post

I get that speed with Nvidia graphic card on my pc, TX2 is very slow indeed, how it is super computer

I’m mining at incredible rate of 118 K :-)))))

Someone has experience in about?

this is my command§:
./cudaminer -d 0 -l K28x32 -C 2 -i 0 -o stratum+tcp://coinotron.com:3334 -O myname.miner:pwd

Necro’ing this topic.

I’ve been working w/volta and mining recently.

Here is how the mining metagame works. You mine by proxy.

  1. mine a gpu coin (other than bitcoin) on a pool that autoexchanges to eth/btc/ltc
  2. goto 1

ccminer is the best miner for nvidia gpus for lyra2v2 (the most profitable algorithm), nist5 is most profitable for older gpus (gtx970).

When you read the code though…

Basic things like grid-stride are missing, invariants everywhere. And now the “optimization” is moving to hard coding everything instead of calling cublas/etc.

E.g.
https://github.com/Myrinia/ccminer/commit/9e1c1739d5d9d3fb6ff4dca76fdbeee0a9dcf047

I’ve been tinkering with some minor optimizations, and my volta cards get 240MH/s doing lyra2v2, but my cuda-foo is weak and the ccminer code has zero documentations. I can’t tell what the intents were to figure out how to leverage unified memory, cooperatives, cublas, etc.

That’s 500-700 dollars a month assuming prices for the big coins stay static. (they have been generally up in a bubble/pop/bubble/pop upwards cycle).

Here is a popular ccminer fork running at basic thread rate:

nvprof --timeout 5 ./repos/KlausT/ccminer-stable -a lyra2v2 --benchmark --no-cpu-verify
ccminer 8.17-KlausT (64bit) for nVidia GPUs
Compiled with GCC 6.3 using Nvidia CUDA Toolkit 9.1

Based on pooler cpuminer 2.3.2 and the tpruvot@github fork
CUDA support by Christian Buchner, Christian H. and DJM34
Includes optimizations implemented by sp-hash, klaust, tpruvot and tsiv.

==25539== NVPROF is profiling process 25539, command: ./repos/KlausT/ccminer-stable -a lyra2v2 --benchmark --no-cpu-verify
[2017-12-26 13:32:41] NVML GPU monitoring enabled.
[2017-12-26 13:32:41] 2 miner threads started, using 'lyra2v2' algorithm.
0
1
[2017-12-26 13:32:42] GPU #1 Found nonce 81882010
[2017-12-26 13:32:42] GPU #0 Found nonce 03dad570
[2017-12-26 13:32:42] GPU #0: Graphics Device, 95.28 MH/s
[2017-12-26 13:32:42] GPU #1 Found nonce 84550c7f
[2017-12-26 13:32:42] GPU #1: Graphics Device, 95.09 MH/s
[2017-12-26 13:32:42] Total: 190.37 MH/s

That’s 190MH/s without upping the threadcount. Now look at the profile.

==25539== Profiling result:
            Type  Time(%)      Time     Calls       Avg       Min       Max  Name
 GPU activities:   38.93%  3.59935s      1646  2.1867ms  2.1761ms  2.1989ms  cubehash256_gpu_hash_32(unsigned int, unsigned int, uint2*)
                   23.76%  2.19679s       823  2.6693ms  2.6543ms  2.6832ms  lyra2v2_gpu_hash_32_2(unsigned int)
                   11.87%  1.09731s       936  1.1723ms  1.2160us  10.353ms  [CUDA memcpy DtoH]
                    8.86%  818.63ms       823  994.69us  986.30us  1.0124ms  blakeKeccak256_gpu_hash_80(unsigned int, unsigned int, unsigned int*)
                    5.95%  549.87ms       823  668.13us  660.06us  678.81us  skein256_gpu_hash_32(unsigned int, unsigned int, unsigned long*)
                    5.50%  508.91ms       823  618.36us  612.45us  622.72us  lyra2v2_gpu_hash_32_1(unsigned int, uint2*)
                    3.15%  291.00ms       823  353.58us  342.69us  366.05us  lyra2v2_gpu_hash_32_3(unsigned int, uint2*)
                    1.96%  180.76ms       823  219.63us  218.05us  221.60us  bmw256_gpu_hash_32(unsigned int, unsigned int, uint2*, unsigned int*, unsigned int)
                    0.02%  1.8387ms       936  1.9640us     896ns  24.811us  [CUDA memset]
                    0.00%  83.752us        40  2.0930us  1.0240us  24.749us  [CUDA memcpy HtoD]
                    0.00%  3.7440us         2  1.8720us  1.7600us  1.9840us  get_cuda_arch_gpu(int*)
      API calls:   83.74%  9.04112s       936  9.6593ms  20.928us  13.746ms  cudaMemcpy
                    5.43%  586.06ms         2  293.03ms  228.17ms  357.89ms  cudaDeviceSetCacheConfig
                    4.32%  466.06ms         8  58.257ms  167.71us  227.87ms  cudaMalloc
                    1.91%  206.70ms         2  103.35ms  357.24us  206.34ms  cudaDeviceReset
                    1.87%  202.03ms      7490  26.973us  5.3520us  1.7468ms  cudaLaunch

The kernel here is one optimized by hand unrolling all the matrixes (as i mentioned before).
ref: https://github.com/KlausT/ccminer/blob/cuda9/Algo256/cuda_cubehash256.cu

You would need to convert invariant code to flexible code to make sure everything just works on an embedded system like this.

But yes, even a Jetson could be a mining device, especially if the matrix math could be done using newer cuda libs and letting tensor cores do some of the matrix ops. You would just have the jetsons connect to auto-switching mining pools mining coins nvidia excels at, but also optimizing those to reduce memcpy while offloading anything that can be done as a matrix transform to tensor cores. The matrix logic is currently being purged for inline everything though in the mining code.

Or I could be wrong. This has been my winter break project.

What about now though since most mining farms were based in China and now that China is basically banning everything that has to do with Crypto Currencies claiming it is because of the power usage which is estimated to be something like 4 Gigawatts of Electricity which is about equivalent to Three Nuclear Reactors production levels. I have a feeling that is going to leave a Gaping Hole in the Bitcoin Mining Industry! I just have a feeling that there will be a new surge in Bitcoin Mining again. But who knows I am the furthest thing from a expert on all of this I just find it all so fascinating how something that doesn’t even technically exist could be worth so much and I am not just talking dollars!

Charlie,

The question of “why crypto currencies?” has several answers. The most common response is that ‘It is easy to trade’. My question is 'Can the TX2 with all the silicon, etc. it has, be used as a good to excellent crypto miner."

That is a good point that China has outlawed bitcoin. I wonder if they will actually stop mining it.
Y-