Skip to content

Add basic riscv64 architecture support#370

Draft
vhaudiquet wants to merge 5 commits into
canonical:mainfrom
vhaudiquet:riscv64
Draft

Add basic riscv64 architecture support#370
vhaudiquet wants to merge 5 commits into
canonical:mainfrom
vhaudiquet:riscv64

Conversation

@vhaudiquet

Copy link
Copy Markdown

This adds basic riscv64 architecture support.
It allows building the snap on riscv64, and then running basic commands:

ubuntu@p550:~$ inference-snaps-cli show-machine
cpus:
    - architecture: riscv64
      isa:
        - rv64imafdch
        - zicsr
        - zifencei
        - zba
        - zbb
        - sscofpmf
memory:
    total-ram: 16743100416
    total-swap: 0
disk:
    /var/lib/snapd/snaps:
        total: 125930070016
        avail: 14767624192
pci:
    - slot: "0000:00:00.0"
      bus-number: "0x0"
      device-class: "0x604"
      programming-interface: 0
      vendor-id: "0x1FE1"
      device-id: "0x2030"
      vendor-name: Beijing ESWIN Computing Technology Co., Ltd.
      device-name: EIC7700 Root Complex

The CPU detection shows available RISC-V ISA extensions, allowing for future riscv64 vector/matrix engine detection.

We can also run the engine selection code on test data:

ubuntu@p550:~$ inference-snaps-cli show-machine --format=json | inference-snaps-cli debug select-engine --engines test_data/engines/
❌ amd-gpu - not compatible: required device not found
❌ ampere - not compatible: required device not found
❌ ampere-altra - not compatible: required device not found
❌ arm-neon - not compatible: required device not found
✅ cpu - compatible, score = 12
❌ cpu-avx1 - not compatible: required device not found
❌ cpu-avx2 - not compatible: required device not found
❌ cpu-avx512 - not compatible: required device not found
❌ cpu-exptl - not compatible: required device not found
❌ cuda-generic - not compatible: required device not found
❌ example-memory - not compatible: insufficient memory, insufficient disk space, required device not found
❌ intel-cpu - not compatible: required device not found
❌ intel-gpu - not compatible: required device not found
❌ intel-npu - not compatible: required device not found
❌ not-compatible-engine - not compatible: required device not found
❌ rocm-generic - not compatible: required device not found
Selected engine for your hardware configuration: cpu

engines:
    - name: amd-gpu
      description: AMD specific engine targeting only one microarchitecture.
      vendor: Canonical Ltd
...

Scoped nvidia-smi part to amd64/arm64, with wrapper error message on riscv64
@farshidtz

Copy link
Copy Markdown
Member

This is a great addition, @vhaudiquet. Would you mind adding this to https://github.com/canonical/lscompute? We've moved the hardware_info package to a separate module and will just be referencing it here. We could merge and migrate it ourselves, but it would be better if it were authored by you directly.

@vhaudiquet

vhaudiquet commented Jun 5, 2026

Copy link
Copy Markdown
Author

Sure! That works for me. Should I close this then?

EDIT: Ah, maybe we need to keep the modification to snapcraft.yaml here. I can remove the other modifications and send them to lscompute

@farshidtz

Copy link
Copy Markdown
Member

I suggest focusing on the "lscompute" snap that is on the other side. We can then add anything that's useful to stack-utils. The stack-utils snap is only used for dev testing.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants