google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.07k stars 807 forks source link

AMD GPU: GUI is rendered incorrectly all over the window #639

Open Juri-3D opened 1 year ago

Juri-3D commented 1 year ago

Hey, I had to switch to a new computer and while the simulations are running as always, I can't use the simulate.exe anymore. The GUI is rendered all over the place (see screenshot). The buttons are still clickable on the left black panel, although not visible.

The PC: ASRock X670E Pro RS AMD Ryzen 5 7600X (with integrated graphics) 32GB RAM M.2 SSD AMD Radeon RX 6800 XT Windows 11 22H2 (22621.819)

I've tried the latest AMD Adrenalin (22.5.1 and 22.11.1) and PRO (22Q4) graphics driver versions. I've tried different mujoco releases (2.3.0, 2.3.1) and built it from the source code, always with the same result. Any help is appreciated.

Win11_mujoco_simulate
saran-t commented 1 year ago

Can you try disabling DPI scaling?

Juri-3D commented 1 year ago

Can you try disabling DPI scaling?

I did, but nothing changed. An addition to the specs above: I have two monitors, one with 1080p and one with 4k. But I already used those screens on the old PC.

saran-t commented 1 year ago

Hard for me to make suggestions without being able to reproduce the issue. Are you comfortable with C programming? I'd recommend writing a minimal application that just compiles a model, sets up a rendering context, renders an image, dumps to file, and see if you can get something sensible.

Alternatively, if you can install Python, you can transcribe our tutorial Colab into a small Python script (specifically, just only as far as the first image rendered) and see if you can get the correct image.

Juri-3D commented 1 year ago

Sadly I'm a mechanical engineer with little experience in C or Python. The issue, however, seems not related to the simulation environment. I can open any example model or my complex models with the "basic.exe" and they are rendered and run perfectly fine. Only the clickable buttons/menus of the "simulate.exe" are broken.

Ocanath commented 1 year ago

I have the same issue. New laptop with AMD Ryzen 5 PRO 6650U with Radeon Graphics, and up to date drivers (Adrenalin Edition Version 22.11.2).

I used the prebuilt simulate.exe binary of mujoco release 2.3.2. I also built simulate.exe from source, same exact issue as the release version.

image

UI renders like this, with a lot of flickering.

basic.exe also works for me

I suspect this is an issue with AMD graphics specifically, since that seems to be the common element with me and @Juri-3D

Leo428 commented 1 year ago

This is happening to me as well. My laptop has AMD CPU and GPU (Lenovo Z16). I remember simulate.exe worked in late 2022.

saran-t commented 1 year ago

@Leo428 Can I please ask you to go through each binary release version one-by-one to see when the error first occurred?

Leo428 commented 1 year ago

@saran-t I tried as far back as version 2.1.2 and the problem persists on my laptop (Windows 11 and AMD chips). I also tested it on my windows 10 PC with an intel CPU and Nvidia GPU and version 2.3.2 worked fine.

Since I reinstalled my laptop's system in late 2022, I guess it's most likely a driver issue caused by either windows 11 or AMD updates.

Ocanath commented 1 year ago

Forgot to mention, I'm running windows 10

Shavdrag commented 1 year ago

I had the same issue, but it worked after adding simulate.exe of the mujoco folder in the NVIDIA Control Panel program settings and set the preferred graphics processor to the NVIDIA GPU. I think the program tried to use the integrated graphics of my laptop and somehow that caused a problem

ArtifixPrime commented 1 year ago

It seems to be a GPU driver issue. I also have a Radeon GPU and the issue resolved when I downgraded the driver. The version I'm currently using is Adrenalin 22.5.1

rajuptvs commented 1 year ago

I am also having a similar issue on amd based cpu, but haven't faced the issue on my other intel based cpu.

saran-t commented 1 year ago

I should've thought of this ages ago, but could people who are running into this problem please try setting the environment variables MUJOCO_GL_DEBUG=1 and LIBGL_DEBUG=verbose, and see if you get any message?

saran-t commented 1 year ago

I just got hold of a Windows AMD machine for the first time today, and while I haven't been able to reproduce anything nearly as garbled as the screenshots posted in this thread, I can nevertheless see that the UI panels are not aligned correctly.

Can I please ask anyone affected who's still following this thread to verify:

Thanks!

NghiaPhamttk27 commented 1 year ago

The issue of the display being cut off still exists on my laptop. When I press Tab and Shift+Tab, the display returns to normal, but, of course, the user cannot interact with the UI panes. So, it is very likely that this issue is with the two interface panes. You can watch the video below. screen-capture (1).webm

saran-t commented 12 months ago

Could you please patch the following, launch the viewer (both with and without a model loaded), and post screenshots here? This patch replaces the side panels with solid blocks of colours, hopefully this will help us better understand what operation is causing the problem.

0001-Set-debug-colors.patch

NghiaPhamttk27 commented 12 months ago

I followed your instructions both with a model and without a model. In the case with a model, even when I press Shift+Tab, I can't see the model as before. You can check the two videos below. With humanoid model.webm without model.webm

saran-t commented 12 months ago

Thanks. Unfortunately that's not at all what I expected to see (not that I know what I expected to see, but certainly not that!).

This means that I still can't repro this problem fully. Might take a while to get this figured out.

NghiaPhamttk27 commented 12 months ago

Yeah, it's quite sad to hear. I still hope the issue can be resolved because I can't have an Nvidia GPU as a replacement anytime soon.

Xiaxuli commented 12 months ago

image help, why did I click simulate.exe and then the window flashed back

saran-t commented 11 months ago

Interestingly, the new bug report #1144 shows an identical screenshot to what I saw on last week. Note that it's much less garbled than what's posted here thus far, but still wrong.

codeslord commented 11 months ago

I have a laptop with AMD Internal GPU as well as Nvidia GPU running Windows 11. After recent AMD graphics driver update I faced the same issue. The way I fixed the issue is that, I went to Windows Settings->System->Display->Graphics and under Custom options for apps, clicked browse, chose the Simulate.exe. Once I have added the custom app, selected MuJoCo->Options and instead of let windows decide, chose my NVIDIA Graphics card as my Graphics Preference. Now it works fine.

image
Xiaxuli commented 11 months ago

Thank you for your reply, but I tried your method, but it still did not solve the problem that the click could not open 1699975017347

rkourdis commented 10 months ago

@saran-t I have the exact same issue as the screenshot in #1144 with AMD driver 23.12.1 (on Ryzen 7 6800U). This is on a local build using VS 2022.

Interestingly enough, downgrading to 22.5.1 fixes the GUI and everything renders well (I remember trying a couple of different driver versions a while ago). That might give some hints as to what's going on.

girishkolli commented 8 months ago

I just started off with Mujoco and I faced the same problem. My CPU and GPU are both AMD. I believe is was on version 24.xx.xx.xx (forgot to check the exact number) and the GUI was glitching out. I downgraded my driver to 21.40.18.10 since it was already saved on my computer and now simulate.exe runs without any issues. I hope a fix can be found for the latest AMD drivers soon.

RajneeshSingh111 commented 4 months ago

Hey, I had to switch to a new computer and while the simulations are running as always, I can't use the simulate.exe anymore. The GUI is rendered all over the place (see screenshot). The buttons are still clickable on the left black panel, although not visible.

The PC: ASRock X670E Pro RS AMD Ryzen 5 7600X (with integrated graphics) 32GB RAM M.2 SSD AMD Radeon RX 6800 XT Windows 11 22H2 (22621.819)

I've tried the latest AMD Adrenalin (22.5.1 and 22.11.1) and PRO (22Q4) graphics driver versions. I've tried different mujoco releases (2.3.0, 2.3.1) and built it from the source code, always with the same result. Any help is appreciated.

Win11_mujoco_simulate

I faced the same issue with AMD Ryzen 6000 series and NVIDIA GEFORCE RTX GPU. I changed the GPU mode from standard to ultimate (in ASUS ROG zephyrus G15) and it fixed the issue as I shifted to NVIDIA GPU. I think there is any issue with the AMD driver.

wjxway commented 3 months ago

Can confirm this issue is still there for AMD stand-alone graphics card (7900XTX). Hopefully it can be fixed soon.