Closed mhubii closed 1 month ago
PyTorch uses Ninja to build the plugin, and you can indeed limit the number of concurrent compilation processes launched by Ninja via the MAX_JOBS
environment variable. This is a perfectly valid way to reduce the memory usage during compilation.
Hi and thank you for this wonderful library!
Problem
Wondering if there is a way to limit threads during compilation?
Assuming this might be parsed somewhere here:
https://github.com/NVlabs/nvdiffrast/blob/c5caf7bdb8a2448acc491a9faa47753972edd380/nvdiffrast/torch/ops.py#L118
Solution
Found this in pytorch doc (https://pytorch.org/docs/stable/cpp_extension.html#torch.utils.cpp_extension.BuildExtension):
It appears (on Linux)
limits resources (worked for me).
Maybe if you could quickly confirm this before closing, as I am not very confident with this compilation process. Thank you!