Agisoft Metashape

Agisoft Metashape => Bug Reports => Topic started by: csalvaggio on August 13, 2018, 08:10:32 PM

Title: Using Photoscan remotely using a VNC client
Post by: csalvaggio on August 13, 2018, 08:10:32 PM
I have use Photoscan 1.2.x in the past on our Linux machines using a VNC Server on the Linux box and an VNC client on my Mac.  Since 1.3.x I have been using the program locally installed on my Mac.  I now would like to move back to one of our Linux machines and use VNC again.  The issue arises that once I install Photoscan 1.4.3 on the Linux machine, it works fine if I am physically sitting on that machine, but if I try to use it over VNC on my Mac, it will not even start up.  I do get the following errors after typing ./photoscan.sh

Unrecognized OpenGL version
Unrecognized OpenGL version
Unrecognized OpenGL version
Unrecognized OpenGL version
QOpenGLShader::compile(Vertex): failed
QOpenGLShader::compile(Fragment): failed
QOpenGLShaderProgram::attributeLocation( a_vertex ): shader program is not linked
QOpenGLShaderProgram::attributeLocation( a_normal ): shader program is not linked
QOpenGLShaderProgram::attributeLocation( a_color ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( mvp_matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( normal_matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( point_size ): shader program is not linked
QOpenGLShader::compile(Vertex): failed
QOpenGLShader::compile(Fragment): failed
QOpenGLShaderProgram::attributeLocation( a_vertex ): shader program is not linked
QOpenGLShaderProgram::attributeLocation( a_normal ): shader program is not linked
QOpenGLShaderProgram::attributeLocation( a_texcoord ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( mvp_matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( normal_matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( t_diffuse ): shader program is not linked
QOpenGLShader::compile(Vertex): failed
Vertex shader for simpleShaderProg (MainVertexShader & PositionOnlyVertexShader) failed to compile
QOpenGLShader::compile(Fragment): failed
Fragment shader for simpleShaderProg (MainFragmentShader & ShockingPinkSrcFragmentShader) failed to compile
Errors linking simple shader:
QOpenGLShader::compile(Vertex): failed
Vertex shader for blitShaderProg (MainWithTexCoordsVertexShader & UntransformedPositionVertexShader) failed to compile
QOpenGLShader::compile(Fragment): failed
Fragment shader for blitShaderProg (MainFragmentShader & ImageSrcFragmentShader) failed to compile
Errors linking blit shader:
[xcb] Too much data requested from _XRead
[xcb] This is most likely caused by a broken X extension library
[xcb] Aborting, sorry about that.
photoscan: xcb_io.c:732: _XRead: Assertion `!xcb_xlib_too_much_data_requested' failed.
./photoscan.sh: line 19: 41768 Aborted                 (core dumped) "$dirname/$appname" "$@"

and I get an "Agisoft Crash Reporter" dialog box allowing me to report the crash.

If I do a "glxinfo" I get the following, and can see we're running GLX version 1.4 ...

name of display: :84
display: :84  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile,
    GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
    GLX_EXT_import_context, GLX_EXT_libglvnd, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_make_current_read
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
    GLX_ARB_context_flush_control, GLX_ARB_create_context,
    GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile,
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age,
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
    GLX_EXT_import_context, GLX_EXT_stereo_tree, GLX_EXT_swap_control,
    GLX_EXT_swap_control_tear, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_NV_copy_buffer,
    GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer,
    GLX_NV_multisample_coverage, GLX_NV_present_video,
    GLX_NV_robustness_video_memory_purge, GLX_NV_swap_group,
    GLX_NV_video_capture, GLX_NV_video_out, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile,
    GLX_ARB_fbconfig_float, GLX_ARB_get_proc_address, GLX_ARB_multisample,
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
    GLX_EXT_visual_rating, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer
OpenGL vendor string:
OpenGL renderer string:
OpenGL version string:
OpenGL extensions:

240 GLX Visuals
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x17a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x17b 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0 16 16 16 16  0 0 Slow
0x17c 24 tc  0  32  0 r  y .   8  8  8  8 .  s  0  0  0  0  0  0  0  0 0 None
0x17d 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0 16 16 16 16  0 0 Slow
0x17e 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
0x17f 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0 16 16 16 16  0 0 Slow
0x180 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 16  0  0  0  0  0  0 0 None

<full text omitted and can be found in the attachment>

Can I no longer run Photoscan remotely via VNC with version 1.4.3?
Title: Re: Using Photoscan remotely using a VNC client
Post by: Alexey Pasumansky on August 13, 2018, 08:39:14 PM
Hello csalvaggio,

I assume that the following configuration scripts may be helpful for you:
https://github.com/agisoft-llc/cloud-scripts

Also do you see glxgears working properly when connected remotely to your Linux machine?
Title: Re: Using Photoscan remotely using a VNC client
Post by: csalvaggio on August 13, 2018, 10:06:42 PM
I do see results from glxgears.  I will take a look at the link that you provided.  I do apologize if this has been addressed prior.
Title: Re: Using Photoscan remotely using a VNC client
Post by: csalvaggio on August 14, 2018, 03:19:35 AM
Alexey - Looks like the instructions posted there are for Ubuntu, would you recommend trying the same on Redhat or Fedora?
Title: Re: Using Photoscan remotely using a VNC client
Post by: Alexey Pasumansky on August 20, 2018, 02:21:04 PM
Hello csalvaggio,

I think you can simply adjust the scripts to your OS, following also these points:

1) Install NVIDIA driver and confirming via nvidia-smi utility that all cards are properly recognized,
2) https://virtualgl.org/Documentation/HeadlessNV:
2.1) nvidia-xconfig -a --use-display-device=None --virtual=1280x1024
2.2) Execute lspci | egrep -h "VGA|3D controller" and provide the output of this command,
2.3) Send the file /etc/X11/xorg.conf - we will try to suggest further modifications.

Title: Re: Using Photoscan remotely using a VNC client
Post by: darkl1ght on May 20, 2021, 09:08:17 AM
Hi Alexey,

I am running Metashape 1.7.2 on Amazon Linux EC2 machine with VNC(TigerVNC to be exact). I followed your last reply steps. This is the response that I got after running 'cat /etc/X11/xorg.conf'

Code: [Select]
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 450.119.03

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us"
    Option         "XkbModel" "pc105"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Tesla T4"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "UseDisplayDevice" "None"
    SubSection     "Display"
        Virtual     1280 1024
        Depth       24
    EndSubSection
EndSection


I am unable to open Metashape GUI in the system.
When I run below command, I get the following output

Code: [Select]
[ec2-user@ip-x.x.x.x metashape-pro]$ QT_DEBUG_PLUGINS=1 ./metashape.sh
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/platforms" ...
Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so" : "Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)"
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: offscreen, xcb.

./metashape.sh: line 19:  2432 Aborted                 "$dirname/$appname" "$@"


Can you tell how do I install missing packages, if any?
I can only use RPM and yum to install the packages.
Title: Re: Using Photoscan remotely using a VNC client
Post by: Alexey Pasumansky on May 20, 2021, 03:16:07 PM
Hello darkl1ght,

Please install package containing libxcb-icccm.so.4 (for Ubuntu: 'sudo apt install libxcb-icccm4') and try again. If it still fails - please provide new output of 'QT_DEBUG_PLUGINS=1 ./metashape.sh'.
Title: Re: Using Photoscan remotely using a VNC client
Post by: darkl1ght on May 21, 2021, 08:03:28 AM
Hi Alexey,

As I have told you earlier, I am running the Metashape on an Amazon Linux EC2 instance with CentOS 7, with no GUI by default, for which I installed the tigervnc (https://tigervnc.org/ (https://tigervnc.org/)) to get the GUI, and I only have yum and rpm, not apt.

Also, I was able to install the libxcb-icccm4 using rpm, but now there is a new dependency libxcb-image.so.0, that in turn has lots of other pre-requisites(that need to be installed before installing the former dependency). While I have libgc package installed from amazon-linux-extras(something similar to yum but native to amazon linux instance), it conflicts with the missing dependency packages(those not from amazon-linux-extras) that I install on the machine. So, my question is that, does it have anything to do with QT5? Or any other way around it to run the GUI on the machine.

 The output for the requested command is:

Code: [Select]
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/platforms" ...
Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-image.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so" : "Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-image.so.0: cannot open shared object file: No such file or directory)"
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: offscreen, xcb.

./metashape.sh: line 19:  8760 Aborted                 "$dirname/$appname" "$@"

Title: Re: Using Photoscan remotely using a VNC client
Post by: darkl1ght on May 24, 2021, 01:33:53 PM
Hi Alexey,

Any updates on using GUI of Metashape in Amazon Linux EC2 instance with CENTOS 7 installed.
I have a GUI using tigerVNC, but I get the above-mentioned error messages.