Skip to content
Guy Davis edited this page Mar 20, 2023 · 12 revisions

At the beginning of 2023, the Chia blockchain took a turn that meant more hardware was needed to plot and farm efficiently. Where before just a mid-range computer with an average CPU and an SSD could plot and farm, the advent of Gigahorse and the subsequent attempts by Bladebit to keep up, a GPU became a helpful add-on for plotting and farming.

Nvidia

You'll need the Nvidia Driver Runtime. On Unraid, just install the Nvidia Driver plugin.

Then please add the following to your docker-compose.yml. Extend the existing environment section

        environment:
            - OPENCL_GPU=nvidia
            - NVIDIA_VISIBLE_DEVICES=0
            - NVIDIA_DRIVER_CAPABILITIES=compute,utility

Then add a new runtime line, (at same level as environment):

        runtime: nvidia

OR for Unraid, using the Docker admin tab, edit the Machinaris-MMX config, create 3 new Variables (shown) and add --runtime=nvidia to the "Extra Parameters" field.

Ideally you can target the device by position or GUID, which you can later override in Unraid Docker Configuration or compose ENVs,

-e NVIDIA_VISIBLE_DEVICES=0 or -e NVIDIA_VISIBLE_DEVICES=GPU-a8b96998-xxxx-xxxx

Further explained here.

AMD

For AMD GPUs, as per this tutorial (AMD section part-way down), please add the following to your docker-compose.yml. Extend the existing environment section

        environment:
            - OPENCL_GPU=amd
            - ROC_ENABLE_PRE_VEGA=1

and add the following devices section at the same level as environment:

        devices:
            - "/dev/kfd:/dev/kfd"
            - "/dev/dri/:/dev/dri/"

Intel iGPU

Extend the existing environment section

        environment:
            - OPENCL_GPU=intel

and add the following devices section at the same level as environment:

        devices:
            - "/dev/dri/:/dev/dri/"

On the host machine, add the user that runs the container to the "video" and "render" groups.

sudo adduser $USER video
sudo adduser $USER render

To see if it worked, after the container starts, connect to it and type "clinfo"

docker exec -it machinaris-mmx bash
clinfo

You should see something like:

root@localhost:/chia-blockchain# clinfo 
Number of platforms                               1
  Platform Name                                   Intel(R) OpenCL HD Graphics
  Platform Vendor                                 Intel(R) Corporation
  Platform Version                                OpenCL 3.0 
  Platform Profile                                FULL_PROFILE
Clone this wiki locally