ros2 / rviz

ROS 3D Robot Visualizer
BSD 3-Clause Clear License
296 stars 212 forks source link

rviz2 screen flickering when enable HiDPI #1052

Open byeongkyu opened 1 year ago

byeongkyu commented 1 year ago

ROS2 distro: Humble Issue: rviz2 screen flickering when enable HiDPI

When running rviz2, if environment variables such as QT_ENABLE_HIGHDPI_SCALING that activate hidpi are set, the main 3D screen flickers severely. Of course, one can use the option QT_ENABLE_HIGHDPI_SCALING=0 to deactivate hidpi, but then the proportions of the internal components are slightly off. I'm curious about what's causing this issue.

clalancette commented 1 year ago

We don't have a great idea on what could be causing this. It could be a graphics driver problem or maybe something in one of the underlying libraries (OGRE or Qt). Can you please give us a lot more information about your platform, including the graphics card, driver, Linux kernel, etc?

byeongkyu commented 1 year ago

@clalancette In my opinion, this doesn't seem to be a problem unique to me. It's a common issue on all HiDPI systems I've experienced. The graphics card I'm currently using is Nvidia, and the issue occurs on both the 20 series and 30 series. I will attach detailed spec information.

OS: Ubuntu 22.04.3 LTS x86_64 CPU: 12th Gen Intel i9-12900KF (24) @ 5.100GHz GPU: NVIDIA 01:00.0 NVIDIA Corporation Device 2203 DE: GNOME 42.9 Shell: bash 5.1.16 Kernel: 6.2.0-26-generic

fprott commented 11 months ago

When running rviz2, if environment variables such as QT_ENABLE_HIGHDPI_SCALING that activate hidpi are set, the main 3D screen flickers severely.

I also got that flickering issue but changing the QT_ENABLE_HIGHDPI_SCALING variable seems not to help. Can you explain how you set the system variable? Just export QT_ENABLE_HIGHDPI_SCALING=0 has no effect for me.

byeongkyu commented 11 months ago

@fprott

When using a high-resolution monitor (4K), it's common to set the display scale to 200%. If the QT_ENABLE_HIGHDPI_SCALING option is not used in this case, the size of Qt's resources may not match, leading to misaligned UI sizes. Of course, it's possible to use it without turning on the QT_ENABLE_HIGHDPI_SCALING option, but isn't it necessary for a more beautiful UI?

vembacher commented 10 months ago

When running rviz2, if environment variables such as QT_ENABLE_HIGHDPI_SCALING that activate hidpi are set, the main 3D screen flickers severely.

I also got that flickering issue but changing the QT_ENABLE_HIGHDPI_SCALING variable seems not to help. Can you explain how you set the system variable? Just export QT_ENABLE_HIGHDPI_SCALING=0 has no effect for me.

Changing QT_SCREEN_SCALE_FACTORS to 1 for each display output worked for me when QT_ENABLE_HIGHDPI_SCALING did not help.

Just echo the variable, then export it with the altered value and finally launch rviz2 from the same shell.

TheRealBeef commented 4 months ago

Cross-posting from the related topic.

I have the same issue, but it persists regardless of the DPI setting for me. I also tried setting via commandline the QT_SCREEN_SCALE_FACTORS=1 and also unsetting the scale factors as well.

I'm running Ubuntu 22.04 on a laptop with Nvidia GPU and this happens both in Mate and in KDE desktops - although with KDE I can do what's in the original post of issue #1079 and stop compositing so it doesn't flicker - so long as I don't alter the size of the windows. Once they've been altered in any way then it starts flickering and won't stop.

It flickers not just the world visualization but also any images that are displayed in their own boxes as well.

themightyoarfish commented 1 day ago

For me, unsetting QT_SCALE_FACTOR (was 2) makes it not flicker, but then the UI is obviously too small to really interact with.