Skip to content

streamer(vulkan): prioritize capable dGPUs and fix AppImage GLib clash - #989

Closed
quadsteel wants to merge 1 commit into
OpenCloudGaming:devfrom
quadsteel:fix/linux-hybrid-gpu-vulkan-selection
Closed

quadsteel wants to merge 1 commit into
OpenCloudGaming:devfrom
quadsteel:fix/linux-hybrid-gpu-vulkan-selection

Conversation

@quadsteel

Copy link
Copy Markdown

Summary

Resolves Vulkan hardware initialization failure, Wayland syncobj teardown crash, and AppImage driver loading conflicts on Linux hybrid GPU (Intel/NVIDIA) systems:

  1. Intelligent Vulkan Device Selection & Scoring (native/opennow-streamer-platform-linux):

    • Replaces unconditional device index 0 binding with capability scoring.
    • Prioritizes discrete GPUs (DISCRETE_GPU) over integrated GPUs (INTEGRATED_GPU).
    • Evaluates PRIME render offload variables (__NV_PRIME_RENDER_OFFLOAD=1, DRI_PRIME=1) and user overrides (OPENNOW_VK_DEVICE_INDEX, OPENNOW_VK_VENDOR_ID).
    • Verifies queue isolation (GRAPHICS, VIDEO_DECODE_KHR, COMPUTE, TRANSFER) and iterates over candidate devices with graceful fallback if a candidate fails initialization.
  2. Clean Teardown for Wayland Surfaces (LinuxVulkanGraphics.cpp, vulkan_device.rs):

    • Calls vkDeviceWaitIdle() before instance destruction and buffer release, ensuring sync objects and timeline semaphores (wp_linux_drm_syncobj) are drained cleanly before teardown.
  3. AppImage GLib/GObject Host Exclusion (qt-build.yml, qt-release-candidate.yml):

    • Excludes libglib-2.0.so.0, libgobject-2.0.so.0, libgio-2.0.so.0, and libgmodule-2.0.so.0 from linuxdeploy bundling to prevent symbol collisions (undefined symbol: g_string_copy) when loading host VA-API drivers.

Verification

  • Live Hybrid GPU Host (Intel UHD 630 + NVIDIA RTX 2060):
    ./build/opennow-qt/opennow-qt --smoke-test --allow-multiple-instances --reduced-motion
    • Correctly auto-selected NVIDIA GeForce RTX 2060 (vendor 0x10de, device 0x1f15).
    • Codecs and queue isolation initialized successfully (h264, h265).
    • Clean shutdown with exit code 0 without syncobj assertion or SIGSEGV.
  • Unit & Integration Tests:
    • cargo test --manifest-path native/opennow-streamer/Cargo.toml --workspace: 183 passed, 0 failed.
    • cargo test --manifest-path native/opennow-core/Cargo.toml: 248 passed, 0 failed.
    • ctest --test-dir build/opennow-qt -R opennow-embedded-orchestration-tests -V: 98 passed, 0 failed.
    • python3 -m unittest opennow-qt/tests/test_ci_workflow.py opennow-qt/tests/test_bundled_deb.py: 21 passed.
    • npm run locales:check: passed.

- Filter and score Vulkan physical devices based on video decode queue
  isolation and PRIME offload variables instead of indexing device 0.
- Fall through to alternative physical devices when queue isolation fails.
- Exclude host GLib and GObject binaries from the AppImage packaging pipeline
  to resolve host VA-API driver dlopen symbol clashes.
- Ensure proper sync object drain before Vulkan teardown under Wayland.
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 497816a4-f119-42c4-81cc-f4008f0ce0c0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@capy-ai

capy-ai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for this — the hybrid-GPU scoring, vkDeviceWaitIdle teardown, and AppImage GLib exclusion all check out, and I verified the approach locally.

I couldn't push to your fork from this environment, so I opened #992 carrying your commit verbatim (authorship preserved) plus a small fix-up commit on top:

  • The two new scoring tests mutated process-wide env vars, which flaked when cargo ran them on parallel threads — scoring now takes an explicit preferences value with a thin from_env wrapper, and the tests exercise the pure function.
  • cargo fmt for the touched package (CI's formatting check was failing on Linux/macOS), a clippy::unnecessary_sort_by cleanup, and two small Rust nits (redundant unsafe, CString::unwrap → graceful fallback).

Once #992 goes green I'll merge it and close this one as superseded. Your commit stays yours in history.

@capy-ai

capy-ai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Superseded by #992, which carries your commit verbatim plus the CI fixes — merged into dev. Thanks again for the fix!

@capy-ai capy-ai Bot closed this Sep 19, 2026
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.

1 participant