Forum

Author Topic: RAM Usage - Building Textures  (Read 14481 times)

Mak11

  • Sr. Member
  • ****
  • Posts: 387
    • View Profile
Re: RAM Usage - Building Textures
« Reply #15 on: November 04, 2024, 12:00:57 AM »
The texture artifacts are present even when the texture is produced on the undecimated model...

Happens in both v2.1.3 and 2.2.0.

Try to generate the textures using the CPU only (it will obliviously take longer) but at least it would rule out a GPU/Driver bug.

Tas

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: RAM Usage - Building Textures
« Reply #16 on: November 04, 2024, 12:05:39 AM »
Thanks for the suggestion Mak11. Unfortunately, the textures were already generated with the CPU. It's a very lengthy process, but the logs always indicate that there's not enough GPU memory.

E.g.,
Quote
Found 1 GPUs in 0.004 sec (CUDA: 0 sec, OpenCL: 0.001 sec, Vulkan: 0.002 sec)
Using device: NVIDIA GeForce RTX 4090, 128 compute units, free memory: 21054/24563 MB, compute capability 8.9
  driver/runtime CUDA: 12060/10010
  max work group size 1024
  max work item sizes [1024, 1024, 64]
...
...
Estimated required video memory: 304685 MB
Estimated device memory: total 24142 MB, used 2586 MB, available 22205 MB
Cannot use GPU. Reason: Not enough memory on device
Performing blending on CPU...

Mak11

  • Sr. Member
  • ****
  • Posts: 387
    • View Profile
Re: RAM Usage - Building Textures
« Reply #17 on: November 04, 2024, 12:13:54 AM »
Thanks for the suggestion Mak11. Unfortunately, the textures were already generated with the CPU. It's a very lengthy process, but the logs always indicate that there's not enough GPU memory.

E.g.,
Quote
Found 1 GPUs in 0.004 sec (CUDA: 0 sec, OpenCL: 0.001 sec, Vulkan: 0.002 sec)
Using device: NVIDIA GeForce RTX 4090, 128 compute units, free memory: 21054/24563 MB, compute capability 8.9
  driver/runtime CUDA: 12060/10010
  max work group size 1024
  max work item sizes [1024, 1024, 64]
...
...
Estimated required video memory: 304685 MB
Estimated device memory: total 24142 MB, used 2586 MB, available 22205 MB
Cannot use GPU. Reason: Not enough memory on device
Performing blending on CPU...

What are the texture generation settings used ? how many 4K or 8K textures ?


Tas

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: RAM Usage - Building Textures
« Reply #18 on: November 04, 2024, 01:11:30 AM »
I've tried a variety of settings:  8K, 16K, 32K, page count determined by pixel size, page count manually defined, etc. Examples I've tried include two 16k textures and three to five 32K textures. Same issue on decimated models, undecimated models, unedited models (no face deletion), etc. The artifacts show in all cases.

I've had this occur on multiple projects, one year apart, on different workstations/PCs, and using 4 different versions of Metashape. The only common variable I can come up with is that it's happening on jobs where I include laser scans - of course, correlation doesn't imply causation. 

« Last Edit: November 04, 2024, 01:24:27 AM by Tas »

Tas

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: RAM Usage - Building Textures
« Reply #19 on: November 04, 2024, 01:23:48 AM »
Texture Settings
  • Texture type:  Diffuse map
  • Source data:  Images
  • Mapping mode:  Generic
  • Blending mode:  Mosaic
  • Texture size:  variable - tried 8K, 16K, and 32K
  • Pixel size (m):  variable, tried .0025 and page-count-defined
  • Page count:  variable, tried 2-5 and pixel size-defined
  • Enable hole filling:  yes
  • Enable ghosting filter:  yes

Mak11

  • Sr. Member
  • ****
  • Posts: 387
    • View Profile
Re: RAM Usage - Building Textures
« Reply #20 on: November 04, 2024, 01:27:48 AM »
Can you try 4K x 4 and report back ?

Tas

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: RAM Usage - Building Textures
« Reply #21 on: November 04, 2024, 02:02:26 AM »
I have to generate other deliverables tonight but can try that as a troubleshooting measure in the coming days. A 4K x 4 texture would be far too low, regardless - project specifications called for a texture pixel resolution of 0.0015875m (1/16"), and Metashape logs indicated that'd require 32K x 12.
« Last Edit: November 04, 2024, 02:26:44 AM by Tas »

ilia

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: RAM Usage - Building Textures
« Reply #22 on: November 04, 2024, 12:42:31 PM »
Tas,

It may be related to this issue:
https://www.agisoft.com/forum/index.php?topic=16806.0

Mak11

  • Sr. Member
  • ****
  • Posts: 387
    • View Profile
Re: RAM Usage - Building Textures
« Reply #23 on: November 04, 2024, 09:05:15 PM »
I don't think so as his textures are currently always being generated by the CPU (they are way to big for the VRAM as seen in his logs). I think that it's a combination of way to many gigantic textures and also UV U- wrapping issues because the meshes are either to dense or the topology is messed up (he should run the model statistics and see if there's anything to fix).

theFinn01

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: RAM Usage - Building Textures
« Reply #24 on: April 15, 2025, 04:22:57 PM »
Any updates on this issue? Sounds like Tas is doing similar work to myself - we fly a Mavic 3E about 12 feet away from building facades. I usually have an outside entity process, but I've successfully completed a model with just under 4,000 images. I've been working on one with just under 7,000 images and just got the "Bad allocation" error. I was using 16k textures. I've now downsized to 8192 but kept my UV maps (not sure if that's what I should have done) and reprocessing now.

Intel(R) Xeon(R) CPU E5-2687W v4 @ 3.00GHz   3.00 GHz  (2 processors)
192 GB RAM
3080 GPU


morph

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: RAM Usage - Building Textures
« Reply #25 on: April 16, 2025, 03:18:22 PM »
it is some other issue, i can generate 32k texture on 150mln model it takes about  15h.. but it can. also i have only 64gb ram so..... but 32k is the limit... for biger it popup "not enough memory."

theFinn01

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: RAM Usage - Building Textures
« Reply #26 on: April 16, 2025, 07:40:44 PM »
Good to know. My latest set created a model with 400+ million triangles that I decimated to 50 million. Using 16k textures on 50 million is where I got the "Bad Allocation" message. I switched to 8k and it completed fine.

Corensia

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: RAM Usage - Building Textures
« Reply #27 on: April 18, 2025, 03:30:02 AM »
I'm pretty sure the Bad Allocation message during texturing is due to lack of VRAM of your GPU not motherboard RAM.

Dieter

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: RAM Usage - Building Textures
« Reply #28 on: April 23, 2025, 04:20:49 PM »
I've been struggling with the bad allocation error for several days. I want to generate sections on a large model and I want to texture them with the texture of the model. In the beginning, I got the bad allocation error after a while.
After observing that the ram and the paging file are full, I set it to custom and used the size of 200 GB ram. Previously, the settings were "Managed by System".

My values at 64 GB RAM were:
Initial Size: 96GB
Max. size 200GB

This total available 200GB is now used with a maximum of 180GB to generate Texture.

Now it seems to be working...

I hope this helps others.

Dieter