Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: Check the Zena CSS Linux guest
description: Check the Zena CSS Linux guest's architecture, tools, and storage before building a CPU workload.
weight: 2

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Check the Zena CSS Linux guest

Start from the Linux console or SSH shell prepared in the Zena CSS onboarding Learning Path. Check this guest before downloading source code or a model. The required tools and free space depend on the actual EWAOL image and chamber configuration.

## Record the environment

Run these commands in the **Primary Compute Linux guest**:

```bash
cat /etc/os-release; uname -m; uname -r; cat /sys/devices/system/cpu/online; grep -E '^(MemTotal|MemAvailable):' /proc/meminfo; df -h /
```

The guest reports an Arm64 architecture, commonly `aarch64`, and shows its own CPU, memory, and root-filesystem values. The tested setup used ANA 2026.02 on a g4 chamber without changing the supplied Zena VP's CPU or memory settings. ANA Lab Manager showed **Simulation CPUs: 4**; the Linux output below shows **16 online CPUs** (`0-15`) and the EWAOL image's approximately 8 GB of usable guest memory. Use the Linux output when describing guest-visible CPUs; do not read the ANA simulation setting as a Linux core count.

```
ID=ewaol
NAME="Edge Workload Abstraction and Orchestration Layer"
VERSION="v2.1.0 (styhead)"
VERSION_ID=v2.1.0
VERSION_CODENAME="styhead"
PRETTY_NAME="Edge Workload Abstraction and Orchestration Layer v2.1.0 (styhead)"
CPE_NAME="cpe:/o:openembedded:ewaol:v2.1.0"
aarch64
6.6.54-yocto-standard
0-15
MemTotal: 8120232 kB
MemAvailable: 7856280 kB
Filesystem Size Used Avail Use% Mounted on
/dev/root 28G 1.3G 25G 5% /
```

## Check build and transfer tools

See which tools are available in this guest:

```bash
for tool in git cmake make gcc g++ wget sha256sum tar; do
command -v "$tool" || printf 'Missing: %s\n' "$tool"
done
```

The later pages need a C/C++ compiler, Make, CMake, Git, a model transfer method, and a SHA-256 utility. If a tool is missing, record it before proceeding. Do not install a package from an unrelated Linux distribution into the EWAOL image.

```
/usr/bin/git
Missing: cmake
/usr/bin/make
/usr/bin/gcc
/usr/bin/g++
/usr/bin/wget
/usr/bin/sha256sum
/usr/bin/tar
```

## Set the work directory

The Zena guest shown above has 25 GB available on its root filesystem. Use one directory under `/root` for the source, build, model, and results:

```bash
LP2_WORK_DIR=/root/zena-llamacpp
mkdir -p "$LP2_WORK_DIR"
```

The tested run used this directory for the source, build, model, and result archive. The root filesystem had 25 GB available before these files were created.

If your guest has less available space, choose a directory on a filesystem with enough capacity before running the next page. Keep this shell open so `LP2_WORK_DIR` remains set.

ANA's **Auto Shutdown** duration is configurable. Check the selected duration in Lab Manager before starting the build, and plan to save your work before the VP stops.

## What you have learned

You have identified the Linux guest and set a work directory for the workload. The next page builds llama.cpp using the tools available in this image.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: Build llama.cpp in the Zena CSS guest
description: Build a pinned llama.cpp revision for CPU inference in the Zena CSS Linux guest.
weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Build llama.cpp in the Zena CSS guest

Build the tested llama.cpp revision in the Zena CSS guest. Keep the source and build output in the work directory from the previous page.

## Make CMake available

Check whether CMake is already installed. In the tested Zena guest, the command returned:

```bash
cmake --version
```

```output
sh: cmake: command not found
```

Use the [Kitware CMake 3.28.6 release](https://github.com/Kitware/CMake/releases/tag/v3.28.6) for Linux AArch64 in the Zena work directory. This does not change the guest's system packages:

```bash
cd "$LP2_WORK_DIR" &&
wget -O cmake-3.28.6-linux-aarch64.tar.gz.part \
https://github.com/Kitware/CMake/releases/download/v3.28.6/cmake-3.28.6-linux-aarch64.tar.gz &&
mv cmake-3.28.6-linux-aarch64.tar.gz.part cmake-3.28.6-linux-aarch64.tar.gz &&
sha256sum cmake-3.28.6-linux-aarch64.tar.gz &&
tar -xzf cmake-3.28.6-linux-aarch64.tar.gz &&
export PATH="$LP2_WORK_DIR/cmake-3.28.6-linux-aarch64/bin:$PATH" &&
cmake --version
```

The Zena download completed with a 53,907,530-byte archive. The hash and version commands returned:

```output
7909cc2128ce9442c63ce674a0bfb0e4f4ce04cef667d887e15ad5670d594ba7 cmake-3.28.6-linux-aarch64.tar.gz
cmake version 3.28.6
```

The SHA-256 value identifies the downloaded file used in this run; it has not been checked against a publisher-supplied checksum. If the download or extraction fails on your guest, keep the error output and stop before the llama.cpp build. Keep this shell open so the CMake path remains available.

## Get the source at a fixed revision

Clone llama.cpp and check out the full commit used in the tested Zena run:

```bash
LP2_LLAMA_COMMIT=b86d2f07542b29ab099aed34fd6b6d1b2fd4b81c
git clone https://github.com/ggml-org/llama.cpp.git "$LP2_WORK_DIR/llama.cpp" &&
cd "$LP2_WORK_DIR/llama.cpp" &&
git checkout --detach "$LP2_LLAMA_COMMIT" &&
git rev-parse HEAD
```

The final command returned the requested full commit:

```output
b86d2f07542b29ab099aed34fd6b6d1b2fd4b81c
```

If your checkout reports another commit, stop before configuring the build.

## Configure a CPU build

In the same **Zena guest shell**, configure the pinned source for a CPU build:

```bash
cd "$LP2_WORK_DIR/llama.cpp"
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=ON \
-DLLAMA_CURL=OFF \
-DBUILD_SHARED_LIBS=OFF
```

This CMake invocation was used in the tested Zena run. Its output reported GNU 14.2.0 for C and C++, included the CPU backend, and ended with:

```output
-- Configuring done (3.3s)
-- Generating done (0.2s)
-- Build files have been written to: /root/zena-llamacpp/llama.cpp/build
```

CMake also reported that OpenMP was not found. That warning did not prevent configuration; it does not establish how many threads a later inference run will use. The supplied excerpt does not include a numeric exit status. Stop if configuration reports an error.

## Build and identify llama.cpp

After configuration succeeds, compile the CPU binary:

```bash
cmake --build build --config Release -j4
./build/bin/llama-cli --version
```

The tested Zena build output reached `Built target llama-cli`, and the binary returned:

```output
version: 0.6.0-dev (build 11482, commit b86d2f075)
built with GNU 14.2.0 for Linux aarch64
```

The full build also downloaded UI assets from Hugging Face during compilation, so that build required network access. `-j4` limits build jobs; it does not set the virtual platform's CPU count. The supplied excerpts do not include a complete build log or numeric exit status. If the build fails, save its error output and check the work filesystem before retrying.

## What you have learned

You have a source revision and a binary identity to associate with the inference result. Keep `LP2_WORK_DIR` available in this shell for the next page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: Prepare and verify a text model
description: Download a pinned GGUF text model and verify its size and SHA-256 checksum in the Zena CSS guest.
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Prepare and verify a text model

Use one small GGUF text model so you can focus on application bring-up. The tested Zena run used the [Qwen2.5 0.5B Instruct Q4_0 GGUF file](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/blob/main/qwen2.5-0.5b-instruct-q4_0.gguf). The publisher lists an Apache-2.0 license and SHA-256 value for this file. The downloaded file matched that hash before inference.

Use the file's [full upload commit](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/commit/6dd44a1fb35d11b5d1b28902876ce3cc9e882d0e) instead of the moving `main` branch. The file in the tested Zena run was 428,730,208 bytes. Verify its hash in your guest before loading it.

## Choose the model location

Use the work filesystem checked on the first page. Make sure it still has room for a temporary download and the complete model:

```bash
LP2_MODEL_DIR="$LP2_WORK_DIR/models"
mkdir -p "$LP2_MODEL_DIR"
df -h "$LP2_MODEL_DIR"
LP2_MODEL_FILE="$LP2_MODEL_DIR/qwen2.5-0.5b-instruct-q4_0.gguf"
```

In the tested Zena guest, the model directory was created and its filesystem reported:

```output
Filesystem Size Used Avail Use% Mounted on
/dev/root 28G 2.9G 23G 12% /
```

These figures describe the guest before the model download.

## Obtain the fixed model file

If this guest can reach Hugging Face, download the file from the fixed repository revision:

```bash
LP2_MODEL_REV=6dd44a1fb35d11b5d1b28902876ce3cc9e882d0e
wget -q -O "$LP2_MODEL_FILE.part" \
"https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/$LP2_MODEL_REV/qwen2.5-0.5b-instruct-q4_0.gguf?download=true" &&
mv "$LP2_MODEL_FILE.part" "$LP2_MODEL_FILE"
printf 'Download exit status: %s\n' "$?"
```

The fixed-revision download in the tested Zena guest completed with:

```output
Download exit status: 0
```

Continue only if the download exit status is `0`. A successful download command does not establish that the file has the expected contents; check it below.

If the guest cannot download directly, obtain the same approved file through a transfer route configured for this VP. The [Zena CSS onboarding Learning Path](../innexis_ana_zena/) describes ANA Host Access and an authorized SSH tunnel; each new VP needs its own access configuration. Set `LP2_MODEL_FILE` to the transferred file's actual path and verify its hash before continuing.

## Check the file identity

Compare the downloaded or transferred file with the SHA-256 published for this Q4_0 file:

```bash
LP2_MODEL_SHA256=7671c0c304e6ce5a7fc577bcb12aba01e2c155cc2efd29b2213c95b18edaf6ed
test -s "$LP2_MODEL_FILE" && wc -c "$LP2_MODEL_FILE"
printf '%s %s\n' "$LP2_MODEL_SHA256" "$LP2_MODEL_FILE" | sha256sum -c -
printf 'Hash check exit status: %s\n' "$?"
```

In the tested Zena guest, the file size and hash check returned:

```output
428730208 /root/zena-llamacpp/models/qwen2.5-0.5b-instruct-q4_0.gguf
/root/zena-llamacpp/models/qwen2.5-0.5b-instruct-q4_0.gguf: OK
Hash check exit status: 0
```

If your check fails, stop before inference. Investigate the file source, revision, partial download, or expected hash rather than accepting a changed artifact silently.

## What you have learned

You have identified a model artifact separately from the runtime binary. Keep `LP2_MODEL_FILE` available in the same guest shell for inference.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Run CPU inference and inspect the result
description: Run llama.cpp with a verified model and confirm that the Zena CSS guest generates text on its CPU.
weight: 5

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Run CPU inference and inspect the result

Run a short text prompt with the binary and model you prepared. Use one fixed command so its output can be traced back to the source revision, model file, and Zena guest.

## Check the command options

The tested Zena build exposes `--single-turn` and `--simple-io`. Confirm that your build exposes both options:

```bash
LP2_LLAMA_CLI="$LP2_WORK_DIR/llama.cpp/build/bin/llama-cli"
test -x "$LP2_LLAMA_CLI"
"$LP2_LLAMA_CLI" --help > "$LP2_WORK_DIR/llama-cli-help.txt" 2>&1
grep -F -- '--single-turn' "$LP2_WORK_DIR/llama-cli-help.txt"
grep -F -- '--simple-io' "$LP2_WORK_DIR/llama-cli-help.txt"
```

In the tested Zena guest, both searches returned matching help text:

```output
-st, --single-turn run conversation for a single turn only, then exit when done
--simple-io use basic IO for better compatibility in subprocesses and limited
```

If either option is missing from your build, revise the command below before running it.

## Run a text-generation smoke test

Create a results directory and save the prompt beside the application output:

```bash
LP2_RESULTS_DIR="$LP2_WORK_DIR/results"
mkdir -p "$LP2_RESULTS_DIR"
printf '%s\n' 'Write one short sentence about a virtual platform.' \
> "$LP2_RESULTS_DIR/first-prompt.txt"
```

Run the following command on the **Zena Linux guest**. It requests zero GPU layers with `-ngl 0` and saves both the log and exit code:

```bash
if "$LP2_LLAMA_CLI" \
-m "$LP2_MODEL_FILE" \
-t 4 -tb 4 -ngl 0 -c 512 -n 128 --temp 0 --seed 42 \
--single-turn --simple-io \
-p 'Write one short sentence about a virtual platform.' \
> "$LP2_RESULTS_DIR/first-run.log" 2>&1; then
printf '0\n' > "$LP2_RESULTS_DIR/first-run.exit"
else
printf '%s\n' "$?" > "$LP2_RESULTS_DIR/first-run.exit"
fi
cat "$LP2_RESULTS_DIR/first-run.exit"
tail -n 60 "$LP2_RESULTS_DIR/first-run.log"
```

In the tested Zena guest, the saved exit code was `0`. The log identified build `b11482-b86d2f075`, loaded the verified Q4_0 file, and contained a non-empty generated response:

```output
build : b11482-b86d2f075
model : /root/zena-llamacpp/models/qwen2.5-0.5b-instruct-q4_0.gguf
ftype : Q4_0

> Write one short sentence about a virtual platform.
A virtual platform is a platform that allows users to create and share digital content, such as images, videos, and documents, in a virtual environment.

Exiting...
```

The CPU-only build also reported that no usable GPU was found. This warning did not prevent inference. This request is a functional smoke test: inspect your own log to confirm that text appears between the prompt and `Exiting...`. The recorded answer used the general meaning of "virtual platform", so it is not a definition of an automotive Virtual SoC or a test of answer quality.

If model loading fails, check the hash and available memory before changing model or runtime settings. Save the failing log and exit code; a changed model or command is a new test condition.

## What you have learned

You have a recorded CPU text-inference result on the selected virtual platform. The next page changes only the prompt and collects the evidence from both runs.
Loading
Loading