move compile threads to an option to avoid OOM on low memory host (#10123)

This commit is contained in:
Rain Jiang
2025-09-07 21:36:14 -07:00
committed by GitHub
parent 7577f0e40f
commit 6049ca209e
2 changed files with 22 additions and 3 deletions

View File

@@ -52,10 +52,12 @@ See CMakeLists.txt for more options.
### Parallel Build
We highly recommend you build sgl-kernel with Ninja. Ninja can automatically build sgl-kernel in parallel.
And if you build the sgl-kernel with cmake, you need to add `CMAKE_BUILD_PARALLEL_LEVEL` for parallel build like:
And if you build the sgl-kernel with cmake, you need to add `CMAKE_BUILD_PARALLEL_LEVEL` and limit the
nvcc threads to a single thread by setting `SGL_KERNEL_COMPILE_THREADS=1` for parallel build like:
```bash
CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) python -m uv build --wheel -Cbuild-dir=build --color=always .
CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) python -m uv build --wheel -Cbuild-dir=build \
-Ccmake.define.SGL_KERNEL_COMPILE_THREADS=1 --color=always .
```
### ⚠️ Compilation Issue with `sgl-kernel` and CUDA 12.6