oppo-us-research / SpacetimeGaussians

[CVPR 2024] Spacetime Gaussian Feature Splatting for Real-Time Dynamic View Synthesis
https://oppo-us-research.github.io/SpacetimeGaussians-website/
Other
616 stars 45 forks source link

Qt error when run colmap #28

Closed NB-wo closed 8 months ago

NB-wo commented 8 months ago

Hi, thank you very much for your outstanding work. I am running the data processing code pre_n3d.py with the following error:

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

*** Aborted at 1710388069 (unix time) try "date -d @1710388069" if you are using GNU date ***
PC: @                0x0 (unknown)
*** SIGABRT (@0x272400003471) received by PID 13425 (TID 0x7fef78292000) from PID 13425; stack trace: ***
    @     0x7fef806f3197 google::(anonymous namespace)::FailureSignalHandler()
    @     0x7fef7e90f980 (unknown)
    @     0x7fef7ded8e87 gsignal
    @     0x7fef7deda7f1 abort
    @     0x7fef7ebac35b QMessageLogger::fatal()
    @     0x7fef7f06a799 QGuiApplicationPrivate::createPlatformIntegration()
    @     0x7fef7f06ab6f QGuiApplicationPrivate::createEventDispatcher()
    @     0x7fef7ecc9b62 QCoreApplicationPrivate::init()
    @     0x7fef7f06b1e1 QGuiApplicationPrivate::init()
    @     0x7fef7f4f1bc5 QApplicationPrivate::init()
    @     0x56247720d975 colmap::RunFeatureExtractor()
    @     0x5624771f61a0 main
    @     0x7fef7debbc87 __libc_start_main
    @     0x5624771f9e39 (unknown)
Aborted (core dumped)

I have installed the package opencv-python-headless and the environment is set up exactly as colmapenv in setup. I also looked up the original 3dgs issue, and its solution says to install it with apt, and I can't seem to find a suitable solution on the internet

According to colmap official statement, it will use cuda device by default when no gui exists, but it seems that it just doesn't work in conda environment!

I modified pre_n3d.py to force it to use cpu by adding --SiftMatching.use_gpu 0 or something like that after the corresponding colmap command, and it works. The downside is that it is slower.

I was wondering if you could run this code you gave for processing data pre_n3d.py directly inside a conda virtual environment without an external monitor (on the server). As well have you encountered this problem? How was it solved?

lizhan17 commented 8 months ago

Hi, I have met this problem once from one of our server. But the other server works. I can't remember how I solved it. (i just bruteforcely search and try each possible solution from google and github ) We do not use sudo in the docker. We still use gpu after fixing the qt error.

Perhaps export CUDA_VISIBLE_DEVICES=0 in the conda

or any disucss in the large repo that use colmap.

I remember I searched several github repo (instant ngp and colmap )

github.com/NVlabs/instant-ngp/discussions/300

NB-wo commented 8 months ago

Hi, I have met this problem once from one of our server. But the other server works. I can't remember how I solved it. (i just bruteforcely search and try each possible solution from google and github ) We do not use sudo in the docker. We still use gpu after fixing the qt error.

Perhaps export CUDA_VISIBLE_DEVICES=0 in the conda

or any disucss in the large repo that use colmap.

I remember I searched several github repo (instant ngp and colmap )

github.com/NVlabs/instant-ngp/discussions/300

Thank you very much for your prompt reply. Unfortunately, I tried the method you mentioned as well as the instant ngp method, and neither solved my problem. I'll just use the CPU then. After all, generating SFM point clouds only needs to be run once, so it's okay if it's a bit slower.

grosshill commented 5 months ago

Hi, I have met this problem too. It seems something goes wrong when colmap is running on headless server environments, and I find a potential workaround is to use Xvfb, a virtual framebuffer that enables OpenGL applications to run without a physical display.

sudo apt-get install xvfb
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99

It is weird but it does work. : )

bootcap commented 1 month ago

I met the same problem. If you don't have a display in your server, you can try to add option --SiftExtraction.use_gpu=false to colmap feature_extractor and add option --SiftMatching.use_gpu=false to colmap exhaustive_matcher in thirdparty/gaussian_splatting/helper3dg.py.

More details about this solution: https://colmap.github.io/faq.html#available-functionality-without-gpu-cuda