A 2-post collection

Ethereum CUDA Mining with nvidia-docker

Somebody has done quite a good job : https://github.com/Anthony-Tatowicz/docker-ethminer

But, if you're using Nvidia's Pascal cards, you're better off using CUDA 8.0 not 7.5 as of the above's Dockerfile says.

So the new Dockerfile should be begin with:

FROM nvidia/cuda:8.0-devel-ubuntu14.04  

But, if you rush to building it now, if you like me, you will find some errors during cmake, here is one of them :

Building NVCC (Device) object libethash-cuda/CMakeFiles/ethash-cuda.dir/ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o  

Fortunately, there are others facing the very same problem as well, here is the thread: https://forum.ethereum.org/discussion/2227/cuda-miner/p34

And here is the response from the author of CUDA cpp-ethereum, namely Genoil:

@Cubirez yes ran into that myself too. This was caused by somebody who tried to make copatibility with Fedora work. I'll fix it in the rep later, but for now, add --std=c++11 to the NVCC flags in CMakelists.txt in libethash-cuda folder

So, actually, you have to make some change to the cloned source.

Here, I will change the course of the Dockerfile a bit, so that we can do the change :

git clone https://github.com/Genoil/cpp-ethereum.git  
cd cpp-ethereum/libethash-cuda  
vim CMakeLists.txt  

Change from

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--disable-warnings;--ptxas-options=-v;-use_fast_math;-lineinfo)  

To, by adding --std=c++11; :

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--std=c++11;--disable-warnings;--ptxas-options=-v;-use_fast_math;-lineinfo)  

Now, to the Dockerfile, instead of cloning we will be copying instead:

COPY cpp-ethereum /cpp-ethereum  
RUN cd cpp-ethereum \  
    && mkdir build \
    && cd build \
    && cmake -DBUNDLE=cudaminer -DCOMPUTE=61 .. \
    && make -j8 \
    && mkdir /data

Note : I added -DCOMPUTE=61 flag because

อ่านต่อ »

Setup A Deep Learning Engine With Ubuntu 16.04 + Nvidia Pascal + Nvidia Docker

I have seen a lot of instruction on building and setting up a machine learner, but with nvidia-docker I practically have seen so little relatively.

Using nvidia-docker is a good thing. It simplifies so much the complex part installing a large bunch of dependencies before you can start developing and running your deep learning algorithms.

With nvidia-docker you practically type nvidia-docker run ... and it just works like you would have intended to with a kind of magic with docker.

One question arises, however, if I were to use nvidia-docker what exactly would I have to install on my computer?

It's kind a obvious for me to look back, but not so for me at the time figuring it out.

Obviously, the first thing you can't miss out is the docker itself, simple because the nvidia-docker is built upon it.

So, if you don't have it in your machine already, here is a good place to start https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04

Second thing, you need a working driver for your nvidia pascal graphic card, which means GTX1060, 70, 80 and Titan. You will need a nvidia graphic driver better than 367.44 (the first version of the base line graphic driver to support Pascals), or if you to test on more recent drivers you can go to 370 line which is less stable.

# if you don't have the 'add-apt-repository'
apt-get install software-properties-common  
# begin !!
sudo add-apt-repository ppa:graphics-drivers/ppa  
sudo apt update  
# list all your choices
sudo apt search nvidia  
# install driver 367.44 (at the time of writing)
sudo apt install nvidia-367  
# install driver 370.23 (at the time of writing)
sudo apt install nvidia-370  

It's important to mention CUDA driver and CUDA toolkit are packed inside the nvidia/cuda docker's image, so we not need to install

อ่านต่อ »