Skip to content

GCC 13 cannot parse full RISC-V ISA string from /proc/cpuinfo #25

Closed

Description

@gounthar

When building projects that auto-detect CPU features from /proc/cpuinfo, GCC 13.3.0 (shipped with Ubuntu 24.04) fails to parse the full ISA string:

cc: error: '-march=rv64gc_zfh_v_zvfh_zicbop_zihintpause': unexpected ISA string at end: 'v_zvfh_zicbop_zihintpause'

GCC 14.2.0 (Debian Trixie) handles the same ISA string correctly. The runner hardware reports a very long ISA string in /proc/cpuinfo with many extensions (zicbop, zihintpause, zicond, etc.) that GCC 13 does not recognize.

This affects projects like llama.cpp that read /proc/cpuinfo to set -march flags. Workaround is to disable native detection and use a safe base like rv64gc.

Not sure if upgrading to GCC 14 is feasible for the runner image, but worth noting for parity. The standard GitHub ubuntu-24.04 x86_64 runners ship GCC 13 too, but x86 ISA detection does not hit this issue because the extension naming is different.

Activity

  1. gounthar commented on Mar 25, 2026

    @gounthar
    Author

    Additional finding: GCC 13 in pedantic mode also rejects _Float16 on riscv64:

    error: ISO C does not support the '_Float16' type [-Werror=pedantic]
    

    GCC 14 handles this without issue. Both problems (ISA string parsing and _Float16 support) are resolved by GCC 14, which ships in Debian Trixie and Ubuntu 25.04.

  2. gounthar commented on Mar 25, 2026

    @gounthar
    Author

    I see there is an ubuntu-26.04 runner image in this repo. Is it available as a runner label (e.g. ubuntu-26.04-riscv)? Ubuntu 26.04 ships GCC 14, which would resolve both issues above.

  3. luhenry commented on Mar 25, 2026

    @luhenry
    Member

    Is it available as a runner label (e.g. ubuntu-26.04-riscv)? Ubuntu 26.04 ships GCC 14, which would resolve both issues above.

    Ubuntu 26.04 is compiled for RVA23, which the current EM-RV1 do not support (and will never support). Until we have the EM-RV2 as the host, we won't be able to run ubuntu-26.04-riscv.

  4. gounthar commented on Mar 25, 2026

    @gounthar
    Author

    Good to know about the RVA23 requirement. That rules out ubuntu-26.04-riscv for now.

    For projects that need GCC 14 (like llama.cpp where GCC 13 cannot parse the full ISA string from /proc/cpuinfo and rejects _Float16 in pedantic mode), would it be feasible to install GCC 14 from a PPA or backport on the 24.04 image? Or is the safer approach to just document these GCC 13 limitations and let projects work around them?

  5. luhenry commented on Mar 26, 2026

    @luhenry
    Member

    For projects that need GCC 14 (like llama.cpp where GCC 13 cannot parse the full ISA string from /proc/cpuinfo and rejects _Float16 in pedantic mode), would it be feasible to install GCC 14 from a PPA or backport on the 24.04 image? Or is the safer approach to just document these GCC 13 limitations and let projects work around them?

    I’m torn between diverging from official GitHub Actions runner image, and the obviousness of needing to be on a later GCC given the speed of development on RISC-V still. Would it be doable to have it installed but not selected by default, and it’s just a update-alternatives away?

  6. gounthar commented on Mar 26, 2026

    @gounthar
    Author

    That sounds like a good compromise. Projects that need GCC 14 can add one line to their workflow:

    - run: sudo update-alternatives --set gcc /usr/bin/gcc-14

    The default stays GCC 13 for parity with the official runner image, but GCC 14 is there when needed. This matches how the official ubuntu images ship multiple GCC versions too.

    For the llama.cpp case specifically, it would unblock native builds with full ISA detection and _Float16 support.

  7. gounthar commented on Mar 29, 2026

    @gounthar
    Author

    Another finding: the Python installations in /opt/python-3.x/ are missing standard library modules (e.g. math). Using them as the base Python for venv creation fails:

    ModuleNotFoundError: No module named 'math'
    

    The system Python (/usr/bin/python3) works fine with apt-get install python3-venv python3-pip. For now that is a reliable workaround.

  8. gounthar commented on Mar 29, 2026

    @gounthar
    Author

    Follow-up: ensurepip is also broken with system Python (python3.12 from Ubuntu 24.04). Even after apt-get install python3-venv python3-pip, python3 -m venv /tmp/test fails with the same ensurepip error.

    Workaround: python3 -m venv --without-pip then curl https://bootstrap.pypa.io/get-pip.py | python3.

  9. luhenry commented on Mar 30, 2026

    @luhenry
    Member

    Another finding: the Python installations in /opt/python-3.x/ are missing standard library modules (e.g. math). Using them as the base Python for venv creation fails:

    ModuleNotFoundError: No module named 'math'
    

    The system Python (/usr/bin/python3) works fine with apt-get install python3-venv python3-pip. For now that is a reliable workaround.

    Please fill up another issue for that, again to make sure we can track it properly.

  10. gounthar commented on Mar 30, 2026

    @gounthar
    Author

    Done, opened #29 for the Python issue.

  11. self-assigned this
    on Apr 4, 2026
  12. luhenry commented on Apr 4, 2026

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions