Someone with excessive RAM usage when building Blender on Linux?

Since a few days when I try to build Master or 2.9.3 branch it makes excessive use of RAM. It occupies my available 24GB in a moment and it quickly begins to fill the swap memory, so my system becomes almost unusable and I have to force the termination of the process.
I have installed CUDA 11 a week or two ago. Could the problem be related to it? But I remember having managed to compile with CUDA 11 without this problem of excessive RAM usage.

The problem begins to occur when there are 5 to 7 “ptxas” processes working simultaneously and each of them occupying around 4GB.

I am building with precompiled libraries, CUDA and OptiX enabled. “make -j8” for my 8 threads CPU

1 Like

CUDA 11.3 may use more memory than older versions like 11.1. We at least found it to compile significantly slower on the buildbot. I’m not sure about memory usage differences but it would not surprise me.

1 Like

Yes, using CUDA 11.3 here. Is there any way to limit the amount of these “ptxas” simultaneous processes? Or wouldn’t that fix the problem anyway?
Edit:
Probably related to “make -j8”? I will try with less threads.

1 Like

Using WITH_CYCLES_CUDA_BUILD_SERIAL=ON should work, though it’s going to be slower since it only builds one kernel at a time. Or downgrading to CUDA 11.1.

Cycles X should also be easier to compile once we are done with all the optimizations.

3 Likes

WITH_CYCLES_CUDA_BUILD_SERIAL=ON and make -j8 is the way to go here, it’ll still build all code with all cores available but will build the cuda kernels one at a time.

1 Like

Hi.
WITH_CYCLES_CUDA_BUILD_SERIAL=ON worked, but it is very slow as you said.
So I have installed CUDA 11.1.105. Now each “ptxas” process used approximately 1.2GB (with 11.3 each process used 4GB of memory or at times even more)

Unless you are distributing the build to other people, you can save a lot of time by just building the kernels you need for you gpu though the CYCLES_CUDA_BINARIES_ARCH cmake variable

1 Like