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."

 

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. Patch cuDNN Library: The Ubuntu 18.04 in the Jetson device comes with cuDNN-8 libraries, however, there is a bug in it preventing LCZero engine to load. The work around is to downgrade to cuDNN-7. Here are the procedures:

 

5. Compile LCZero and Stockfish from source codes: Please download source codes from LCZero and Stockfish.

 

6. 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