Skip to content

Commit 4632127

Browse files
elfieggjimoosciuc
authored andcommitted
Update Makefile / build script to avoid installing incompatible torch dependency (sgl-project#5245)
1 parent 32e9b8c commit 4632127

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

sgl-kernel/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ check-deps: ## Check and install required Python formatting dependencies
1010
@command -v black >/dev/null 2>&1 || (echo "Installing black..." && pip install black)
1111

1212
install-deps: ## Install Python formatting tools (isort and black)
13-
pip install isort black
13+
pip install scikit-build-core isort black
1414

1515
tree: ## Show project directory structure
1616
@tree --prune -I "__pycache__|*.egg-info|*.so|build|3rdparty|dist"
@@ -23,10 +23,10 @@ ln: submodule ## Create compilation database
2323

2424

2525
install: submodule ## Install package in development mode
26-
@pip install -e .
26+
@pip install -e . --no-build-isolation
2727

28-
build: submodule ## Build and install wheel package
29-
@rm -rf dist/* || true && export MAX_JOBS=$(nproc) && uv build --wheel -Cbuild-dir=build . --verbose --color=always && pip3 install dist/*whl --force-reinstall --no-deps
28+
build: install-deps submodule ## Build and install wheel package
29+
@rm -rf dist/* || true && export MAX_JOBS=$(nproc) && uv build --wheel -Cbuild-dir=build . --verbose --color=always --no-build-isolation && pip3 install dist/*whl --force-reinstall --no-deps
3030

3131
clean: ## Remove build artifacts
3232
@rm -rf build dist *.egg-info

sgl-kernel/build.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,28 @@ docker run --rm \
1818
-v $(pwd):/sgl-kernel \
1919
${DOCKER_IMAGE} \
2020
bash -c "
21+
# Install CMake (version >= 3.26) - Robust Installation
22+
export CMAKE_VERSION_MAJOR=3.31
23+
export CMAKE_VERSION_MINOR=1
24+
echo \"Downloading CMake from: https://cmake.org/files/v\${CMAKE_VERSION_MAJOR}/cmake-\${CMAKE_VERSION_MAJOR}.\${CMAKE_VERSION_MINOR}-linux-x86_64.tar.gz\"
25+
wget https://cmake.org/files/v\${CMAKE_VERSION_MAJOR}/cmake-\${CMAKE_VERSION_MAJOR}.\${CMAKE_VERSION_MINOR}-linux-x86_64.tar.gz
26+
tar -xzf cmake-\${CMAKE_VERSION_MAJOR}.\${CMAKE_VERSION_MINOR}-linux-x86_64.tar.gz
27+
mv cmake-\${CMAKE_VERSION_MAJOR}.\${CMAKE_VERSION_MINOR}-linux-x86_64 /opt/cmake
28+
export PATH=/opt/cmake/bin:\$PATH
29+
30+
# Debugging CMake
31+
echo \"PATH: \$PATH\"
32+
which cmake
33+
cmake --version
34+
2135
${PYTHON_ROOT_PATH}/bin/${TORCH_INSTALL} && \
22-
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir ninja setuptools==75.0.0 wheel==0.41.0 numpy uv && \
36+
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir ninja setuptools==75.0.0 wheel==0.41.0 numpy uv scikit-build-core && \
2337
export TORCH_CUDA_ARCH_LIST='7.5 8.0 8.9 9.0+PTX' && \
2438
export CUDA_VERSION=${CUDA_VERSION} && \
2539
mkdir -p /usr/lib/x86_64-linux-gnu/ && \
2640
ln -s /usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so && \
2741
cd /sgl-kernel && \
2842
ls -la ${PYTHON_ROOT_PATH}/lib/python${PYTHON_VERSION}/site-packages/wheel/ && \
29-
PYTHONPATH=${PYTHON_ROOT_PATH}/lib/python${PYTHON_VERSION}/site-packages ${PYTHON_ROOT_PATH}/bin/python -m uv build --wheel -Cbuild-dir=build . --color=always && \
43+
PYTHONPATH=${PYTHON_ROOT_PATH}/lib/python${PYTHON_VERSION}/site-packages ${PYTHON_ROOT_PATH}/bin/python -m uv build --wheel -Cbuild-dir=build . --color=always --no-build-isolation && \
3044
./rename_wheels.sh
3145
"

0 commit comments

Comments
 (0)