Skip to content

Conversation

alitariq4589
Copy link
Contributor

I have added the RISC-V CI for running RISC-V RVV 1.0 hardware

@github-actions github-actions bot added the devops improvements to build systems and github actions label Jun 29, 2025
@alitariq4589
Copy link
Contributor Author

Still refactoring.

@alitariq4589 alitariq4589 changed the title Changed the CI file to hw Added CI with RISC-V Hardware Jun 29, 2025
@alitariq4589 alitariq4589 changed the title Added CI with RISC-V Hardware Added CI with RISC-V RVV1.0 Hardware Jun 29, 2025
@alitariq4589
Copy link
Contributor Author

I have updated the CI file in the repository to run on real RISC-V hardware with RVV 1.0, instead of using QEMU.

A working CI log on RISC-V Jupiter board can be seen here.

@ggerganov Your credentials were already added, you just have to add a webhook for the project (unless the credentials have expired). Webhook was previously disabled somehow. It would be great if you could add the webhook again.

You will just have to add the following details to the webhook settings of the repository.

image

In the events, select Pull requests and Pushes.

Once you have added this, I will try to test by creating a PR (which I will close later if the build is triggering).

@alitariq4589 alitariq4589 reopened this Jun 29, 2025
@alitariq4589
Copy link
Contributor Author

Reference PR: #3160

@alitariq4589
Copy link
Contributor Author

Bumping this PR for adding CI on RISC-V.

@alitariq4589
Copy link
Contributor Author

I have now added a github CI instead of Jenkins for RISC-V vector. You will just have to go to this link and add the github runner token with the repository URL. The compute machine Banana Pi BPI-F3 is a physical RISC-V board which has RVV1.0, so if you choose it, CI will run on RVV1.0. Plus, I will remove the 90-day unregistration limit so the project stays registered.

This does not require Jenkinsfile to be merged; github CI will run using github actions/workflows.

@ggerganov
Copy link
Member

@alitariq4589 How to obtain a "Github Runner Token"?

@alitariq4589
Copy link
Contributor Author

@ggerganov

In your repository, navigate to Settings -> Actions -> Runners -> New self-hosted runner, and retrieve the token at the end and the repository link. Once you register, I will remove the 90-day limit from this repository, allowing you permanent CI access, as it is an active repository.

This may also need a workflow file for running on RISC-V. I will change the already added script to be github native workflow file instead of a Jenkins pipeline.

Selection_002

On the next page...

Selection_003

@ggerganov
Copy link
Member

Thanks. I have completed the registration of the runner in cloud-v. Anything else needed on my side?

@alitariq4589
Copy link
Contributor Author

@ggerganov

Thanks. I can see it is registered in the database. There is nothing needed from your side at the moment. I will delete the Jenkinsfile, which was previously added for Cloud-V for QEMU, and then will add a GitHub Actions file for compilation and running on RISC-V.

Once that is done, this PR will have to be merged.

@alitariq4589
Copy link
Contributor Author

@ggerganov

I think you may have added the expired token. I am getting an authentication error inside GitHub Actions.

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

# Authentication

Http response code: NotFound from 'POST https://api.github.com/actions/runner-registration' (Request Id: AB16:21A34E:7A84D:860C3:689B253A)
{"message":"Not Found","documentation_url":"https://docs.github.com/rest","status":"404"}
Response status code does not indicate success: 404 (Not Found).

I am removing this registration. Can you please add it again?

@ggerganov
Copy link
Member

Just to make sure - do I need to actually create the runner in the Github settings, or just to copy the token from the page?

@alitariq4589
Copy link
Contributor Author

@ggerganov You just have to copy the repo link and token and paste it in the fields on the page https://cloud-v.co/github-riscv-runner and submit.

I don't exactly know how long the token is valid for github, but if it has expired, then we get the same kind of error as I posted above.

@ggerganov
Copy link
Member

Should be good now - can you confirm?

@alitariq4589
Copy link
Contributor Author

I am getting the same error again inside the logs. This is strange. I never got this error from any registration before if the token is valid.

Let me quickly check manually if I can curl through the token and repository URL.

@alitariq4589
Copy link
Contributor Author

From what I can see in the curl output, there is some issue with how the token is generated.

HTTP/2 401 
date: Tue, 12 Aug 2025 11:54:37 GMT
content-type: application/json; charset=utf-8
content-length: 109
x-github-media-type: github.v3; format=json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
x-ratelimit-reset: 1755003119
x-ratelimit-used: 3
x-ratelimit-resource: core
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
vary: Accept-Encoding, Accept, X-Requested-With
server: github.com
x-github-request-id: B8C4:1B362B:D62C2:EAF39:689B2B7C

{
  "message": "Bad credentials",
  "documentation_url": "https://docs.github.com/rest",
  "status": "401"
}

According to github documentation for rest api:

Failed login limit
If you try to use a REST API endpoint without a token or with a token that has insufficient permissions, you will receive a 404 Not Found or 403 Forbidden response. Authenticating with invalid credentials will initially return a 401 Unauthorized response.

After detecting several requests with invalid credentials within a short period, the API will temporarily reject all authentication attempts for that user (including ones with valid credentials) with a 403 Forbidden response. For more information, see Rate limits for the REST API.

@alitariq4589
Copy link
Contributor Author

@ggerganov

Can you do the following to check if the token you are generating is valid from your side? As I have read from the docs, the token is valid for 1hour. You can also generate a PAT with repository scope and check if that works.

Get the github actions package from your end (linux-x64):

# Create a folder
mkdir actions-runner && cd actions-runner
# Download the latest runner package
curl -O -L https://github.com/actions/runner/releases/download/v2.327.1/actions-runner-linux-x64-2.327.1.tar.gz
# Extract the installer
tar xzf ./actions-runner-linux-x64-2.327.1.tar.gz

You can try the following commands to check if the token you are generating is valid. PAT is different from the github runner token.

Examples:
 Check GitHub server network connectivity:
  ./run.sh --check --url <url> --pat <pat>
 Configure a runner non-interactively:
  ./config.sh --unattended --url <url> --token <token>
 Configure a runner non-interactively, replacing any existing runner with the same name:
  ./config.sh --unattended --url <url> --token <token> --replace [--name <name>]
 Configure a runner non-interactively with three extra labels:
  ./config.sh --unattended --url <url> --token <token> --labels L1,L2,L3

Please let me know what you get from this. As I have checked, I can register the repositories from my side without any issue. If I remember it correctly I had an issue with the generated token in the past too. Maybe there is something different with how the tokens are generated in llama.cpp repo? 🤔

@ggerganov
Copy link
Member

Doing these instructions worked. Let me try to recreate using the token from the llama.cpp repo (before I was using the token from the ggml-org organization).

Please remove the old registration so I can create a new one.

@alitariq4589
Copy link
Contributor Author

That explains the issue. I am outside right now. I will message you after removing the token after a while.

(Hopefully this will work out this time. And sorry for prolonged setup issue 😅)

@alitariq4589
Copy link
Contributor Author

@ggerganov, I have removed the runner. You can add the token. Be sure to add the token of repo scope instead of organization scope, as I have not yet added any organization-specific functionality.

@ggerganov
Copy link
Member

ETA 30 min (afk atm)

@alitariq4589
Copy link
Contributor Author

ETA 30 min (afk atm)

No worries

@ggerganov
Copy link
Member

@alitariq4589 Should be up now.

@alitariq4589
Copy link
Contributor Author

Thanks a lot @ggerganov and sorry for taking your time

It's working now. I will now be moving to workflow part.

BTW, if you need anything RISC-V related, let me know.


--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

# Authentication


√ Connected to GitHub

# Runner Registration




√ Runner successfully added
√ Runner connection is good

# Runner settings


√ Settings Saved.


√ Connected to GitHub

Current runner version: '2.321.0'
2025-08-12 16:46:43Z: Listening for Jobs
Runner update process finished.
An error occurred: A package with type agent, platform linux-riscv64, version 2.327.1 was not found.
Runner listener exit with retryable error, re-launch runner in 5 seconds.
Restarting runner...

√ Connected to GitHub

Current runner version: '2.321.0'
2025-08-12 16:48:07Z: Listening for Jobs

@ggerganov
Copy link
Member

No problem and thank you for providing hardware for the CI - appreciated!

…ctions workflow

Removed the legacy .devops/cloud-v-pipeline Jenkins CI configuration and introduced .github/workflows/build-riscv-native.yml for native RISC-V builds using GitHub Actions.
Replace Jenkins Cloud-V pipeline with GitHub Actions RISC-V native build
@alitariq4589
Copy link
Contributor Author

@ggerganov The workflow file is added. @akifejaz has replicated an already-added CI file according to RISC-V and removed the old cloud-v-pipeline file.

Now, the CI should run on riscv on pull request creation.

You'll be able to merge this now.

@ggerganov ggerganov merged commit 648ebcd into ggml-org:master Aug 13, 2025
2 checks passed
alitariq4589 added a commit to alitariq4589/llama.cpp that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants