mitsuba-renderer / mitsuba3

Mitsuba 3: A Retargetable Forward and Inverse Renderer
https://www.mitsuba-renderer.org/
Other
2.1k stars 246 forks source link

jit_flush_malloc_cache() #1166

Closed Gzhji closed 6 months ago

Gzhji commented 6 months ago

Dear community,

I met the following warning when I use mitsuba to render. Does anyone know how to solve this?

Thanks in advance!

Guanzhou

jit_flush_malloc_cache(): Dr.Jit exhausted the available memory and had to flush its allocation cache to free up additional memory. This is an expensive operation and will have a negative effect on performance. You may want to change your computation so that it uses less memory. This warning will only be displayed once.

Critical Dr.Jit compiler failure: cuda_check(): API error 0002 (CUDA_ERROR_OUT_OF_MEMORY): "out of memory" in /project/ext/drjit-core/src/cuda_tex.cpp:149.

Process finished with exit code 134 (interrupted by signal 6:SIGABRT)
merlinND commented 6 months ago

Hello @Gzhji,

This is the warning and error encountered when running out of GPU memory. This can happen for any number of reasons. Could you please summarize what was the cause for you, and how did you work around it? (So that future users finding your question can try your solution as well).

Gzhji commented 5 months ago

Hi all,

I fixed this issue. It was a tricky problem. I checked my GPU and geometry (.obj) files, and everything looked fine. I found that the issue was the texture file (.png), which was about 10MB—way too large to render.

Thanks,

merlinND commented 5 months ago

Thanks for reporting back @Gzhji. Do you mean 10GB? A texture of size 10MB should in principle render without any issues.

Gzhji commented 5 months ago

Hi all,

The texture size is 10MB. In rendering, I set the image dimensions to 4096 x 2048, with spp=256. In this case, the NVIDIA GeForce RTX 3080 gave me the error above.

Thanks,

merlinND commented 5 months ago

Ah, alright, well in that case the memory usage is much more likely to be due to the high resolution and high spp. You should be able to keep the original 10MB texture intact, but split up the rendering into e.g. two passes of 128spp each. The samples_per_pass argument of the Integrator plugins helps achieve this.