Getting Started with Rhino.Compute on Linux

Warning
  • This project is part of the Rhino WIP (work in progress) and as such should be considered WIP software. We do not recommend using this for production work.
  • Things we are still working on:
    • GH: RhinoCode enabled script components
    • File IO: Importing and exporting files other than 3dm
    • 3rd Party Plug-in Management. There is currently no mechanism to load 3rd party plugins, other than what can be installed by the yak-cli and only in cases where the package includes a GHA for Grasshopper to load.
    • Probably many other things

Prerequisites

  • A system capable of running Ubuntu Server 24.04 or AmazonLinux 2023. The steps in this guide should also work for Debian 13. This system can exist locally as a docker container or a VM, or it can be set up in production environments that support Linux instances.
  • A Core-Hour Billing Token. Please see the Compute: Licensing & Billing to get a token.
Warning
Your core-hour billing token allows anyone with it to charge your team at will. Do NOT share this token with anyone.

Provision System

Rhino.Compute on Linux has been tested to run on Ubuntu Server 24.04 and AmazonLinux 2023. You can run these systems as virtual machines or in docker containers on macOS, Windows, or Linux.

We have also tested running Rhino.Compute on Linix on AWS EC2 and Azure instances.

Containers (Docker)

Running rhino-compute in a container is a straightforward way of getting started, but is not recommended for production environments as docker containers lack the systemd service manager which enables the start of the rhino-compute service when the system reboots. At the time of writing, we are typically developing on Ubuntu 24.04 and ensuring that things work on AmazonLinux 2023. There has been no additional effort to ensure these instructions work on Debian 13, other than testing them on this base image.

  1. Install Docker - You need either Docker Desktop (macOS, Windows, Linux Desktop) of Docker Engine (Linux, CLI)

  2. Start container

    docker run --rm -it -p 5000:5000 amazonlinux:2023 /bin/bash
    

    or

    docker run --rm -it -p 5000:5000 ubuntu:noble /bin/bash 
    
Flags
  • --rm: remove the container after exit.
  • -it: interactive terminal (stdin and stdout).
  • -p 5000:5000: port mapping [Host Port:Container Port]. Please note, your host OS might already have certain ports reserved. For example, macOS reserves port 5000 for AirPlay. In this case, you should choose a different HOST port: -p 5001:5000
  • amazonlinux:2023 or ubuntu:noble: the base image for the container. ubuntu:noble = Ubuntu 24.04. debian:trixie = Debian 13
  • /bin/bash: start bash shell
  1. Continue to the setup section for your Linux distribution:

VMs (Multipass, WSL, etc)

Running rhino-compute on a VM is a good way to test out how to run rhino-compute as a service, which is how it is meant to be run in production.

Multipass

Multipass can be used to run Ubuntu on macOS, Windows, and Linux host operating systems.

  1. Download Multipass
  2. Create an instance. The recommendation for a lightweight local VM is to provision an instance with 4 cpus, 8gb ram, and 10gb of storage. After launching, you can open a shell right from the multipass interface.
  3. Make a note of the IP address of the instance you just created, as that will be necessary for connecting to Rhino.Compute running on this VM.
  4. Continue to the Ubuntu setup.

WSL2

The Windows Subsystem for Linux (WSL2) can be used to run Ubuntu and AmazonLinux on a Windows 10 or 11 host operating system.

Note
While it should be possible, we have yet to setup and test AmazonLinux on WSL2
  1. Install the default Ubuntu image:

    wsl --install
    
  2. Continue to the setup section for your Linux distribution:

Production Environment (AWS, Azure, etc)

AWS EC2

TODO

Azure

TODO

Other

Raspberry Pi

We have tested running Rhino.Compute on a rpi 400 running Ubuntu. It is highly recommended to use the advanced settings in the RPi imager to add your wifi credentials and a ssh key so that your rpi can connect to the internet. https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview. After you complete this, you can follow the Ubuntu setup.

Setup

Important
If you are on a VM or Production Environment, switch to root first: sudo -s

Ubuntu

  1. Install dependencies:

    # dotnet
    wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh -O dotnet-install.sh
    chmod +x ./dotnet-install.sh
    ./dotnet-install.sh --version 9.0.102 --install-dir /usr/share/dotnet
    
  2. Add mcneel-packages to package sources:

    # Import the GPG key
    wget -qO- https://mcneel-packages.s3.amazonaws.com/mcneel-packages.gpg.key | gpg --dearmor -o /usr/share/keyrings/mcneel-archive-keyring.gpg
    
    # Add repository
    echo "deb [signed-by=/usr/share/keyrings/mcneel-archive-keyring.gpg] https://mcneel-packages.s3.amazonaws.com/deb stable main" | tee /etc/apt/sources.list.d/mcneel.list
    
  3. Install rhino-compute:

    apt update && apt install -y rhino-compute
    
  4. Set the RHINO_TOKEN:

    The RHINO_TOKEN is your Core-Hour Billing token.

    cp /etc/rhino-compute/environment.example /etc/rhino-compute/environment
    nano /etc/rhino-compute/environment
    
    # control + x, y, enter to save the file and exit nano
    
  5. Optional: Install yak-cli to install 3rd party packages.

    apt install yak-cli
    
Note
Expect that 3rd party plugins will not work at this time. Only packages that are marked “-any” (i.e. package-0.0.0-\<some rhino version>\_any.yak) will be installed, and only packages with Grasshopper add-ons will be loaded. We are actively working on expanding the support for loading 3rd party plugins on Rhino.Compute on Linux.
  1. Continue to the Run rhino-compute section.

AmazonLinux

  1. Install dependencies:

    # dotnet
    wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh -O dotnet-install.sh
    chmod +x ./dotnet-install.sh
    ./dotnet-install.sh --version 9.0.102 --install-dir /usr/share/dotnet
    
Note

Install additional dependencies if you are running AmazonLinux in a container:

dnf install -y wget tar gzip nano findutils

  1. Add mcneel-packages to package sources

    wget -O /etc/yum.repos.d/mcneel.repo https://mcneel-packages.s3.amazonaws.com/rpm/repos/mcneel-amzn2023.repo
    
  2. Install rhino-compute

    dnf install -y rhino-compute
    
  3. Set the `RHINO_TOKEN``

    The RHINO_TOKEN is your Core-Hour Billing token.

    cp /etc/rhino-compute/environment.example /etc/rhino-compute/environment
    nano /etc/rhino-compute/environment
    
    # control + x, y, enter to save the file and exit nano
    
  4. Optional: Install yak-cli to install 3rd party packages.

    dnf install -y yak-cli
    
Note
Expect that 3rd party plugins will not work at this time. Only packages that are marked “-any” (i.e. package-0.0.0-\<some rhino version>\_any.yak) will be installed, and only packages with Grasshopper add-ons will be loaded. We are actively working on expanding the support for loading 3rd party plugins on Rhino.Compute on Linux.
  1. Continue to the Run rhino-compute section.
Note
If you are running AmazonLinux in a container, access on the container from the host with http://localhost:5001 or whichever port you have set in docker run

Run Rhino.Compute

Important
If you had previously run the setup as root (sudo -s), please exit root now and return to the default user: exit.

VM or Production Environments

  • Start the Rhino.Compute service

    sudo systemctl start rhino-compute
    
  • Stop the Rhino.Compute service

    sudo systemctl stop rhino-compute
    
  • Enable automatic startup of the Rhino.Compute service on system reboot

    sudo systemctl enable rhino-compute
    
  • Check the status of the service

    sudo systemctl status rhino-compute
    
  • Follow real-time logs

    sudo journalctl -u rhino-compute -f
    

Containers

rhino-compute-start
Log Location
Logs are written to /var/log/rhino-compute on the system running Rhino.Compute.

Solve a Grasshopper definition on Rhino.Compute

This section requires the Host computer to have Rhino 8 or Rhino WIP with Hops installed for Grasshopper. Grasshopper should have the IP of the VM or container, as well as the API Key, which is the same as the RHINO_TOKEN set in the Setup. It also helps to have a definition ready to pass to Hops.

  1. Open Rhino 8 or WIP, open GH, and navigate to the Grasshopper Solver Settings.
  2. In the text field under “Hops - Compute server URLs”, enter in the IP and port of your Linux system
  3. In the text field next to “API Key” enter in your Core-Hour Billing token aka the RHINO_TOKEN.
  4. Drag the Hops component onto the canvas and reference a definition. If you are following the logs in real-time, you should see your Linux system start to log events related to Rhino.Compute.