Skip to content
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

WSL__empty_window #218

Closed
111Seven opened this issue Jan 27, 2022 · 21 comments
Closed

WSL__empty_window #218

111Seven opened this issue Jan 27, 2022 · 21 comments
Assignees
Labels

Comments

@111Seven
Copy link

Installed Glvis on WSL. When I try to run an example using below command it is showing an empty window.
./glvis -m ../mfem-4.3/data/escher.mesh

Installed all the dependencies using below command
sudo apt-get install libfontconfig1-dev libfreetype-dev libsdl2-dev libglew-dev libglm-dev libpng-dev

Also installed VcXsrv X server as suggested in https://github.com/GLVis/glvis/blob/master/INSTALL#L136-L138

Please find the empty window I am seeing. Thank you in advance for your help.
image

@tzanio tzanio added the Windows label Jan 27, 2022
@111Seven
Copy link
Author

Further details: I have windows 11, and the WSL2 is having Ubuntu-20.04. I checked the mesh details are good. It seems like it is missing some dependencies. I will keep working on this, but in the meantime any directions to resolve this is really helpful. Thank you for all the assistance.

@tzanio
Copy link
Member

tzanio commented Jan 28, 2022

Hi @MohanElapolu,

I recently installed GLVis on a Windows 11 system with WSL2 and Ubuntu without any issues. I'll try to take a look this weekend and respond. If anyone else (@kanye-quest, @acfisher) has any advice, please speak up!

Tzanio

@tzanio tzanio self-assigned this Jan 28, 2022
@v-dobrev
Copy link
Member

Are you using the latest release v4.1, the latest master branch, or some older commit/version?

If you are not using the latest master branch, can you try that?

In the past, I've had a similar issue (which just happened randomly, not always) where the window will not show anything initially. However, when I force it to update the contents (by pressing a key like r that forces a re-draw, or just resizing the window) then the window contents is updated properly. Try one of these methods to force a re-draw just to see if that helps.

@111Seven
Copy link
Author

Thank you for the quick response. I am using the latest version4.1 posted on https://glvis.org. I tried to update the content by pressing r/resizing window which unfortunately didn't work.

@v-dobrev
Copy link
Member

One thing that might help us, is to build GLVis in debug mode:

make GLVIS_DEBUG=YES [any other options you use for building]

and then post here the output you get in the terminal when you run GLVis to view a mesh (as you mentioned above). That may give us some clues.

@111Seven
Copy link
Author

I built the GLVis in debug mode and ran the below command to test it.
./glvis -m ../mfem-4.3/data/escher.mesh

Here is the screenshot of the output on the terminal
image

@tzanio
Copy link
Member

tzanio commented Jan 28, 2022

Can you try ./glvis -oldgl -m ../mfem-4.3/data/escher.mesh

@111Seven
Copy link
Author

Yes, please find below screenshot of output.
image

@v-dobrev
Copy link
Member

One potential issue: I'm not sure we've tested GLVis with the SDL2 version you are using, v2.0.10. I think the oldest version we tested is 2.0.12. If you want to try a newer SDL2 version, here are some basic instructions how to build it from source:

glvis/INSTALL

Lines 243 to 257 in e7c5dd4

------
SDL2
------
From the directory containing the 'glvis' directory run the commands:
wget "https://www.libsdl.org/release/SDL2-2.0.12.tar.gz"
tar zxf SDL2-2.0.12.tar.gz
To build the library run the commands (see also SDL2-2.0.12/INSTALL.txt):
cd SDL2-2.0.12
./configure --prefix=`dirname $PWD`/SDL2
make -j 4
make install
cd ..

@111Seven
Copy link
Author

I installed SDL2 using commands as suggested above. I still have the blank screen window. Here is the screenshot of the output (Note: in the previous outputs we have shader missing, in this it is not there. I installed libglfw3-dev libgles2-mesa-dev as suggested in https://askubuntu.com/questions/244133/how-do-i-get-egl-and-opengles-libraries-for-ubuntu-running-on-virtualbox hoping that it will fix the problemw)
image
Now coming to the problem, it seems like it is somehow still using SDL 2.0.10. I removed that version by using
sudo apt-get remove libssdl2-dev
I tried to reinstall GLVis and now I am getting the below error(partial). It seems like it is unable to find the SDL.h. Please let me know your thoughts if I am missing something.
image

@v-dobrev
Copy link
Member

Did you install SDL2 in ../SDL2 relative to the GLVis source directory? If not, you should add SDL_DIR=<path to the SDL2 dir> to your make command line, where <path to the SDL2 dir> should be the directory where SDL2 was installed -- SDL.h is expected to be in this location: <path to the SDL2 dir>/include/SDL2/SDL.h.

@111Seven
Copy link
Author

111Seven commented Jan 29, 2022

Yes, installed SDL2 in GLVis source directory. I followed the instructions as suggested in your yesterday's comment. I am checking the SDL2 directory there is no SDL.h file. Please see the below screenshot
image

@v-dobrev
Copy link
Member

Okay, with this directory layout, use the following command from the glvis-4.1 directory:

make SDL_DIR=./SDL2 [other build flags]

To check if SDL.h is in the right place, you can use (again, from the glvis-4.1 directory):

ls -l ./SDL2/include/SDL2/SDL.h

@111Seven
Copy link
Author

Yes, that fixed the installation. Now, GLVis is using SDL-2.0.12, but still getting the blank window. Please check the below screenshot of the output in the terminal.
image

@tzanio
Copy link
Member

tzanio commented Jan 31, 2022

Unfortunately I can't reproduce this, but I may very well be missing something -- I rarely use Windows and I am new to WSL.

My system is Win11 with WSL+Ubuntu and the following packages:

libfontconfig1-dev is already the newest version (2.13.1-2ubuntu3).
libglm-dev is already the newest version (0.9.9.7+ds-1).
libpng-dev is already the newest version (1.6.37-2).
libglew-dev is already the newest version (2.1.0-4).
libsdl2-dev is already the newest version (2.0.10+dfsg1-3).

I do not have the VcXsrv X server installed.

mfem-4.3 and glvis-4.1 are built as follows:

~/mfem-4.3$ make serial
~/mfem-4.3$ cd ../glvis-4.1/
~/glvis-4.1$ make

With that ./glvis -m ../mfem-4.3/data/escher.mesh works fine and the output is:

~/glvis-4.1$ ./glvis -m ../mfem-4.3/data/escher.mesh

       _/_/_/  _/      _/      _/  _/
    _/        _/      _/      _/        _/_/_/
   _/  _/_/  _/      _/      _/  _/  _/_/
  _/    _/  _/        _/  _/    _/      _/_/
   _/_/_/  _/_/_/_/    _/      _/  _/_/_/

Generating coloring starting with element 10 / 42
Number of colors: 3
NVD3D10: CPU cyclestats are disabled on client virtualization
NVD3D10: CPU cyclestats are disabled on client virtualization
Using GLSL 140
Subdivision factor = 16
VisualizationSceneSolution3d::PrepareFlat2() : [min,max] = [0,2]
Shading type : non-conforming (with subdivision)
VisualizationSceneSolution3d::PrepareFlat2() : [min,max] = [0,2]
GLVis window closed.
Thank you for using GLVis.

@v-dobrev
Copy link
Member

I also tried building GLVis (v4.1 and master) on Windows 10 with WSL2 and Ubuntu (20.04 LTS) using VcXsrv X server. I do see sometimes an issue with the GLVis window content becoming just a black rectangle, however, pressing r or F2 fixes the issue. I see this issue when I drag the window from the title bar to move it; I also see this when resizing the window but not all the time.

One difference I see, compared with the output you posted, is that you get "Testing if OpenGL core profile window can be created...success!" -- for me this always fails. Is it possible that you are running the WSL preview version with built-in X-server support described here: https://docs.microsoft.com/en-us/windows/wsl/tutorials/gui-apps? If that is the case, that might explain why the "OpenGL core profile window" test succeeds.

@tzanio, if you are not using VcXsrv, are you using the above mentioned WSL preview version, or are you using some other X-server app?

@publixsubfan
Copy link
Contributor

Sorry, I just saw this thread. @MohanElapolu: can you install and run the glxinfo tool (mesa-utils package on Ubuntu), and post its output? The OpenGL context version being reported by the glvis output is 3.1 Mesa 21.0.3, which is odd - that seems to indicate that your setup is falling back to software rendering with Mesa.

When you start VcXsrv, is the "Native opengl" option checked in the settings?

@tzanio
Copy link
Member

tzanio commented Jan 31, 2022

Thanks for helping @kanye-quest!

@v-dobrev, I'll have to look more carefully in my installation. It was relatively recent, but I don't recall explicitly following the instructions you linked to.

@111Seven
Copy link
Author

Thank you @tzanio @kanye-quest @v-dobrev for your support. It seems like the installation of VcXsrv is not very straightforward. I am figuring out if the issue is with this installation. @kanye-quest yes "Native opengl" is checked and below is the different snapshots of the output of the $glxinfo
image
image
image
image

@publixsubfan
Copy link
Contributor

Ah, based on that output it seems like Mesa is using the new built-in 3D accelerated X server for WSL that @v-dobrev mentioned. Since it's using direct rendering, VcXsrv will have nothing to display - the rendering is done through Direct3D 12.

I think there are two potential paths you could try:

  • Uninstall VcXsrv and try to run with the built-in X server - this might be preferable since Windows gives you a newer version of OpenGL
  • Run with the environment variable LIBGL_ALWAYS_INDIRECT=1 ./glvis ... - this should force Mesa to pass GLX rendering commands to VcXsrv, but will only support an older OpenGL version

@111Seven
Copy link
Author

thank you @kanye-quest, I followed your first path and the directions as given in (microsoft/wslg#334.) I uninstalled the VcXsrv and used the following command. I am not sure this is best way but its working, will use it...:) Please post if we can do in a better way.
$GALLIUM_DRIVER==llvmpipe ./glvis -m ../mfem-4.3/data/escher.mesh
Here is the terminal output
image
Here is the window showing the mesh
image
thank you @kanye-quest @tzanio @v-dobrev for the timely responses and support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants