Jetson Engine v2 User Guide

 

Welcome to the user guide for Jetson Engine v2. As you may recall, Jetson Engine v1 applies a client-server concept that allows a ChessBase application running on any Windows laptop to access a UCI engine running on a remote machine (like Nvidia’s Jetson Xavier device). We have extended v1 to cover broader usages. In v2, the Jetson Engine software allows a ChessBase client to remotely connect to any UCI engine running on any of the following three types of backend servers:

In v2, all UCI engines (LCZero, Stockfish, Fat Fritz, Fritz, Komodo, Houdini, etc.) are supported. Moreover, you can access strong engines from ChessBase even if you don’t have a laptop equipped with powerful GPU/CPU and abundant memory. Jetson Engine v2 also allows multiple users to simultaneously access and launch whatever engines they prefer. You can even share the same engine, with the server launching individual engine instances associated with each client. Clients and servers can be connected by either the home WiFi network or direct cable connections, as long as both the client and server can communicate via their IP addresses. The examples in this user guide use 192.168.10.x and 192.168.55.x as the IP addresses for the home WiFi network and the Xavier device, respectively.

Take the following steps to set up Jetson Engine v2:

***Please Note: Steps 1-3 are to be done on the server end and steps 4-6 are to be done on the laptop client with ChessBase.***

 

1. Prepare the Backend Engine Server: Though any host can technically be used as the backend server, we recommend deploying servers that have a reasonable amount of memory (8GB+), multi-core CPU, and Nvidia modern GPU. In this user guide, the three servers we use have the following configurations:

Note: Please use PuTTY to log in to Xavier/Linux server and Remote Desktop to log in to Windows server.

It is recommended to use a dedicated account in the server to hold the engine folder. In this user guide, we use the account "jetson" as the example for all three types of hosts. For Xavier and Linux, the home folder is /home/jetson. For Windows, the home folder is C:\Users\jetson.

 

2. Copy Backend Package to Server Home Folder: Download JetsonBackend_xxx.zip file on your computer and copy it to the backend home folder created in Step 1. For Xavier/Linux server, use pscp to copy JetsonBackend_Xavier.zip/JetsonBackend_X64Linux.zip to the backend server. You can do so by typing the following command:

pscp JetsonBackend_Xavier.zip jetson@192.168.55.1:/home/jetson
pscp JetsonBackend_X64Linux.zip jetson@192.168.10.6:/home/jetson

If Xavier/Linux has internet access, you can also use the wget command.

For Windows server, there are many ways to copy JetsonBackend_X64Win.zip to the backend server. We directly downloaded the package within the Windows server.

Once the package is copied to the backend server, unzip it. You should see the subfolder "JetsonBackend" appear. The JetsonBackend folder contains the following contents:

Here is an example of what the "JetsonBackend" folder contents look like on Windows and Xavier/Linux:

 

3. Launch the Backend Agent on the Server: After the engine backend package is installed in Step 2, you can now launch jetson_agent.exe (for Windows) or jetson_agent (for Xavier and Linux). First, go into the “JetsonBackend” folder. Then launch the agent by typing "jetson_agent.exe" (Windows) or "./jetson_agent" (Xavier/Linux).

Note: For Xavier and Linux, you might run into the following error:
-bash: ./jetson_agent: Permission denied
You will need to add an execute permission to the agent program by running "sudo chmod a+x jetson_agent"

Once the agent is launched, all the configured backend engines will be waiting for connections from ChessBase clients that are able to access it.

         

Windows agent loading seven engines and Linux agent loading four engines based on configurations

By saying "waiting for connections from ChessBase clients that are able to access it", we mean the ChessBase client must be in the same subnet where the backend server resides. ChessBase on our laptop is able to access all three backend servers by using two separate IP addresses: 192.168.55.55 to access the Xavier device (192.168.55.1, via MicroUSB-to-USB cable direct connection) and 192.168.10.2 to access the Windows server (192.168.10.3) and the Linux server (192.168.10.6), both via home WiFi network.

 

Here is some extra information you might find useful:

Cloud Access: Some may wonder if it’s possible to access the backend server via Internet. To that we say yes! You can turn on "Port Forwarding" from your home Internet router, and then the ChessBase client can access it from anywhere in the world. Port forwarding is just one method – we’re pretty sure there are other ways for cloud access with better security. Future Jetson Engine versions (perhaps v3…) may add secure access features to allow safe cloud access. You could also simply tweak the source codes (which will be published soon) to add secure features in your favor. We have successfully performed a proof-of-concept test for the Port Forwarding scenario. You can find the instructions here.

Agent Loaded Automatically: The backend server is the machine providing services, so you may want the agent to launch automatically when the server is up to avoid having to log in to the server and launch it manually. To achieve this, you may set a cronjob (for Xavier/Linux) or task scheduler (for Windows). There are other ways to automatically load the agent.

Agent Loaded in the Background: When manually loading the agent, we suggest loading it in the background or with the window minimized. There should be many different ways to load the agent in the background. One possible way is to run "start /min jetson_agent.exe" for Windows or "nohup ./jetson_agent &" for Linux.

Firewall Warning: Windows Defender Firewall may give you a warning when you launch jetson_agent.exe on a Windows server for the very first time. This likely occurs because the home WiFi network was set up as a "public network." It is not a huge issue - just click "Allow access" if it appears.

Possible Firewall Warning when launching Windows agent

 

4. Auto-Generating ChessBase UCI Engines on Client: Once the backend server is prepared and the agent is launched, the ChessBase client will scan the agent to retrieve a list of engines. A bunch of UCI engine executables will be automatically generated and can then be loaded by ChessBase. Please download JetsonFrontend zip package, save it anywhere in your laptop (for example, C:\Users\username), and then unzip it. The subfolder "JetsonUCI" should show up.

To retrieve a list of engines, type in the following command to scan the backend server:

 jetson_scan.exe scan server_ip [mgmt_port]

Here is an example of scanning the backend server 192.168.10.3, the Windows backend.

Note: mgmt_port is optional. Deafult 53350 is used if not provided. To use customized mgmt_port, the port number should be provided in file "mgmt.port" in backend folder.

 

As mentioned earlier, the scan will return a list of available engines from the given backend server. Then their associated UCI engine executables (.exe files) will be automatically generated. The auto-generated UCI engine executables have a special naming format like this:

JRE_X64WIN_192.168.10.3_53352_lc0-cuda

JRE - Jetson Remote Engine

X64WIN - Engine is retrieved from a Windows server running on Intel/AMD X64 CPU. (For Linux server on Intel/AMD64, it is X64LNX and for Xavier device, it is XAVIER.)

192.168.10.3 - IP address of backend server. As mentioned earlier, this user guide use 192.168.10.3 for a Windows server, 192.168.10.6 for a Linux server, and 192.168.55.1 for Xavier device. If you have engines from another server, you should use the scan command with the different IP address to retrieve the engine list.

53352 - Uniquely assigned TCP port associated with the engine name (lc0-cuda in this example) for the agent to accept connections. Port assignment is done via the jetson_agent.conf file, which was mentioned in Step 2.

lc0-cuda - Engine name associated with a certain engine or engine configuration pre-defined in the jetson_agent.conf file.

The example below shows all the engines retrieved from the three backend servers (four from Windows, four from Linux, and three from Xavier):

JRE Engines retrieved from multiple backend servers

 

5. Create UCI Engines from ChessBase on the Client: Launch ChessBase and click "Create UCI Engine." Go to the "JetsonUCI" folder where those JRExxx engines were generated. Select one of the engines to prompt ChessBase to issue UCI commands to retrieve engine information. The UCI commands will be relayed to the backend server and the responses will be transferred back. ChessBase actually has no idea the engine is located outside. Repeat this step to load all those JRExxx engines.

Creating UCI engines from auto-generated JRE executables

 

6. Launch and Run UCI Engines on Client: In ChessBase, go to "Analysis" -> "Let's Check". The default engine that comes with ChessBase is usually Fritz. To switch, select any of the newly created JRE engines from the "Load engine" box. A JRE engine will run.

The "Load engine" box shows a list of JRE engines that have been retrieved from various backend servers that the ChessBase client can access. The following example shows four engines from a Linux server, seven engines from a Windows server, and three engines from a Xavier device.

 

Normally, the engine names shown in the "Load engine" box are the "id name" string returned by the engine. The Jetson agent in the backend server intercepted the "id name" string and then added JRExxx string to allow for easy identification of where the engine comes from and what type of engine it is. For example, the real id name for a LCZero engine is "Lc0 v0.26.0-dev+git.dirty" whereas the modified id name is “JRE_X64LNX_192.168.10.6_lc0-cuda##Lc0 v0.26.0-dev+git.dirty”. Anything before "##" is an added JRE string and anything after "##" is the original id name string.

Position evaluations by lc0 running from Xavier, Windows, and Linux backend

 

Summary  

This six-step procedure is a one-time thing. Once the JRExxx UCI engine is loaded into ChessBase, it will stay there and is good to run, provided that the Jetson agent is running in the backend server. Hope you found this process to be simple!

Here is some supplemental information that you may find useful:

Supported Engines: So far, we have tested the following backend engines:

We didn't have a chance to test out other notable engines like Komodo and Houdini, but we believe they should work without an issue since they all follow UCI protocols. Engine authors can contact us if they’d like us to test out their engines on various types of backend servers (e.g., Fat Fritz and Fritz 17 on Linux and Xavier).

Add New Engine Configurations: You may want to add a new engine or a new configuration. Here is an example of what steps to take to add a lc0 engine that has new weights file:

Note: You don't actually need to touch the existing engines.

The agent on the backend server doesn't need to stop and this process of adding a new engine or a new configuration won't affect other running engine configurations.

Engine Binaries in the Package: In the downloadable package, only lc0 and Stockfish engines are included. Commercial engines are excluded. You can add commercial engines in the backend server if you’ve purchased the licenses. The detailed engine information from the package is listed below:

Leela Chess Zero:

Stockfish:

Engine Binaries Not in the Package: If you want to use an engine not shown in the Jetson Engine package, you can download the pre-compiled engine binaries or compile the source codes provided by engine authors and then put all of them in the backend server.

Checking Backend Status: Since the backend server is shared and accessed by multiple clients, we may want to check the status of a backend server (for example, how many ChessBase clients are connected to it? or what backend engines are running and by which client?). From any ChessBase client, run the command "jetson_scan.exe query server_ip", where server_ip is the IP address of a backend server.

Here is an example of query command showing five clients that are running different engines from one Windows backend server: