Forum

Author Topic: Build Tiled Model not using GPU - Failed to initialize context.  (Read 773 times)

MichalDV

  • Newbie
  • *
  • Posts: 25
    • View Profile
Build Tiled Model not using GPU - Failed to initialize context.
« on: February 08, 2022, 01:16:41 AM »
Hi,

I have a rather large project processing, during this step, it seems not using GPU but CPU which makes it super super slow.

Metashape 1.8.1 Build 13915 Windows 64bit

Code: [Select]
2022-02-07 23:12:52 BuildTiledModel.buildTextureBlock (60/155): source data = Mesh, pixel size = 0.01, tile size = 512, face count = High, ghosting filter = 1
2022-02-07 23:12:54 loaded tiled model data in 0.001 sec
2022-02-07 23:12:54 loaded block index in 0.001 sec
2022-02-07 23:12:54 loaded block index in 0.005 sec
2022-02-07 23:12:54 loaded block index in 0.001 sec
2022-02-07 23:12:54 loaded camera partition in 0.002 sec
2022-02-07 23:12:54 Found 1 GPUs in 0.034 sec (CUDA: 0.019 sec, OpenCL: 0.015 sec)
2022-02-07 23:12:54 Using device: NVIDIA GeForce RTX 3090, 82 compute units, free memory: 23324/24575 MB, compute capability 8.6
2022-02-07 23:12:54   driver/runtime CUDA: 11060/10010
2022-02-07 23:12:54   max work group size 1024
2022-02-07 23:12:54   max work item sizes [1024, 1024, 64]
2022-02-07 23:12:54 Found device NVIDIA GeForce RTX 3090 driver version 511.65.0.0, API version: 1.3.194, location 11::0
2022-02-07 23:12:54 Failed to initialize context. Reason: Assertion in VMA failed at line 17081!
2022-02-07 23:12:54 loaded selector in 0.077 sec
2022-02-07 23:12:55 Scheduled offset 0 0 0
2022-02-07 23:12:55 Processing window [160, 80, 32] - [176, 96, 46]

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13913
    • View Profile
Re: Build Tiled Model not using GPU - Failed to initialize context.
« Reply #1 on: February 08, 2022, 08:45:20 PM »
Hello MichalDV,

The problem is related to unexpected Vulkan driver update that is not considered by Metashape 1.8.1. We will fix that in the next update of Metashape 1.8.2 pre-release, meanwhile the temporary solution could be either disabling GPU for the texturing (via tweak) or to rolling-back NVIDIA drivers to 497.29 version (Dec 2021).
Best regards,
Alexey Pasumansky,
Agisoft LLC

MichalDV

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Build Tiled Model not using GPU - Failed to initialize context.
« Reply #2 on: February 09, 2022, 03:42:14 AM »
Thank you, rolling back drivers now.

ilia

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Build Tiled Model not using GPU - Failed to initialize context.
« Reply #3 on: August 23, 2022, 05:00:57 PM »
Hi! Just encountered the same issue with updated NVidia drivers:

Failed to initialize context. Reason: vkCreateInstance: ErrorIncompatibleDriver:

Quote
2022-08-23 15:51:20 Found 1 GPUs in 0.001 sec (CUDA: 0 sec, OpenCL: 0.001 sec)
2022-08-23 15:51:40 checking for missing images...Checking for missing images...
2022-08-23 15:51:40  done in 0.015 sec
2022-08-23 15:51:40 Finished processing in 0.015 sec (exit code 1)
2022-08-23 15:51:40 BuildTexture: mapping mode = Keep uv, page count = 5, texture size = 8192, texture type = Diffuse map, source data = Images, blending mode = Mosaic, fill holes = 1, ghosting filter = 1, enable_gpu = 1, relaxed_precision = 1
2022-08-23 15:51:40 Blending textures...
2022-08-23 15:51:40 Found 1 GPUs in 0 sec (CUDA: 0 sec, OpenCL: 0 sec)
2022-08-23 15:51:40 Using device: NVIDIA GeForce RTX 3060, 28 compute units, free memory: 11143/12287 MB, compute capability 8.6
2022-08-23 15:51:40   driver/runtime CUDA: 11060/10010
2022-08-23 15:51:40   max work group size 1024
2022-08-23 15:51:40   max work item sizes [1024, 1024, 64]
2022-08-23 15:51:40 Failed to initialize context. Reason: vkCreateInstance: ErrorIncompatibleDriver
2022-08-23 15:51:40 Done "load_model" in 0
2022-08-23 15:51:40 rendering 5 pages
2022-08-23 15:51:42 calculating mesh connectivity... done in 0.565 sec
2022-08-23 15:51:43 detecting outliers... ****************************************************************Finished processing in 323.891 sec (exit code 0)

nvidia-smi output:

Quote
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 512.95       Driver Version: 512.95       CUDA Version: 11.6     |

System: Win10, RTX 3060 12GB
Metashape version: 1.8.4 14671

I didn't have this problem with 1.8.4 and older drivers. Should I roll back?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13913
    • View Profile
Re: Build Tiled Model not using GPU - Failed to initialize context.
« Reply #4 on: August 23, 2022, 05:45:12 PM »
Hell ilia,

Have you tried to download and install the most recent NVIDIA driver?
https://www.nvidia.com/Download/index.aspx
Best regards,
Alexey Pasumansky,
Agisoft LLC

ilia

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Build Tiled Model not using GPU - Failed to initialize context.
« Reply #5 on: August 23, 2022, 08:19:53 PM »
Hi Alexey,

Thank you for the quick reaction.  Updating to the
Quote
Driver Version: 516.94
helped me to solve it.