sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
906 stars 309 forks source link

[QT] Could not load the Qt platform plugin "xcb" in "" even though it was found. #3486

Open rodriguesvinay opened 1 year ago

rodriguesvinay commented 1 year ago

Hello, I am trying to install using https://hub.docker.com/r/sofaframework/sofa_nightly_ubuntu/tags and everything worked fine but while running ./runSofa shows me this error. Please also see the image attached (sorry for the mobile phone capture). Any help will be appreciated. 1

fredroy commented 1 year ago

Hello @rodriguesvinay ,

It seems it comes from the fact that Qt could not connect to the display (Warning [Qt] could not connect to display). And xcb is linked to X11, so I think your docker configuration cannot connect to your X server (if existing). Whats your system you are trying to launch the docker on ?

rodriguesvinay commented 1 year ago

hi @fredroy, thanks for getting back. I am using Ubuntu 18.04.6 LTS.

In sofaframework/sofabuilder_ubuntu, I clone the repo git clone -b v22.06.00 https://github.com/sofa-framework/sofa.git sofa/src and followed the procedure for build SOFA on [Linux](https://www.sofa-framework.org/community/doc/getting-started/build/linux/) and got the same error while running ./runSofa

while using sofaframework/sofa_nightly_ubuntu:v22.06-full, I first directly run ./runSofa without building sofa and then with building as earlier but again same error. Please also guide me if I have even have to build in second case (sofaframework/sofa_nightly_ubuntu:v22.06-full)

fredroy commented 1 year ago

Actually, I dont even know if anybody uses the GUI with the docker installation 😅

I think it is a matter of configuration of docker to access the local X server. You may try setting some environment variables https://stackoverflow.com/questions/69872788/docker-could-not-connect-to-any-x-display

rodriguesvinay commented 1 year ago

Actually, I dont even know if anybody uses the GUI with the docker installation why so? don't we need the gui for the sofa? how did we launch sofa then?

rodriguesvinay commented 1 year ago

with normal installation there was problem in the configuring step where we choose unix /ninja and assign C & C++ compilers. it was not able to locate the compilers even though I browsed that. I also tried with gcc/g++. which procedure should I follow? I am frustrated. Is Unbuntu 18.04 causing problem?

fredroy commented 1 year ago

Actually, I dont even know if anybody uses the GUI with the docker installation why so? don't we need the gui for the sofa? how did we launch sofa then?

Just a thought, as for me, I use docker to build SOFA but I execute the resulting compilation into the bare-metal system (out of docker)

rodriguesvinay commented 1 year ago

by into the bare-metal system means the original user directory? can you please explain? I will give your procedure a try. My understanding was once I am inside docker then it's my new user (root) environment and I have to do it while I am inside as the repo I cloned is also will be inside I suppose.

fredroy commented 1 year ago

Actually, I got confused, I thought you were using docker to build SOFA, with https://hub.docker.com/r/sofaframework/sofabuilder_ubuntu

Anyway, my advice would be to just download the archive on the website, and directly use the binaries (instead of going through the containerisation of docker) ; in your case for Ubuntu, it would be https://github.com/sofa-framework/sofa/releases/download/v22.06.00/SOFA_v22.06.00_Linux.zip

rodriguesvinay commented 1 year ago

@fredroy thanks for the link. Also please correct me for the steps that will follow so that I will not kill myself:

  1. download https://github.com/sofa-framework/sofa/releases/download/v22.06.00/SOFA_v22.06.00_Linux.zip

  2. download dependencies

    • Qt (>= 5.12.0) with Charts and WebEngine
    • OpenGL sudo apt install libopengl0
    • Boost (>= 1.65.1) sudo apt install libboost-all-dev
    • Python 3.8 + pip + numpy + scipy sudo apt install python3.8-dev
    • Additional libraries: libPNG, libJPEG, libTIFF, Glew, Zlib sudo apt install libpng-dev libjpeg-dev libtiff-dev libglew-dev zlib1g-dev
    • SOFA v20.06 and newer also need Eigen (>= 3.2.10) sudo apt install libeigen3-dev
  3. run ./bin/runSofa from https://github.com/sofa-framework/sofa/releases/download/v22.06.00/SOFA_v22.06.00_Linux.zip folder

There is no need for building in this case right?

rodriguesvinay commented 1 year ago

Hi @guparan, I saw your comment on installation from this link https://github.com/sofa-framework/sofa/issues/2485#issuecomment-971462092. I have been struggling with the installation for a quite some time now. can you please check my comment for the procedure I have mentioned here at https://github.com/sofa-framework/sofa/issues/3486#issuecomment-1316778833? or from what you mentioned do I only need those 4 lines to install on ubuntu?