Forum

Author Topic: Running Metashape on a headless VM means no multithreading  (Read 3979 times)

mbaus

  • Newbie
  • *
  • Posts: 4
    • View Profile
Running Metashape on a headless VM means no multithreading
« on: October 18, 2023, 09:28:55 AM »
Hi there,

We're using Metashape as part of a fully automated pipeline, so it is running on a virtual machine (VM) in Google Cloud.
We have it running succesfully completely headless after a bit of fiddling around with the display settings.

Currently, to get it running we have the following lines in a bash script (in amongst some other stuff)

Xvfb :1 &
PID=$!
DISPLAY=:1 /usr/local/metashape-pro/metashape.sh -r /usr/local/metashape_automation_repo/metashape_automation.py
kill $PID


Since adding this we have noticed that the software is no longer using all the CPU available to it. It still seems to be using the GPU, however.

My linux/bash isn't good enough to know if this is the cause of the problem, but if there are any linux gurus here I'd love to hear if this is the only way to achieve headless operation?

But I'm asking more generally, also, if there are any flags or settings that can force Metashape to be multithreaded, or specify the number of CPU  to working on.

Or can we get it to print how many CPU it sees, so we can check if it is indeed only seeing a single CPU?

SFL_Beda

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Running Metashape on a headless VM means no multithreading
« Reply #1 on: October 20, 2023, 01:26:03 PM »
If you are aiming at a completly headless setup why are you not using the standalone python module? https://agisoft.freshdesk.com/support/solutions/articles/31000154762-how-to-make-python-interpreter-to-use-metashape-module

I have no Issues with multithreading there.