[PR #331] [MERGED] base: fix misleading log message in 30-nvidia.sh for container toolkit path #310

Closed
opened 2026-10-15 12:50:45 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/gow/pull/331
Author: @JBailes
Created: 5/3/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @JBailes

Base: master ← Head: fix/nvidia-toolkit-log-message


📝 Commits (3)

  • 883fd95 base: prefer host-injected nvrtc over baked-in CUDA 11.0, fix toolkit log message
  • 096559e ci: fix fork detection in docker-build-and-publish workflow
  • f217f24 ci: include variant suffix in fork-PR base image artifact lookup

📊 Changes

3 files changed (+52 additions, -16 deletions)

View changed files

📝 .github/workflows/docker-build-and-publish.yml (+22 -14)
📝 images/base/build-fedora/overlay/etc/cont-init.d/30-nvidia.sh (+15 -1)
📝 images/base/build/overlay/etc/cont-init.d/30-nvidia.sh (+15 -1)

📄 Description

Summary

  • Fix misleading log message: the container toolkit detection branch was logging "assuming it's using the nvidia driver volume" — the opposite of what's happening
  • In the same toolkit path, prefer any host-injected libnvrtc.so (registered in ldconfig outside /usr/local/nvidia/lib) over the baked-in CUDA 11.0 version
  • Fix fork PR CI: github.repository is always the base repo name even for fork PRs, so fork detection was always false and all PRs tried to push to ghcr.io/games-on-whales, failing with denied for external contributors

Changes

images/base/build*/overlay/etc/cont-init.d/30-nvidia.sh

Fix log message on the toolkit path (libnvidia-allocator.so.1 present, no /usr/nvidia volume).

After ldconfig runs, check if a libnvrtc.so is registered in the system cache from outside /usr/local/nvidia/lib — i.e. injected by the toolkit from the host's CUDA installation. If found, symlink it over the baked-in CUDA 11.0 version so gst-cuda picks up the newer one automatically.

Background: gst-cuda loads libnvrtc.so via ldconfig and treats nvrtcGetCUBIN* as optional — without them CUBIN is disabled but PTX still works and nvcodec encoding is unaffected. The image ships libnvrtc.so.11.0 (CUDA 11.0) as a fallback; nvrtcGetCUBINSize/nvrtcGetCUBIN were added in CUDA 11.1. On hosts with a full CUDA toolkit, the toolkit injects the host's libnvrtc at a standard system path — this change makes that version win over the baked-in 11.0.

.github/workflows/docker-build-and-publish.yml

Fix fork PR detection. github.repository is always the base repo (games-on-whales/gow) even when the PR comes from a fork, so the previous if github.repository == games-on-whales/gow check was always true — is_fork was never set, and the build always tried to push to ghcr.io/games-on-whales. For fork contributors whose GITHUB_TOKEN is read-only, this produced denied: installation not allowed to Write organization package.

Fix: compare github.event.pull_request.head.repo.full_name against github.repository on pull_request events. Push-to-master behaviour is unchanged.

Note: this fix takes effect once merged to master — it cannot retroactively fix CI on the current PR run since fork PRs execute the workflow from the base repo.

Test plan

  • Fork PR CI: build succeeds, image saved as artifact instead of pushed to registry
  • Non-fork PR / master push: no change in behaviour, still pushes to ghcr.io/games-on-whales
  • Container with toolkit + host CUDA 11.1+: logs Preferring host nvrtc, gst-cuda gets have_cubin = TRUE
  • Container with toolkit + no host CUDA: baked-in 11.0 used, no regression
  • Container with driver volume (/usr/nvidia): no change in behaviour

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/gow/pull/331 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 5/3/2026 **Status:** ✅ Merged **Merged:** 5/12/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `master` ← **Head:** `fix/nvidia-toolkit-log-message` --- ### 📝 Commits (3) - [`883fd95`](https://github.com/games-on-whales/gow/commit/883fd95ff30b380aa663fce36b28d48afe98bfbf) base: prefer host-injected nvrtc over baked-in CUDA 11.0, fix toolkit log message - [`096559e`](https://github.com/games-on-whales/gow/commit/096559e785760de796bfe18625ece5b3ab2c8a80) ci: fix fork detection in docker-build-and-publish workflow - [`f217f24`](https://github.com/games-on-whales/gow/commit/f217f24042dc2bd3c120e8539e582669ebfe2cd6) ci: include variant suffix in fork-PR base image artifact lookup ### 📊 Changes **3 files changed** (+52 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/docker-build-and-publish.yml` (+22 -14) 📝 `images/base/build-fedora/overlay/etc/cont-init.d/30-nvidia.sh` (+15 -1) 📝 `images/base/build/overlay/etc/cont-init.d/30-nvidia.sh` (+15 -1) </details> ### 📄 Description ## Summary - Fix misleading log message: the container toolkit detection branch was logging `"assuming it's using the nvidia driver volume"` — the opposite of what's happening - In the same toolkit path, prefer any host-injected `libnvrtc.so` (registered in ldconfig outside `/usr/local/nvidia/lib`) over the baked-in CUDA 11.0 version - Fix fork PR CI: `github.repository` is always the base repo name even for fork PRs, so fork detection was always false and all PRs tried to push to `ghcr.io/games-on-whales`, failing with `denied` for external contributors ## Changes ### `images/base/build*/overlay/etc/cont-init.d/30-nvidia.sh` Fix log message on the toolkit path (`libnvidia-allocator.so.1` present, no `/usr/nvidia` volume). After `ldconfig` runs, check if a `libnvrtc.so` is registered in the system cache from outside `/usr/local/nvidia/lib` — i.e. injected by the toolkit from the host's CUDA installation. If found, symlink it over the baked-in CUDA 11.0 version so `gst-cuda` picks up the newer one automatically. Background: `gst-cuda` loads `libnvrtc.so` via `ldconfig` and treats `nvrtcGetCUBIN*` as optional — without them CUBIN is disabled but PTX still works and nvcodec encoding is unaffected. The image ships `libnvrtc.so.11.0` (CUDA 11.0) as a fallback; `nvrtcGetCUBINSize`/`nvrtcGetCUBIN` were added in CUDA 11.1. On hosts with a full CUDA toolkit, the toolkit injects the host's `libnvrtc` at a standard system path — this change makes that version win over the baked-in 11.0. ### `.github/workflows/docker-build-and-publish.yml` Fix fork PR detection. `github.repository` is always the base repo (`games-on-whales/gow`) even when the PR comes from a fork, so the previous `if github.repository == games-on-whales/gow` check was always true — `is_fork` was never set, and the build always tried to push to `ghcr.io/games-on-whales`. For fork contributors whose `GITHUB_TOKEN` is read-only, this produced `denied: installation not allowed to Write organization package`. Fix: compare `github.event.pull_request.head.repo.full_name` against `github.repository` on `pull_request` events. Push-to-master behaviour is unchanged. Note: this fix takes effect once merged to master — it cannot retroactively fix CI on the current PR run since fork PRs execute the workflow from the base repo. ## Test plan - [ ] Fork PR CI: build succeeds, image saved as artifact instead of pushed to registry - [ ] Non-fork PR / master push: no change in behaviour, still pushes to `ghcr.io/games-on-whales` - [ ] Container with toolkit + host CUDA 11.1+: logs `Preferring host nvrtc`, gst-cuda gets `have_cubin = TRUE` - [ ] Container with toolkit + no host CUDA: baked-in 11.0 used, no regression - [ ] Container with driver volume (`/usr/nvidia`): no change in behaviour --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:50:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/gow#310
No description provided.