xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
266 stars 54 forks source link

show vtk results in wsl (windows subsystem for linux) #105

Closed ebrahimraeyat closed 2 years ago

ebrahimraeyat commented 2 years ago

Hello @lcpt . I installed VcXsrv X server and set env:

 export DISPLAY=192.168.1.2:0.0
export LIBGL_ALWAYS_INDIRECT=1

as suggested here: https://github.com/microsoft/WSL/issues/4793#issuecomment-577232999

then I can run gedit without problem, but when I want to show my model, it gives me this error:

ebrahim@DESKTOP-GT2QLMA:~/xc/sole_zeinali$ python xc_model.py
2022-01-24 02:34:02.119 (   1.411s) [        67A7C740]vtkOpenGLRenderWindow.c:575    ERR| vtkXOpenGLRenderWindow (0x3ac87a0): Unable to find a valid OpenGL 3.2 or later implementation. Please update your video card driver to the latest version. If you are using Mesa please make sure you have version 11.2 or later and make sure your driver in Mesa supports OpenGL 3.2 such as llvmpipe or openswr. If you are on windows and using Microsoft remote desktop note that it only supports OpenGL 3.2 with nvidia quadro cards. You can use other remoting software such as nomachine to avoid this issue.
Segmentation fault
ebrahim@DESKTOP-GT2QLMA:~/xc/sole_zeinali$

any ideas? thanks.

lcpt commented 2 years ago

I don't think this is a XC issue.

VTK is complaining about missing OpenGL. Can you run glxgears? (gedit doesn't use OpenGL).

ebrahimraeyat commented 2 years ago

Yes, I know, but I think other user that want to run xc in wsl will face to this problem and I explained it here. my outputs:

ebrahim@DESKTOP-GT2QLMA:/mnt/c/Users/ebi$ glxgears
Command 'glxgears' not found, but can be installed with:
sudo apt install mesa-utils
ebrahim@DESKTOP-GT2QLMA:/mnt/c/Users/ebi$ sudo apt install mesa-utils
ebrahim@DESKTOP-GT2QLMA:~/xc/sole_zeinali$ glxgears
27894 frames in 46.2 seconds = 604.317 FPS
8337 frames in 45.7 seconds = 182.535 FPS
8342 frames in 49.7 seconds = 167.908 FPS

beside that, I want to know, if it is possible to run xc natively in windows? I mean which dependencies is specific to linux? is it better to open an new discussion? thanks.

lcpt commented 2 years ago

I think this is more a discussion than an issue.

lcpt commented 2 years ago

Maybe this can help: https://discourse.vtk.org/t/does-vtk-support-wsl/3661

ebrahimraeyat commented 2 years ago

Maybe this can help: https://discourse.vtk.org/t/does-vtk-support-wsl/3661

did not work for me. Thank you so much.

ebrahimraeyat commented 1 year ago

@lcpt , finally I succeed to compile xc and display graphic window in windows 11. Hurray

lcpt commented 1 year ago

Congratulations @ebrahimraeyat!

Maybe you can share with us how did you solve the problem with the graphical output using the X11 server.

Thanks for your perseverance. Luis.

ebrahimraeyat commented 1 year ago

Yes. Windows 11 did not need X11 for showing linux Gui Apps. I upgraded my windows 10 to 11 and it works out of the box.

lcpt commented 1 year ago

Ah, OK! That's really convenient :)

Thanks, @ebrahimraeyat