Forum

Author Topic: Headless Photoscan requires GUI on startup?  (Read 3185 times)

william

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Headless Photoscan requires GUI on startup?
« on: July 11, 2017, 02:10:27 AM »
Hi,

I am experimenting with running PhotoScan headless using '-r' on the linux command line. It works, but I am getting the following error on startup:
Code: [Select]
QXcbConnection: Could not connect to display localhost:10.0
Aborted (core dumped)

I know this is due to PhotoScan (and not my script), because even a simple "Hello, World" script is failing.

I can work around this by using ssh -Y to connect to my linux server, but that only works for the first time photoscan is launched within the run. (I am running within a GNU screen, which means that I am losing my X-window when I detach).

Is there any way to run PhotoScan without such reliance on GUI availability? Or does anyone have any other tips? 

Thanks!

william

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Headless Photoscan requires GUI on startup?
« Reply #1 on: July 11, 2017, 02:20:49 AM »
Within the next five minutes, I solved it. I simply used the accepted answer from https://unix.stackexchange.com/questions/94835/simulate-x-screen to simulate an X-window. Photoscan did not complain. I will update if I find some problem with this solution.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Headless Photoscan requires GUI on startup?
« Reply #2 on: July 11, 2017, 10:09:13 AM »
Hello william,

If you do not require GUI to be started, you can use "-platform offscreen" argument when starting script from the command line:

Code: [Select]
./photoscan.sh -platform offscreen -r script.py
Best regards,
Alexey Pasumansky,
Agisoft LLC

william

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Headless Photoscan requires GUI on startup?
« Reply #3 on: July 14, 2017, 11:05:09 PM »
Thanks!