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
@@ -1,6 +1,10 @@
---
title: Deploy Rust on Google Cloud C4A (Arm-based Axion VMs)

draft: true
cascade:
draft: true

minutes_to_complete: 30

who_is_this_for: This learning path is intended for software developers deploying and optimizing Rust workloads on Linux/Arm64 environments, specifically using Google Cloud C4A virtual machines powered by Axion processors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ rustc --version
cargo --version
```

You should see an output similar to:
```output
rustc 1.91.0 (f8297e351 2025-10-28)
cargo 1.91.0 (ea2d97820 2025-10-10)
```

### Create a Sample Rust Program
Create and build a simple “Hello, World” application to ensure everything is functioning properly:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ rustc --version
cargo --version
```

You should see an output similar to:
```output
rustc 1.91.0 (f8297e351 2025-10-28)
cargo 1.91.0 (ea2d97820 2025-10-10)
```

### Create a New Rust Project
Create a new Rust project for benchmarking:

Expand All @@ -26,7 +32,7 @@ cargo new rust-benchmark
cd rust-benchmark
```
### Add Criterion Benchmarking Dependency
**Criterion** is the officially recommended benchmarking crate for Rust. Add it to your project by editing the `Cargo.toml` file located inside your project root directory (for example, rust-benchmark/Cargo.toml):
**Criterion** is the officially recommended benchmarking crate for Rust. Add it to your project by editing the `Cargo.toml` file located inside your project root directory using your favorite editor (location example: rust-benchmark/Cargo.toml). Replace your "[dependencies]" tag within your file with this content, then save the file:

```toml
[dependencies]
Expand All @@ -39,11 +45,11 @@ harness = false
This enables Criterion for high-precision benchmarking.

### Create the Benchmark File
Create a new benchmark file inside the `benches/` directory:
Create a new benchmark file inside the `benches/` directory using your favorite editor ("edit" used in the example below):

```console
mkdir benches
vi benches/my_benchmark.rs
edit benches/my_benchmark.rs
```
Benchmark files in this directory are automatically detected by Cargo.

Expand Down Expand Up @@ -96,22 +102,13 @@ Found 1 outliers among 100 measurements (1.00%)
- **Plotting Backend:** Used `plotters` since Gnuplot was not found.
- The results show **consistent performance** with only slight variation across 100 measurements.

### Benchmark summary on x86_64
To compare the benchmark results, the following results were collected by running the same benchmark on a `x86 - c4-standard-4` (4 vCPUs, 15 GB Memory) x86_64 VM in GCP, running SUSE:

| **Benchmark** | **Average Time (µs)** | **Min (µs)** | **Max (µs)** | **Outliers (%)** | **Remarks** |
|--------------------|----------------------:|--------------:|--------------:|-----------------:|----------------------------------|
| **fibonacci 20** | 19.152 | 19.100 | 19.205 | 6.00% | Minor outliers, stable overall. |

### Benchmark summary on Arm64
### Benchmark summary
Results from the earlier run on the `c4a-standard-4` (4 vCPU, 16 GB memory) Arm64 VM in GCP (SUSE):

| **Benchmark** | **Average Time (µs)** | **Min (µs)** | **Max (µs)** | **Outliers (%)** | **Remarks** |
|--------------------|----------------------:|--------------:|--------------:|-----------------:|----------------------------------|
| **fibonacci 20** | 12.028 | 12.026 | 12.030 | 1.00% | Very stable performance, minimal variation. |

### Rust benchmarking comparison on Arm64 and x86_64

- The **Fibonacci (n=20)** benchmark demonstrated **consistent performance** with minimal deviation.
- **Average execution time** was around **12.028 µs**, indicating efficient CPU computation on **Arm64**.
- Only **1% outliers** were detected, showing **high stability** and **repeatability** of results.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ To create a virtual machine based on the C4A instance type:

![Create a Google Axion C4A Arm virtual machine in the Google Cloud Console with c4a-standard-4 selected alt-text#center](images/gcp-vm.png "Creating a Google Axion C4A Arm virtual machine in Google Cloud Console")

- Under **OS and Storage**, select **Change**, then choose an Arm64-based OS image. For this Learning Path, use **SUSE Linux Enterprise Server**. Pick the preferred version for your Operating System. Ensure you select the **Arm image** variant. Click **Select**.

- Under **OS and Storage**, select **Change**, then choose an Arm64-based OS image. For this Learning Path, use **SUSE Linux Enterprise Server**.
- If using use **SUSE Linux Enterprise Server**. Select "Pay As You Go" for the license type.
- Once appropriately selected, please Click **Select**.
- Under **Networking**, enable **Allow HTTP traffic**.
- Click **Create** to launch the instance.
- Once created, you should see a "SSH" option to the right in your list of VM instances. Click on this to launch a SSH shell into your VM instance:

![Invoke a SSH session via your browser alt-text#center](images/gcp-ssh.png "Invoke a SSH session into your running VM instance")

- A window from your browser should come up and you should now see a shell into your VM instance:

![Terminal Shell in your VM instance alt-text#center](images/gcp-shell.png "Terminal shell in your VM instance")

Next, let's install rust!