-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rviz does not display meshes with GPU enabled #554
Comments
@tgaspar, thanks for reporting the issue, just for diagnostics purpose, would you please disable GPU and see if it works fine with software emulation? Thanks! |
can confirm this bug is also present in rviz2, which also uses ogre3d with gl fixed functions for rendering |
I can also reproduce this in ROS. I have attached some additional log files which may narrow down the issue.
The Docker image is built on top of Ubuntu 18.04 with the kisak-mesa PPA enabled and installed. ROS melodic is installed, along with the Fetch robot packages. Here is my Dockerfile, build and run scripts which may help reproduce the issue. It may reqiure some modification and is certainly not a minimal reproducable example, but hopefully a good start.
# syntax=docker/dockerfile:labs
ARG UBUNTU_DISTRIBUTION
FROM ubuntu:${UBUNTU_DISTRIBUTION}
# Allow downloaded packages to be cached
RUN <<EOF
mv /etc/apt/apt.conf.d/docker-clean /etc/apt
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/docker-keep-downloaded-packages
EOF
# Update the default Ubuntu mirror
ARG UBUNTU_MIRROR
RUN <<EOF
sed --in-place --regexp-extended "s/(\/\/)(archive\.ubuntu)/\1${UBUNTU_MIRROR}.\2/" /etc/apt/sources.list
EOF
# Unminimize the Ubuntu image
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
yes | unminimize
EOF
# Update the default locale
ARG LANGUAGE
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
apt-get update
apt-get install --assume-yes --no-install-recommends locales
EOF
RUN <<EOF
sed --in-place --regexp-extended "/${LANGUAGE}.UTF-8/s/^# //g" /etc/locale.gen
dpkg-reconfigure --frontend noninteractive locales
update-locale LANG=${LANGUAGE}.UTF-8
EOF
ENV LANG="${LANGUAGE}.UTF-8"
ENV LC_ALL="${LANGUAGE}.UTF-8"
# Update the default timezone
ARG TIMEZONE
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
apt-get update
apt-get install --assume-yes --no-install-recommends tzdata
EOF
RUN <<EOF
ln --force --symbolic /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
EOF
ENV TZ="${TIMEZONE}"
# Install latest Mesa for Windows Subsystem for Linux
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
apt-get update
apt-get install --assume-yes --no-install-recommends software-properties-common
add-apt-repository ppa:kisak/turtle --yes
apt-get update
apt-get install --assume-yes --no-install-recommends mesa-utils
EOF
# Install ROS packages
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
apt-get update
apt-get install --assume-yes --no-install-recommends curl gnupg2
EOF
ARG ROS_DISTRIBUTION
ARG ROS_PACKAGE
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
curl --location --show-error --silent https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/ros-keyring.gpg
echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros.list
apt-get update
apt-get install --assume-yes --no-install-recommends ros-${ROS_DISTRIBUTION}-${ROS_PACKAGE}
EOF
# Install Fetch packages
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
apt-get update
apt-get install --assume-yes --no-install-recommends ros-${ROS_DISTRIBUTION}-fetch-gazebo-demo
EOF
# Install developer packages
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
apt-get update
apt-get install --assume-yes --no-install-recommends bash-completion curl less sudo tmux unzip vim wget zip
bash -c "$(curl --location --show-error --silent https://starship.rs/install.sh)" -- --yes
EOF
# Create a user account
ARG USERNAME
RUN <<EOF
groupadd ${USERNAME}
useradd --create-home --gid ${USERNAME} --shell /bin/bash --skel /dev/null ${USERNAME}
echo "$USERNAME ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME}
chmod 440 /etc/sudoers.d/${USERNAME}
EOF
# Add user files
ADD --chown=${USERNAME} ./files/ /home/${USERNAME}/
RUN <<EOF
sed --in-place --regexp-extended "s/ROS_DISTRIBUTION/${ROS_DISTRIBUTION}/g" /home/${USERNAME}/.bashrc
EOF
# Disallow downloaded packages to be cached
RUN <<EOF
mv /etc/apt/docker-clean /etc/apt/apt.conf.d
rm --force --recursive /etc/apt/apt.conf.d/docker-keep-downloaded-packages
EOF #!/usr/bin/env bash
docker image build \
--build-arg LANGUAGE="en_US" \
--build-arg ROS_DISTRIBUTION="melodic" \
--build-arg ROS_PACKAGE="desktop" \
--build-arg TIMEZONE="Australia/Melbourne" \
--build-arg UBUNTU_DISTRIBUTION="bionic" \
--build-arg UBUNTU_MIRROR="au" \
--build-arg USERNAME="scott" \
--progress plain \
--tag fetch \
. docker container run \
--device /dev/dxg \
--env DISPLAY="$DISPLAY" \
--env LD_LIBRARY_PATH="/usr/lib/wsl/lib" \
--env PULSE_SERVER="$PULSE_SERVER" \
--env WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
--env XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
--gpus all \
--interactive \
--rm \
--tty \
--user scott \
--volume /mnt/wslg:/mnt/wslg \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume /usr/lib/wsl:/usr/lib/wsl \
--workdir /home/scott \
fetch I use this launch file to test RVIZ. <launch>
<!-- <env name="LIBGL_ALWAYS_SOFTWARE" value="true" /> -->
<param name="robot_description" textfile="$(find fetch_description)/robots/fetch.urdf" />
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"></node>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"></node>
<node args="--display-config $(dirname)/fetch.rviz --ogre-log --verbose" name="rviz" pkg="rviz" output="screen" type="rviz"></node>
</launch> Here are the additional logs from RVIZ and Ogre that may help narrow down the issue.
As discussed |
Same bug here : Bug : Setting LIBGL_ALWAYS_SOFTWARE=true shows the meshes, but rendered using CPU instead of GPU which is slow and is not a proper solution. |
Same issue on win11 Pro build 22000.795
-Workaround: must disable GPU hardware rendering using LIBGL_ALWAYS_SOFTWARE=1 Has there been any fix on this so GPU rendering can be used? |
This issue is still persistent. |
Issue persistent with environment:
But works on CPU setting LIBGL_ALWAYS_SOFTWARE=1 with reduced performance. |
@KaneLindsay, thanks for checking out, yes, this is the issue in Linux graphics driver provided via WSL, graphics vendor develops the special Linux graphics driver for WSL and we will need to have them to address it, but unfortunately it has not been address. If you don't mind, what version of graphics driver do you have? thanks! |
@hideyukn88 I see, I am using Nvidia graphics driver version 536.40. |
This issue is still persistent.Please tell me if anyone has the solutions. |
yeah still an issue up to this day sadly |
For me, the solution was to update the Mesa drivers using a PPA like here: microsoft/WSL#6154 (comment) Check your OpenGL version via ❯ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Microsoft Corporation (0xffffffff)
Device: D3D12 (Intel(R) Iris(R) Xe Graphics) (0xffffffff)
Version: 23.2.1
Accelerated: yes
Video memory: 32724MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.1
Max compat profile version: 4.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (Intel(R) Iris(R) Xe Graphics)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
... It should use the GPU via D3D12 and a core profile version of 4.x |
Environment
Steps to reproduce
Launch any MoveIt demo launchfiles. Open Rviz, load the
RobotModel
plug-in.WSL logs:
pulseaudio.log
weston.log
versions.txt
Expected behavior
Rviz would display the 3D meshes.
Actual behavior
Rviz opens up using the Nvidia GPU. See below for the logs from Rviz. I then load the
RobotModel
andTF
plug-ins. As seen in the screenshot, the coordinate frames get displayed correctly, but the meshes from the robot model do not.The text was updated successfully, but these errors were encountered: