Skip to content

Latest commit

 

History

History
489 lines (392 loc) · 20.6 KB

new-client-beta.md

File metadata and controls

489 lines (392 loc) · 20.6 KB

QLI qubic.li - Client

Important

THIS PAGE IS FOR CLIENT >= 3.0 ONLY! The BETA version is experimental!

This is the main client component from qubic.li. It connects to the backend API and receives tasks to perform.

The Client runs on Docker, Windows and Linux. Below you find the instructions how to use it.

  1. Security Warning
  2. Pool Mining
  3. Download
  4. What's needed
  5. Windows
  6. Docker: Run qli-Client with Docker
  7. Linux Option 1: Run qli-Client in a Linux Screen
  8. Linux option 2: Run qli-Client as Linux Service (Expert)
    a. Ubuntu 22.04
    b. Debian 12
    c. Redhat Enterprise 8.8
    d. Monitoring
    e. Remove Client
  9. HiveOs
  10. Appsettings.json Customization
  11. Trainer Options
  12. Idling Options
  13. Troubleshooting

Security Warning

The client is able to download runners, which then performs the AI Training tasks. This can potentially be used in a bad manner. Run the client with the least priviliges which are possble. e.g. on windows NOT as Admininstrator; on linux NOT as root.

Find more information about the "principle of least privilege" on wikipedia: https://en.wikipedia.org/wiki/Principle_of_least_privilege

Pool Mining

If you don't want to operate your own Qubic infrastructure. You can join the qubic.li pool mining. You can either register an account (highly recomended) on http://pool.qubic.li or you can join pool mining register-less.

The simplest way to join is to create an account and login to https://pool.qubic.li, follow the instructions after you have logged in there.

PPS+ vs Solo

With the qli pools you can choose between PPS (Pay Per Share) or solo training. With PPS the revenue for Qubic is delayed one week but has advantages for smaller environments. It is also allowed to run some workers as PPS and others as solo training where you will see revenue only when you find valid Qubic Solutions.

To Enable/Disable PPS use either "pps": true or "pps": false in your settings.

Client Configuration

We recommend to use our Client Setup Configurator: https://pool.qubic.li/en-US/setup

Registerless training

If you want registration-less pool mining, do the following:

  1. Create a Qubic Id (e.g. on https://wallet.qubic.org)
  2. Download Client from below or run a Docker
  3. Start your Client
# replace in the examples:
# <QUBICID> with your Qubic Address
# <THREADS> with the amount of threads you want to run training

# bash/shell/command line
./qli-Client --ClientSettings:QubicAddress=<QUBICID> --ClientSettings:Trainer:CpuThreads=<THREADS>

# docker cpu only
docker run --name qli-client -e ClientSettings__QubicAddress=<QUBICID>   -e ClientSettings__Alias= -e ClientSettings__Trainer__CpuThreads=<THREADS>  qliplatform/qubic-client:latest

# docker cpu + gpu
docker run --name qli-client -e ClientSettings__QubicAddress=<QUBICID>   -e ClientSettings__Alias= -e ClientSettings__Trainer__CpuThreads=<THREADS>  qliplatform/qubic-client:cuda

# to use appsettings.json see below
  1. Check your performance: https://pool.qubic.li (Login with Qubic Address)

You can also put your PayoutId into the configuration file if you don't want to use command line arguments.

Download

We recommend to update your Version if there is a change in the Minor Version (e.g. from 1.3 to 1.4). Bugfix releases (e.g. from 1.3.1 to 1.3.2) are optional.

QLI Client

The QLI Client is the pool client and connects to the pool.

OS Platform Version Download Description
Windows x64 3.0.6 BETA https://dl.qubic.li/downloads/qli-Client-3.0.6-beta-Windows-x64.zip
Linux x64 3.0.6 BETA https://dl.qubic.li/downloads/qli-Client-3.0.6-beta-Linux-x64.tar.gz
HiveOs x64 3.0.6 BETA - not available

QLI Trainer

The trainer/worker is the binary executable which is responsible for the training. The Trainer is automatically downloaded by the Client. This ensures, that you always have the latest updates and the most optimized training experience.

QLI Trainer Options

The following table shows the available trainers.

Type Version Key (gpuVersion/cpuVersion) Description
GPU CUDA CUDA Version for all GPU's
GPU AMD General AMD Version (may not be available all the time; depends on the epoch)
CPU GENERIC Generic x64 CPU trainer (no specific instructions needed)
CPU AVX2 AVX2 x64 CPU trainer (AVX2 instructions needed)
CPU AVX512 AVX512 x64 CPU trainer (AVX512 instructions needed)
CPU SKYLAKE For specific Intel Lake processors (may not be available all the time)

What's needed

The runner on Windows also requires the VC Redistributable, which can be obtained from: https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

The runner on linux needs at least GLIBC 2.31.

Huge Pages

Depending on your environment you might want to enable huge pages. This can increase your iterations per second.

The trainer will tell you what is the optimal setting when it detects a wrong value.

2024-03-16 11:34:13     INFO    Trainer: WARNING: Free number of hugepages is smaller than needed, have: 10 - want: 1612 (52 x number of threads). Falling back to use malloc memory.
2024-03-16 11:34:13     INFO    Trainer: To add more hugepages, please run this command as root before starting the miner
2024-03-16 11:34:13     INFO    Trainer: /usr/sbin/sysctl -w vm.nr_hugepages=1612
2024-03-16 11:34:13     INFO    Trainer: OR: /sbin/sysctl -w vm.nr_hugepages=1612

if you see this, you can run the command /usr/sbin/sysctl -w vm.nr_hugepages=1612 as root or sudo /usr/sbin/sysctl -w vm.nr_hugepages=1612

Command Line Arguments vs. Configuration

You can either start the Client by providing command line arguments or using an appsettings.json file.

Every setting can be translated into a command line argument, below some examples:

Setting Command Line Argument Description
AccessToken --ClientSettings:AccessToken The Access Token to use
Trainer.CpuThreads --ClientSettings:Trainer:CpuThreads How many threads should the trainer for CPU use
Alias --ClientSettigns:ALias The Alias/Name of your rig/worker. Leave it empty to use machinename

Sample call: ./qli-Client --ClientSettings:QubicAddress=IERULKJFHESLKJSLDFHZLKSUHLSKDHFLSDF --ClientSettings:Trainer:CpuThreads:16

Windows

You can run the client directly on Windows. Open a command console and start it with ./qli-Client.exe or double click the file when you have the file appsettings.json in the same folder.

Download the Client from the above link. The Client must not be installed.

Docker

We provide two prepared docker images for you:

  1. Any CPU: docker pull qliplatform/qubic-client:latest
  2. NVIDIA/CUDA GPU + Any GPU: docker pull qliplatform/qubic-client:cuda

To start a docker container, you need to pass your configuration either via Environment veriables or you can map your appsettings.json into your container.

Environment Variables

Every setting can be translated into a environment variable, below some examples:

Setting Env Variable Description
AccessToken ClientSettings__AccessToken The Access Token to use
Trainer.CpuThreads ClientSettings__Trainer__CpuThreads How many threads should the trainer for CPU use
Alias ClientSettigns__ALias The Alias/Name of your rig/worker. Leave it empty to use machinename

Mapping appsettings.json

The path inside the container is /app/appsettings.json.

Starting Container

# start client for cpu training
docker run --name qli-client -e ClientSettings__AccessToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJJZCI6ImUxODc5YzQ3LTIwZjUtNDA5Yy05MThkLTRhYzgyNzFiYjYxMSIsIk1pbmluZyI6IiIsIm5iZiI6MTcyNTE5NzA5NSwiZXhwIjoxNzU2NzMzMDk1LCJpYXQiOjE3MjUxOTcwOTUsImlzcyI6Imh0dHBzOi8vcXViaWMubGkvIiwiYXVkIjoiaHR0cHM6Ly9xdWJpYy5saS8ifQ.hBYWpMvvpj8N-t6r6iIdF5y8ayKxtSi0FEb689oOrbPiwBrs76MBvpva7mbOQslzuEFJ8jZSFHlD1QgR6P9YMcTh5fZndI24VBD8lEkNUQPP1wWAOwEUQy-Yk1VTRg7L654ksf0jE4Obj_CDTPyIkK2f5C817--zE7uyngF3-hMRf3Taqus_jR2qqxYSz2D2B2nEYbrRWMDGoMf1tDHq3kFWaFqOr72IjgqkIDV3hs880mhiKcdI0USv54UK-tBon5B_WFJivPr5uo-OUrbILlU24AgTeLYskf1ajIIFnCqJVrAbYxEiaZ0cH1Ey5k6aDfRveb9wqhSQbTMGZuTsOw -e ClientSettings__Alias=docker-test -e ClientSettings__Trainer__CpuThreads=5  qliplatform/qubic-client:latest

Linux Option 1: Screen Session

To run the qubic.li client you can use this streamlined installation guide. Please consider adapt the commands to suit your directory preferences. Note that all commands must be executed as the root user, or you should precede them with the sudo command for proper authorization.

Note

With this method you do not have auto update

1. Download and Unpack the qli-Client:
Execute the following command to download and extract the qli-Client. This example uses the package qli-Client-1.8.8-Linux-x64.tar.gz. Please ensure you replace it with the latest available version.

mkdir ~/qubic;
cd ~/qubic;
wget https://dl.qubic.li/downloads/qli-Client-3.0.0-beta-Linux-x64.tar.gz;
tar -xvf qli-Client-3.0.0-beta-Linux-x64.tar.gz;
rm qli-Client-3.0.0-beta-Linux-x64.tar.gz;

2. edit and set your appsettings.json according to your preferences

nano appsettings.json

sample appsettings.json for GPU

{
  "ClientSettings": {
    "accessToken": "YOURACCESSTOKEN",
    "alias": "YOURALIAS",
    "trainer": { "gpu": true, "gpuVersion": "CUDA" }
  }
}

Note

Please refer to QLI Trainer Options for available gpuVersion values.

sample appsettings.json for CPU set to 10 threads:

{
  "ClientSettings": {
    "accessToken": "YOURACCESSTOKEN",
    "amountOfThreads": 10,
    "alias": "YOURALIAS"
  }
}

3. run qli-Client in a screen session named "qubic"

screen -S qubic ./qli-Client

basic screen commands:

  • exit screen : ctrl a + d
  • kill screen : ctrl + c
  • display qubic screen: screen -r qubic

Linux Option 2 (expert): Systemd Linux Service

To install the qubic.li Service you can use our quick installation guide. Please consider to check the content of the service installation script. All commands should either be executed by root or you need to prepend the sudo command.

The installerscript places all qubic.li stuff in /q.

Note

WSL is by default not shipped with systemd. You may activate it with this help: https://learn.microsoft.com/de-de/windows/wsl/systemd

Ubuntu 22.04

Don't forget to replace the token from the below examples with your own.

# update your sources
apt update
# download service installation script with autoupdate
wget -O qli-Service-install.sh https://dl.qubic.li/cloud-init/qli-Service-install-auto-beta.sh
# set the script as executable
chmod u+x qli-Service-install.sh
# install qubic.li client as systemd service
# Syntax: qli-Service-install.sh <threads> <accessToken|payoutId> [alias]
./qli-Service-install.sh 2 eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJJZCI6ImMyYmUyNTVkLWRkNzAtNDE4Mi04MDdkLWM1M2M5Yjc5ZDgyNiIsIk1pbmluZyI6IiIsIm5iZiI6MTcwNDczODc4NSwiZXhwIjoxNzM2Mjc0Nzg1LCJpYXQiOjE3MDQ3Mzg3ODUsImlzcyI6Imh0dHBzOi8vcXViaWMubGkvIiwiYXVkIjoiaHR0cHM6Ly9xdWJpYy5saS8ifQ.j8oI56OqV-gjoHxacwegetd2nha1zHLfSjW-REcNsp8q0lWW-NbvClPIuy_nig-YqpbyPXRPAZvYjh1SUjkw7g

for ubuntu 20.04 you might need to install a more recent libc version.

# add repo (use a mirror near your location from: https://packages.ubuntu.com/jammy/amd64/libc6/download)
echo "deb http://cz.archive.ubuntu.com/ubuntu jammy main" >> /etc/apt/sources.list
apt update
apt install libc6
apt install -y g++-11

Debian 12

# download service installation script with autoupdate
# download service installation script
wget -O qli-Service-install.sh https://dl.qubic.li/cloud-init/qli-Service-install-auto-beta.sh
# set the script as executable
chmod u+x qli-Service-install.sh
# install qubic.li client as systemd service
# Syntax: qli-Service-install.sh <threads> <accessToken|payoutId> [alias]
./qli-Service-install.sh 2 eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJJZCI6ImMyYmUyNTVkLWRkNzAtNDE4Mi04MDdkLWM1M2M5Yjc5ZDgyNiIsIk1pbmluZyI6IiIsIm5iZiI6MTcwNDczODc4NSwiZXhwIjoxNzM2Mjc0Nzg1LCJpYXQiOjE3MDQ3Mzg3ODUsImlzcyI6Imh0dHBzOi8vcXViaWMubGkvIiwiYXVkIjoiaHR0cHM6Ly9xdWJpYy5saS8ifQ.j8oI56OqV-gjoHxacwegetd2nha1zHLfSjW-REcNsp8q0lWW-NbvClPIuy_nig-YqpbyPXRPAZvYjh1SUjkw7g

for debian 11 you might need to install a more recent libc version.

Service Monitoring

You can manage your qubic.li Client with the systemd control.

Start Service: systemctl start qli Stop Service: systemctl stop qli Status Service: systemctl status qli

you can also see what is going on by observing the logs. the service logs to /var/log/qli.log or /var/log/qli.error.log.

to live watch it on the console, use tail -f /var/log/qli.log.

sample minimal configuration with token

{
	"Settings": {
        "trainer": {
            "cpuThreads": 16
        },
		"alias": "Client 3",
		"accessToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJJZCI6ImMyYmUyNTVkLWRkNzAtNDE4Mi04MDdkLWM1M2M5Yjc5ZDgyNiIsIk1pbmluZyI6IiIsIm5iZiI6MTcwNDczODc4NSwiZXhwIjoxNzM2Mjc0Nzg1LCJpYXQiOjE3MDQ3Mzg3ODUsImlzcyI6Imh0dHBzOi8vcXViaWMubGkvIiwiYXVkIjoiaHR0cHM6Ly9xdWJpYy5saS8ifQ.j8oI56OqV-gjoHxacwegetd2nha1zHLfSjW-REcNsp8q0lWW-NbvClPIuy_nig-YqpbyPXRPAZvYjh1SUjkw7g"
	}
}

sample minimal configuration with payout id

{
	"Settings": {
		"trainer": {
            "cpuThreads": 16
        },
		"alias": "My super miner",
		"payoutId": "VGIWRRNVVRRXSEASPENCIMVNANPCFHAASZVPBIEFLCRYHWSZYSGXHNSBYPVN"
	}
}

Remove Client

To remove the qubic.li Client execute the following commands.

# stop service
systemctl stop qli --no-block
# remove service definition
rm /etc/systemd/system/qli.service
# reload systemd
systemctl daemon-reload
# remove all related files
rm -R /q
rm /var/log/qli.log

HiveOs

HiveOs Instructions

Customizing

The appsettings.json contains the configuration of your client and needs to be placed at the same location as the executable.

if you opt for the Linux Screen session (Option 1):

  • you can customize the settings of your client in the settings file ~/qubic/appsettings.json

if you opt for the Systemd Linux Service (Option 2):

  • you can customize the settings of your client in the settings file /q/appsettings.json
  • You can create a custom file with the name appsettings.production.json which has higher priority to be loaded. (this file will not be overwritten when you install a new version manually)
Setting Default Value Description
poolAddress wss://wps.qubic.li/ws The Pool Address
accessToken* JWT Token This is you personal JWT Token which you can obtain from the Control Panel at qubic.li
qubicAddress* NULL This is the ID you want to get token payout for your found solutions.
alias qli Client You can give your Client a Name which will be displayed in the Control Panel. If empty it uses the Hostname.
pps true If the trainer should run in PPS mode
autoUpdate false If the trainer should try to do an autoupdate
trainer {} The trainer configuration options
idling {} The configuration options for the Qubic idling period

Trainer Options

{
	"cpu": false,
	"cpuVersion": "AVX512",
	"cpuThreads": 16,
	"cpuAffinity": "",
	"cpuVariant": "",
	"gpu": true,
	"gpuVersion": "CUDA",
	"gpuCards": "",
	"gpuVariant": "",
    	"cpuName": null,
    	"gpuName": null
}
Setting Default Value Description
cpu true Enable CPU Training
gpu true Enable GPU Training
cpuVersion null null=AUTO = it tries to detect your CPU; CPU Version to be used QLI Trainer Options
gpuVersion null null=AUTO = it tries to detect your GPU; GPU Version to be used QLI Trainer Options
cpuThreads 0 Number of Threads used for CPU training
gpuCards null Which GPU Cards should be used (see details below; available from client >=1.9.5 and runner >=105.3)
cpuAffinity null CPU Affinity for CPU training
cpuVariant null Which Variant of CPU trainer should be used
gpuVariant null Which Variant of GPU trainer should be used
cpuName null The specific name of the CPU trainer/worker.
gpuName null The specific name of the GPU trainer/worker.

Note

The gpuCards property can be used to select gThreads. The default configuration is auto tune for all cards.
For each GPU you can use (comma separated):
-1 => auto tune
0 => disable GPU
>0 => number of gThreads to be used

e.g.: 0,-1,-1,-1,-1,-1 => GPU#1 disabled, #1-5 auto tuen
e.g.: 0 => GPU#0 disabled, if there are more, all will be auto tuned
e.g.: 512,256,256,256,256,512 => set gThread to 512 on GPU#0 and GPU#5, 256 to the rest

Idle Options

During the Qubic idling phase. You can run another program or miner.

{
    "preCommand": "ping",
    "preCommandArguments": "-c 2 google.com",
	"command": "ping",
	"arguments": "google.com",
    "postCommand": "ping",
    "postCommandArguments": "-c 2 google.com",
}
Setting Default Value Description
command "" the command/programm to execute
arguments "" the arguments that should be given to the command/program
preCommand "" a command/programm to start once the idling period starts
preCommandArguments "" the arguments that should be given to the preCommand/program
postCommand "" a command/programm to start once the idling period stopps
postCommandArguments "" the arguments that should be given to the postCommand/program

Troubleshooting

The Client creates a folder log where all error messages are stored. If the Client stops unexpected or doesn't open check if there is a log file with current date and check the error messages.

Authentication failed

If you see an error like this ERROR AUTHENTICATION FAILED, you should create a new AccessToken. https://pool.qubic.li or check your internet connection.

GPU and WSL doesn't work

The Community showed several solutions to that Problem. Please check the Qubic discord channel.

Install GPU drivers in Ubuntu

Try to install the Ubuntu nvidia drivers.

sudo apt update
sudo apt install nvidia-driver
sudo reboot

Disable Mining GPU for Windows

If you have a second GPU (e.g. from your processor) you can try to disable your mining GPU for windows and let windows use the second GPU to render your windows.

AVX CPU (Intel) not working (legacy)

Somtimes the detection of AVX2/AVX512 is not accurate and it loads the wrong trainer. If this happens to you, you can enforce certain configuration.

Enforce SKYLAKE

add "cpuVersion": "SKYLAKE" to trainer settings in appsettings.json

{
	"ClientSettings": {
		"....": "...",
		"trainer": {
			"cpuVersion": "SKYLAKE"
		}
	}
}

Enforce AVX2

add "cpuVersion": "AVX2" to overwrites in appsettings.json

{
	"ClientSettings": {
		"....": "...",
		"trainer": {
			"cpuVersion": "AVX2"
		}
	}
}

Reset Configuration

if your trainer isn't working properly. try the following to reset local configuration:

# stop trainer
systemctl stop qli --no-block
# ensure that all qli services are stopped/killed
pkill -f qli
# delete any existing configuration lock
rm /q/*.lock
# delete current runner
rm /q/qli-worker*
# start trainer
systemctl start qli --no-block

Reset Server

if you think the client reports wrong or random hashrate you could restart your server. Or stop all qli services. (e.g. for linux: systemctl stop qli --no-block && pkill -f qli && systemctl start qli)

Possible Optimizations

Every specific CPU or general Hardware configuration can need speific performance settings. Depending on your Setup you can try:

  1. Enable/Disable SMT/HT in Bios
  2. Enabled/Disable Performance Boost (Windows)
  3. Enable/Disable specific Power Schema (Ubuntu)
  4. Adjust Threads to your needs. Sometimes less threads is more effective thatn to many.