# Mining under linux ## Disclaimer I'm in no case responsible for fried hardware, erased software or burning down houses. Make sure your miners are always well cooled. ## General recommendation Don't mix nVidia and AMD in the same rig. sgminer doesn't play nice, and you might want to use a different distro depending on the hardware. More on this later. ## nVidia ### OS I recommend using Ubuntu. The advantage is this little PPA over there : https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa that will allow easy installation of latest nVidia drivers. ### Driver installation ```sh add-apt-repository ppa:graphics-drivers/ppa apt-get update apt-get install -y linux-headers-generic nvidia-387 libcuda1-387 xorg --no-install-recommend ``` ### Enabling XORG on all GPU If you don't enable XORG, you won't be able to use nvidia-settings to overclock your card(s), so yes, and X server is needed. ```sh nvidia-xconfig --enable-all-gpus --coolbits=28 --allow-empty-initial-configuration ``` ### Create a systemd service file ( see mining.service ) ```sh vim /mining.service ``` ### Create your mining start-up script (see start-mining.sh) ```sh vim /start-mining.sh chmod +x /start-mining.sh ``` In the script a value of 100 is used for ```GPUMemoryTransferRateOffset```. The max memory overclock you can achieve depends on your card. Start from 100 and increase slowly to find a safe spot ( running stable for more than 30 minutes ). ### Enable the service at start-up ```sh systemctl enable /mining.service ```