docker: make --nvidia actually work on hybrid GPU laptops; clear error when toolkit is missing#5
Merged
Merged
Conversation
b5917b4 to
e4a3b4d
Compare
|
@copilot resolve the merge conflicts in this pull request |
Merge conflicts resolved in commit |
Three closely related changes to docker_run.sh so the --nvidia path
actually renders Gazebo on the discrete GPU:
1. Always forward /dev/dri (instead of only in the non-nvidia branch).
The nvidia runtime by itself only ships NVIDIA's GL stack; without
/dev/dri the Mesa iris driver fails to query DRM and Ogre cannot
create a GLX/EGL screen, producing
MESA: error: Failed to query drm device.
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: iris
2. Pass __NV_PRIME_RENDER_OFFLOAD=1 and __GLX_VENDOR_LIBRARY_NAME=nvidia
so GLX is routed through NVIDIA's vendor library on hybrid laptops.
With this set, glxinfo -B reports
OpenGL vendor: NVIDIA Corporation
OpenGL renderer: NVIDIA GeForce GTX 1070 ...
3. Pre-flight check for the 'nvidia' runtime via `docker info`. If
the NVIDIA Container Toolkit is not installed/registered, the
bare docker error is the cryptic
unknown or invalid runtime name: nvidia
Print a clear message pointing to the install guide and the
`nvidia-ctk runtime configure --runtime=docker` + restart step,
and mention the fallback (omit --nvidia for the integrated GPU).
docs/setup.md is updated to mention the runtime registration step
alongside the toolkit install.
706cffa to
b6f1fc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
--nvidiaflag indocker_run.shwas effectively broken on hybrid Intel + NVIDIA laptops:/dev/driwas only forwarded in the non-nvidia branch. With--runtime nvidia, the integrated GPU is no longer visible, so the Mesa iris driver fails to query DRM and Gazebo's Ogre renderer cannot create a GLX/EGL screen. Result:unknown or invalid runtime name: nvidia), confusing workshop attendees who hadn't installednvidia-container-toolkit.This PR:
/dev/dri(with the hostvideo/renderGIDs) in all GUI modes — the nvidia path now has both NVIDIA and Mesa available.__NV_PRIME_RENDER_OFFLOAD=1+__GLX_VENDOR_LIBRARY_NAME=nvidiaso GLX uses NVIDIA's vendor library on hybrid systems. Verified:glxinfo -BreportsOpenGL renderer: NVIDIA GeForce GTX 1070 ....docker infocheck; if thenvidiaruntime is missing, prints install +nvidia-ctk runtime configureinstructions and a hint about the non-nvidia fallback.docs/setup.mdextended to mentionnvidia-ctk runtime configure --runtime=docker+ Docker restart.