Fortuna favors the bold
In this short article we will look at mining Fortuna V2 using Windows WSL and a Nvidia graphics card for mining with the community developed python implementation of the Fortuna Miner called tuna-py.
Initial steps that needs to be taken:
1. You need to update to the latest Nvidia driver this should at the time of writing be the 560.94 from August 2024.
2. You need to have virtualization enabled in both bios and windows features to be able to install WSL with Ubuntu 24
Once you have these steps in the command box write powershell and install WSL Ubuntu 24:
wsl --install -d Ubuntu-24.04
Step 1 Upgrade Ubuntu 24
Once you are done installing you should no longer be in the powershell but an Ubuntu Bash — you should first update and upgrade the Ubuntu installation by doing: (invoking sudo rights means you will have to write the password you just made the Ubuntu user with)
Sudo apt update
Sudo apt upgrade
Step 2 Install Cuda 12.6
Then you should install the cuda driver that works with 560.94 driver in our case it is the 12.6 cuda driver with the following commands:
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.debsudo dpkg -i cuda-keyring_1.1-1_all.debsudo apt-get updatesudo apt-get -y install cuda-toolkit-12-6
(Commands can change and can be fund at Nvidia site here:
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_network)
Step 3 Install needed tools for python & configuration
(ne is an editor and is optional if you want to use another editor)
sudo apt install cmake python3-full python3-pip python3-venv ne
Step 4 clone the tuna-py repository and make the files for the miner
git clone https://github.com/theeldermillenial/tuna-py
cd tuna-py
python3 -m venv .venv
source .venv/bin/activate
git submodule init
git submodule update
cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.6/bin/nvcc .
make
pip install -e .
Step 5 setup the .env file
ne .env
Edit the file with Address and info of the pool stratum at https://atago.io/
# Not currently used, will be for blockfrost integration
PROJECT_ID=
# Either SEED or ADDRESS must be defined.
# SEED must be defined when submitting solutions directly to the contract
# SEED=
# ADDRESS can be defined instead of SEED when submitting to Stratum
ADDRESS=”YOURADDRESS”
# Stratum server details
STRATUM_WORKER=YOURWORKERNAME
STRATUM_HOST=66.228.34.31
STRATUM_PORT=3643
STRATUM_PASSWORD=YOURPW
TUNA_LOG=DEBUG
Step 6 Start the miner and tune the miner to submit 1–2 seconds interval nounces. (remember to still be in the virtual environment should read (.venv))
python -m tuna
To tune the miner you can add — nloops to add more loops of calculations before submitting and — difficulty up it to more if the gpu is morefull for example for a 4080s I currently use — nloops 16384 and — difficulty 8.
You can look up your address on https://atago.io/ — Happy mining and may the Fortuna Tuna be with you!