Setup Xavier NX and Compile Engine Source Code
Nvidia's Jetson Xavier devices (Xavier NX or AGX Xavier) run on ARM64 CPU architecture, so we need to download chess engine source codes and compile for ARM64. Jetson Engine package contains the compiled binaries for LCZero and Stockfish. Please follow the steps to set up Xavier device and its software. Some special tweaks and work-arounds are needed for a chess engine to load successfully on Xavier devices.
1. Set up Jetson Xavier NX device: Follow Getting Started with Jetson Xavier NX Developer Kit to download the SD card image and install Jetson Xavier NX software packages. During the installations, make sure to create a user account: for example, "jetson." Note: if your Jetson Xavier runs JetPack older than version 4.6 please update to 4.6 with SD card image or via SDK Manager.
2. Connect Jetson Xavier NX device: Use a MicroUSB-to-USB cable to connect the Windows laptop (USB send) to the Jetson Xavier NX device (MicroUSB end). Once connected, you should see "USB Serial Device" show up under "Ports (COM & LPT)" in the Windows Device Manager.
3. Log in Jetson device: Launch PuTTY and select "SSH" with IP address 192.168.55.1. This prompts the user to enter the username and password. Jetson Xavier device runs Ubunbu Linux 18.04 and it launches a DHCP service to automatically assign IP address 192.168.55.100 to the USB end on the Windows laptop. It came to our attentions that this address is not stable, perhaps because of some issues related to DHCP service. One solution is to setup static IP address on the Windows end.
4. Compile LCZero and Stockfish from source codes: Please download source codes from LCZero and Stockfish.
-
LCZero: follow "Ubuntu 18.04" of "Building and running Lc0" from LeelaChessZero GitHub.
-
Stockfish: set ARCH to armv8 and follow their instruction to compile.
5. Change Default Power Mode: Jetson Xavier NX or AGX Xavier by default doesn't enable the best GPU power mode. Please refer to Jetson Device Supported Modes and Power Efficiency for the avaialble power mode settings. We suggest to use the following command to set power mode 0 for the best GPU performance.
sudo /usr/sbin/nvpmodel -m 0
Note: JetPack 4.6 released on 8/4/2021 supports new 30W mode for Xavier NX.