Forum

Author Topic: Using GPU on the python module and disabling the CPU usage  (Read 3096 times)

nys09@vt.edu

  • Newbie
  • *
  • Posts: 16
    • View Profile
Using GPU on the python module and disabling the CPU usage
« on: October 09, 2019, 12:01:17 AM »
How do we disable CPU using the python module for accelerated processing using GPU only? Any insight on this would be very helpful.

Thanks.

SamT

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Using GPU on the python module and disabling the CPU usage
« Reply #1 on: October 16, 2019, 02:08:14 AM »
I would try:

PhotoScan.app.cpu_enable = False
PhotoScan.app.gpu_mask = mask

Where mask is a bit mask. Page 10 https://www.agisoft.com/pdf/photoscan_python_api_1_4_0.pdf

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Using GPU on the python module and disabling the CPU usage
« Reply #2 on: October 16, 2019, 01:10:10 PM »
I would try:

PhotoScan.app.cpu_enable = False
PhotoScan.app.gpu_mask = mask

Similar in Metashape API (https://www.agisoft.com/pdf/metashape_python_api_1_5_5.pdf):

Code: [Select]
Metashape.app.cpu_enable = False
Metashape.app.gpu_mask = mask
to enable all the detected GPU instances:
Code: [Select]
mask = 2 ** len(Metashape.app.enumGPUDevices()) - 1
Best regards,
Alexey Pasumansky,
Agisoft LLC