From 29238ead1045bed7347de99ead53310fd8f0f460 Mon Sep 17 00:00:00 2001 From: Eric Shi Date: Wed, 5 Jun 2024 14:55:16 -0700 Subject: [PATCH] Make CUDA 12.5 the default for CI builds CUDA 11.8 continues to be used for Kit extensions, PyPI --- .gitlab-ci.yml | 120 +++--- .gitlab/ci/additional-tests.yml | 2 +- .gitlab/ci/common.yml | 4 + .gitlab/ci/cuda-11-build-and-test.yml | 361 ++++++++++++++++++ .gitlab/ci/debug-build-and-test.yml | 37 +- PACKAGING.md | 2 + README.md | 19 +- deps/cuda-toolkit-deps.packman.xml | 15 + deps/target-deps.packman.xml | 28 -- docs/index.rst | 11 +- docs/installation.rst | 15 +- pyproject.toml | 2 +- tools/build_docs.bat | 2 - tools/build_docs.sh | 4 - .../ci/building/build-linux-aarch64/build.sh | 79 ++-- tools/ci/building/build-linux-x86_64/build.sh | 77 ++-- .../building/build-windows-x86_64/build.bat | 41 +- tools/package.bat | 2 - tools/package.sh | 4 - tools/publish.bat | 2 - tools/publish.sh | 4 - tools/repo.bat | 10 - 22 files changed, 614 insertions(+), 227 deletions(-) create mode 100644 .gitlab/ci/cuda-11-build-and-test.yml create mode 100644 deps/cuda-toolkit-deps.packman.xml delete mode 100644 tools/build_docs.bat delete mode 100755 tools/build_docs.sh delete mode 100644 tools/package.bat delete mode 100755 tools/package.sh delete mode 100644 tools/publish.bat delete mode 100755 tools/publish.sh delete mode 100755 tools/repo.bat diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83795d456..51e3585b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,10 +9,7 @@ # CI/CD Pipeline Configuration # ============================================================================== -include: - - /.gitlab/ci/common.yml - - project: "omniverse/sectools/vault" - file: ["templates/v2/omni-packman-s3-creds.yml", "templates/v3/linux/packman_s3.gitlab-ci.yml"] +include: /.gitlab/ci/common.yml workflow: rules: @@ -64,9 +61,13 @@ stages: linux-aarch64 build: stage: build - image: urm.nvidia.com/ct-omniverse-docker-local/u18-aarch64-builder:3.2.0 + image: ubuntu:22.04 extends: - .save_warp_bin_artifact + before_script: + - echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies" + - apt-get update && apt-get install build-essential curl --no-install-recommends -y + - echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" script: - ./tools/ci/building/build-linux-x86_64/build.sh --no-docker # We are already using the builder image - mkdir -p warp/bin/linux-aarch64 @@ -335,7 +336,7 @@ trigger python 3.X test pipelines: stage: test image: busybox extends: - - .runner-utility-windows-x86_64 + - .runner-utility-linux-x86_64 rules: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_TAG @@ -374,7 +375,7 @@ trigger debug build and test pipeline: stage: test image: busybox extends: - - .runner-utility-windows-x86_64 + - .runner-utility-linux-x86_64 needs: [] rules: - if: $CI_PIPELINE_SOURCE == "schedule" @@ -396,6 +397,34 @@ debug build and test: extends: - .trigger_common +# Trigger CUDA 11 pipelines +# Workaround from https://gitlab.com/gitlab-org/gitlab/-/issues/284086 +trigger cuda 11 pipeline: + stage: test + image: busybox + extends: + - .runner-utility-linux-x86_64 + needs: [] + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH =~ /release-.*/ + - when: manual # Can be triggered in all other scenarios + allow_failure: true + variables: + GIT_STRATEGY: none + script: + - echo "Run this job to test Warp compiled with CUDA 11." + +# Uses the same Python version as the main pipeline. +cuda 11 build and test: + stage: child pipelines + needs: [trigger cuda 11 pipeline] + trigger: + include: /.gitlab/ci/cuda-11-build-and-test.yml + extends: + - .trigger_common + # ============================================================================== # Packaging Jobs # @@ -434,10 +463,13 @@ create pypi wheels: - python3 -m pip install --upgrade pip - python3 -m pip install build script: + - sed -i "s/^\(.*\)$/\1+cu12/" VERSION.md # Modify VERSION.md with +cu12 - python3 -m build --wheel -C--build-option=-Pwindows-x86_64 - python3 -m build --wheel -C--build-option=-Plinux-x86_64 - python3 -m build --wheel -C--build-option=-Plinux-aarch64 + - sed -i "s/^\(.*\)+cu12$/\1+cpu/" VERSION.md # Modify VERSION.md with +cu12 replaced by +cpu - python3 -m build --wheel -C--build-option=-Pmacos-universal + - sed -i "s/^\(.*\)+cpu$/\1/" VERSION.md # Revert VERSION.md changes - find . -type f -exec chmod 664 {} + - find . -type d -exec chmod 775 {} + artifacts: @@ -447,60 +479,40 @@ create pypi wheels: - "dist/" when: always -# Creates an artifact suitable for publishing the Kit extensions -create kit artifacts: - stage: package - needs: - - linux-x86_64 build - - windows-x86_64 build +# ============================================================================== +# Deployment Jobs +# +# This section currently contains jobs that publish files to the internal +# GitLab service. +# ============================================================================== + +publish wheels to gitlab pypi registry: + stage: deploy + image: python:3.11-slim + needs: ["create pypi wheels"] extends: - .runner-utility-linux-x86_64 rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH =~ /release-.*/ - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # Can be manually triggered for MRs when: manual allow_failure: true before_script: - # Move compiled binaries out of platform-specific directory - - mv warp/bin/linux-x86_64/warp.so warp/bin/ - - mv warp/bin/linux-x86_64/warp-clang.so warp/bin/ - - rm -r warp/bin/linux-x86_64/ - - rm -rf warp/native/cutlass - - apt-get update && apt-get install zip --no-install-recommends -y + - python3 -m pip install --upgrade pip + - python3 -m pip install --upgrade build twine script: - - python3 tools/ci/publishing/build_nodes_info.py - - mv warp exts/omni.warp.core/ - - find . -type f -exec chmod 664 {} + - - find . -type d -exec chmod 775 {} + - - find exts/ -name .gitignore -delete - - zip -r kit-extensions.zip exts/ - artifacts: - name: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA - expose_as: "Kit Extensions" - paths: - - kit-extensions.zip - -# ============================================================================== -# Deployment Jobs -# -# This section currently contains jobs that publish files to the internal -# GitLab service. -# ============================================================================== + - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python3 -m twine upload --verbose --skip-existing --non-interactive --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* # Uploads the wheels to the internal GitLab package registry in the Warp project # See files at https://gitlab-master.nvidia.com/omniverse/warp/-/packages # Generated files will be in a branch/tag-specific folder publish wheels to gitlab package registry: stage: deploy - needs: ["create pypi wheels", "create kit artifacts"] + needs: ["create pypi wheels"] extends: - .runner-utility-linux-x86_64 rules: - if: $CI_COMMIT_BRANCH =~ /release-.*/ - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # Can be manually triggered for MRs - when: manual + - when: manual # If not auto-triggered, allow any pipeline to run this job manually allow_failure: true before_script: - apt-get update && apt-get install curl --no-install-recommends -y @@ -508,25 +520,8 @@ publish wheels to gitlab package registry: - | for file in $(find . -name '*.whl'); do filename=$(basename -- "$file") - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "$file" "https://gitlab-master.nvidia.com/api/v4/projects/${CI_PROJECT_ID}/packages/generic/warp/${CI_COMMIT_REF_SLUG}/${filename}" + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "$file" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/warp/${CI_COMMIT_REF_SLUG}/${filename}" done - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file kit-extensions.zip "https://gitlab-master.nvidia.com/api/v4/projects/${CI_PROJECT_ID}/packages/generic/warp/${CI_COMMIT_REF_SLUG}/kit-extensions.zip"' - -# Uploads the extensions to packman. -publish extensions to packman: - stage: deploy - needs: ["create kit artifacts"] - extends: - - .runner-utility-linux-x86_64 - rules: - - if: $CI_COMMIT_BRANCH =~ /release-.*/ - when: manual - allow_failure: true - script: - - tools/packman/packman pull -p linux-x86_64 deps/kit-deps.packman.xml - - rm -rf exts - - unzip kit-extensions.zip - - tools/repo.sh publish_exts .build-docs-common: stage: deploy @@ -601,5 +596,6 @@ pages: rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH environment: - name: staging + name: GitLab Pages + deployment_tier: staging url: https://omniverse.gitlab-master-pages.nvidia.com/warp/ diff --git a/.gitlab/ci/additional-tests.yml b/.gitlab/ci/additional-tests.yml index e9c5983b8..505aecc17 100644 --- a/.gitlab/ci/additional-tests.yml +++ b/.gitlab/ci/additional-tests.yml @@ -13,7 +13,7 @@ # # This pipeline can be triggered from the main GitLab pipeline under specific # circumstances. See the child pipelines defined in /.gitlab-ci.yml for the -# trigger conditions. It is not run in merge request pipelines. +# trigger conditions. It is not automatically run in merge request pipelines. # ============================================================================== include: /.gitlab/ci/common.yml diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index dac18d217..a3ca4e919 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -91,6 +91,10 @@ include: variables: PARENT_PIPELINE_ID: $CI_PIPELINE_ID PARENT_PROJECT_DIR: $CI_PROJECT_DIR + PARENT_COMMIT_BRANCH: $CI_COMMIT_BRANCH + PARENT_COMMIT_TAG: $CI_COMMIT_TAG + PARENT_COMMIT_REF_SLUG: $CI_COMMIT_REF_SLUG + PARENT_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA PM_PACKAGES_ROOT: '$PARENT_PROJECT_DIR/packman-repo' PIP_CACHE_DIR: '$PARENT_PROJECT_DIR/.cache/pip' CUDA_BIN: '$PARENT_PROJECT_DIR/_build/target-deps/cuda/bin' diff --git a/.gitlab/ci/cuda-11-build-and-test.yml b/.gitlab/ci/cuda-11-build-and-test.yml new file mode 100644 index 000000000..aa33da225 --- /dev/null +++ b/.gitlab/ci/cuda-11-build-and-test.yml @@ -0,0 +1,361 @@ +# Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +# ============================================================================== +# Warp+CUDA 11 Build and Testing Child Pipeline +# +# This child pipeline is used to build and test Warp when the library is built +# with the CUDA 11 Toolkit (release mode). +# +# This pipeline can be triggered from the main GitLab pipeline under specific +# circumstances. See the child pipelines defined in /.gitlab-ci.yml for the +# trigger conditions. It is not automatically run in merge request pipelines. +# ============================================================================== + +include: + - /.gitlab/ci/common.yml + - project: "omniverse/sectools/vault" + file: ["templates/v2/omni-packman-s3-creds.yml", "templates/v3/linux/packman_s3.gitlab-ci.yml"] + +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == "parent_pipeline" + +stages: + - build + - test + - package + - deploy + +# ============================================================================== +# Build Jobs (Debug) +# ============================================================================== + +linux-aarch64 build: + stage: build + image: ubuntu:22.04 + extends: + - .save_warp_bin_artifact + before_script: + - echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies" + - apt-get update && apt-get install build-essential curl --no-install-recommends -y + - echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" + script: + - ./tools/ci/building/build-linux-x86_64/build.sh --cuda 11 --no-docker # We are already using the builder image + - mkdir -p warp/bin/linux-aarch64 + - mv warp/bin/warp.so warp/bin/linux-aarch64 + - mv warp/bin/warp-clang.so warp/bin/linux-aarch64 + tags: + - arch/arm + +linux-x86_64 build: + stage: build + image: urm.nvidia.com/ct-omniverse-docker/centos7-gcc10-builder:3.2.0 + extends: + - .save_warp_bin_artifact + - .runner-large-build-linux-x86_64 + script: + - ./tools/ci/building/build-linux-x86_64/build.sh --cuda 11 --no-docker # We are already using the builder image + - mkdir -p warp/bin/linux-x86_64 + - mv warp/bin/warp.so warp/bin/linux-x86_64 + - mv warp/bin/warp-clang.so warp/bin/linux-x86_64 + +windows-x86_64 build: + stage: build + extends: + - .save_warp_bin_artifact + - .runner-build-windows-x86_64 + before_script: + - powershell -command "Get-Volume | Format-Table -AutoSize" + script: + - ./tools/ci/building/build-windows-x86_64/build.bat --cuda 11 + +mac-x86_64 build: + stage: build + extends: + - .save_warp_bin_artifact + - .runner-build-macos-universal + - .macos_warp_tags + script: + - ./tools/ci/building/build-linux-x86_64/build.sh + +# ============================================================================== +# Unit Testing Jobs +# +# Unlike the main testing jobs defined in /.gitlab-ci.yml, the CUDA 11 jobs don't +# generate code coverage reports. +# ============================================================================== + +linux-aarch64 test: + stage: test + image: ubuntu:22.04 + needs: [linux-aarch64 build] + extends: + - .save_test_report_artifact + before_script: + - echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies" + - !reference [.snippets, install-python+warp-aarch64] + - echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" + script: + - python -m warp.tests --junit-report-xml rspec.xml -s autodetect + tags: + - arch/arm + +linux-x86_64 test: + stage: test + needs: [linux-x86_64 build] + extends: + - .omni_nvks_gpu_2x + - .save_test_report_artifact + before_script: + - echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies" + - df -h + # Move compiled binaries out of platform-specific directory + - mv warp/bin/linux-x86_64/warp.so warp/bin/ + - mv warp/bin/linux-x86_64/warp-clang.so warp/bin/ + - tools/packman/packman install -l _build/target-deps/python python ${DEFAULT_PYTHON}-linux-x86_64 + - export PATH="$CUDA_BIN:$PATH" + - $PYTHON -m venv _venv + - source _venv/bin/activate + - python -m pip install --upgrade pip + - python -m pip install --upgrade usd-core + - python -m pip install --upgrade torch --extra-index-url https://download.pytorch.org/whl/cu121 + - python -m pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html + - python -m pip install -e . + - echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" + script: + - python -m warp.tests --junit-report-xml rspec.xml -s autodetect + +windows-x86_64 test: + stage: test + needs: [windows-x86_64 build] + extends: + - .runner-test-windows-x86_64-gpu + - .save_test_report_artifact + before_script: + - !reference [.snippets, define-powershell-GetTime] + - Write-Output "$([char]27)[0Ksection_start:$(GetTime):install_dependencies[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies" + - powershell -command "Get-Volume | Format-Table -AutoSize" + - $python_name = $DEFAULT_PYTHON + "-windows-x86_64" + - tools/packman/packman.cmd install -l _build/target-deps/python python $python_name + - '& $env:CI_PROJECT_DIR\_build\target-deps\python\python.exe -m venv _venv' + - .\_venv\Scripts\Activate.ps1 + - python -m pip install --upgrade pip + - python -m pip install --upgrade usd-core + - python -m pip install --upgrade torch --extra-index-url https://download.pytorch.org/whl/cu121 + - python -m pip install -e . + - Write-Output "$([char]27)[0Ksection_end:$(GetTime):install_dependencies$([char]13)$([char]27)[0K" + script: + - python -m warp.tests --junit-report-xml rspec.xml -s autodetect + tags: + - os/windows + - gpu/2x-A5000 + +mac-x86_64 test: + stage: test + needs: [mac-x86_64 build] + extends: + - .runner-test-macos-universal + - .macos_warp_tags + - .save_test_report_artifact + before_script: + - echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies" + - !reference [.snippets, install-python+warp-macos] + - python -m pip install --upgrade usd-core + - echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" + script: + - python -m warp.tests --junit-report-xml rspec.xml -s autodetect + +# ============================================================================== +# Packaging Jobs +# +# ============================================================================== + +# Creates wheel files for PyPI +# Note that compared to the job in .gitlab-ci.yml, there is no aarch64 job +# due to problems building a debug binary +create pypi wheels: + stage: package + needs: + - linux-aarch64 build + - linux-x86_64 build + - windows-x86_64 build + - mac-x86_64 build + extends: + - .runner-utility-linux-x86_64 + before_script: + # Move binaries into platform-specific folders. Already done in the build jobs for Linux. + - mkdir -p warp/bin/windows-x86_64 + - mv warp/bin/warp.dll warp/bin/windows-x86_64/ + - mv warp/bin/warp-clang.dll warp/bin/windows-x86_64/ + - mkdir -p warp/bin/macos-universal + - mv warp/bin/libwarp.dylib warp/bin/macos-universal/ + - mv warp/bin/libwarp-clang.dylib warp/bin/macos-universal/ + - python3 -m pip install --upgrade pip + - python3 -m pip install build + script: + - sed -i "s/^\(.*\)$/\1+cu11/" VERSION.md # Modify VERSION.md with +cu11 + - python3 -m build --wheel -C--build-option=-Pwindows-x86_64 + - python3 -m build --wheel -C--build-option=-Plinux-x86_64 + - python3 -m build --wheel -C--build-option=-Plinux-aarch64 + - sed -i "s/^\(.*\)+cu11$/\1+cpu/" VERSION.md # Modify VERSION.md with +cu12 replaced by +cpu + - python3 -m build --wheel -C--build-option=-Pmacos-universal + - sed -i "s/^\(.*\)+cpu$/\1/" VERSION.md # Revert VERSION.md changes + - mkdir -p dist-github + - mv dist/* dist-github/ + # Now make the wheels meant for PyPI publishing + - python3 -m build --wheel -C--build-option=-Pwindows-x86_64 + - python3 -m build --wheel -C--build-option=-Plinux-x86_64 + - python3 -m build --wheel -C--build-option=-Plinux-aarch64 + - python3 -m build --wheel -C--build-option=-Pmacos-universal + - find . -type f -exec chmod 664 {} + + - find . -type d -exec chmod 775 {} + + artifacts: + name: $PARENT_COMMIT_REF_SLUG-$PARENT_COMMIT_SHORT_SHA + expose_as: "Python Wheels" + paths: + - "dist/" + - "dist-github/" + when: always + +# Creates an artifact suitable for publishing the Kit extensions +create kit artifacts: + stage: package + needs: + - linux-x86_64 build + - windows-x86_64 build + extends: + - .runner-utility-linux-x86_64 + before_script: + # Move compiled binaries out of platform-specific directory + - mv warp/bin/linux-x86_64/warp.so warp/bin/ + - mv warp/bin/linux-x86_64/warp-clang.so warp/bin/ + - rm -r warp/bin/linux-x86_64/ + - rm -rf warp/native/cutlass + - apt-get update && apt-get install zip --no-install-recommends -y + script: + - python3 tools/ci/publishing/build_nodes_info.py + - mv warp exts/omni.warp.core/ + - find . -type f -exec chmod 664 {} + + - find . -type d -exec chmod 775 {} + + - find exts/ -name .gitignore -delete + - zip -r kit-extensions.zip exts/ + artifacts: + name: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA + expose_as: "Kit Extensions" + paths: + - kit-extensions.zip + +# ============================================================================== +# Deployment Jobs +# +# This section currently contains jobs that publish files to the internal +# GitLab service. +# ============================================================================== + +publish wheels to testpypi registry: + stage: deploy + image: python:3.11-slim + needs: ["create pypi wheels"] + extends: + - .runner-utility-linux-x86_64 + rules: + - if: $PARENT_COMMIT_BRANCH =~ /release-.*/ + when: manual + allow_failure: true + environment: + name: staging + url: https://test.pypi.org/project/warp-lang/ + before_script: + - python3 -m pip install --upgrade pip + - python3 -m pip install --upgrade build twine + script: + - python3 -m twine upload --verbose --skip-existing --non-interactive --repository testpypi dist/* -u __token__ -p $TESTPYPI_DEPLOY_KEY + +publish wheels to pypi registry: + stage: deploy + image: python:3.11-slim + needs: ["create pypi wheels"] + extends: + - .runner-utility-linux-x86_64 + rules: + - if: $PARENT_COMMIT_BRANCH =~ /release-.*/ + when: manual + allow_failure: true + environment: + name: production + url: https://pypi.org/project/warp-lang/ + before_script: + - python3 -m pip install --upgrade pip + - python3 -m pip install --upgrade build twine + script: + - python3 -m twine upload --verbose --skip-existing --non-interactive dist/* -u __token__ -p $PYPI_DEPLOY_KEY + +publish wheels to gitlab pypi registry: + stage: deploy + image: python:3.11-slim + needs: ["create pypi wheels"] + extends: + - .runner-utility-linux-x86_64 + rules: + - if: $PARENT_COMMIT_BRANCH =~ /release-.*/ + when: manual + allow_failure: true + before_script: + - python3 -m pip install --upgrade pip + - python3 -m pip install --upgrade build twine + script: + - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python3 -m twine upload --verbose --skip-existing --non-interactive --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist-github/* + +# Uploads the wheels to the internal GitLab package registry in the Warp project +# See files at https://gitlab-master.nvidia.com/omniverse/warp/-/packages +# Generated files will be in a branch/tag-specific folder +publish wheels to gitlab package registry: + stage: deploy + needs: ["create pypi wheels", "create kit artifacts"] + extends: + - .runner-utility-linux-x86_64 + rules: + - if: $PARENT_COMMIT_BRANCH =~ /release-.*/ + - when: manual # Can be triggered in all other scenarios + allow_failure: true + before_script: + - apt-get update && apt-get install curl --no-install-recommends -y + script: + - | + for file in $(find . -name '*.whl'); do + filename=$(basename -- "$file") + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "$file" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/warp/${CI_COMMIT_REF_SLUG}/${filename}" + done + - | + if [ -f kit-extension.zip ]; then + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file kit-extensions.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/warp/${CI_COMMIT_REF_SLUG}/kit-extensions.zip" + else + echo "kit-extensions.zip not found, skipping upload." + fi + + +# Uploads the extensions to packman. +publish extensions to packman: + stage: deploy + needs: ["create kit artifacts"] + extends: + - .runner-utility-linux-x86_64 + rules: + - if: $PARENT_COMMIT_BRANCH =~ /release-.*/ + when: manual + allow_failure: true + environment: + name: Kit Extension Registry + url: http://omniexts.nvidia.com/omni.warp + deployment_tier: production + before_script: + - rm -rf exts/ + - unzip kit-extensions.zip + - tools/packman/packman pull -p linux-x86_64 deps/kit-deps.packman.xml + script: + - tools/repo.sh publish_exts diff --git a/.gitlab/ci/debug-build-and-test.yml b/.gitlab/ci/debug-build-and-test.yml index af2805abd..8f1ba4043 100644 --- a/.gitlab/ci/debug-build-and-test.yml +++ b/.gitlab/ci/debug-build-and-test.yml @@ -13,7 +13,7 @@ # # This pipeline can be triggered from the main GitLab pipeline under specific # circumstances. See the child pipelines defined in /.gitlab-ci.yml for the -# trigger conditions. It is not run in merge request pipelines. +# trigger conditions. It is not automatically run in merge request pipelines. # ============================================================================== include: /.gitlab/ci/common.yml @@ -35,11 +35,15 @@ stages: # Hide this job for now until debug aarch64 builds work .linux-aarch64 build: stage: build - image: urm.nvidia.com/ct-omniverse-docker-local/u18-aarch64-builder:3.2.0 + image: ubuntu:22.04 extends: - .save_warp_bin_artifact + before_script: + - echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies" + - apt-get update && apt-get install build-essential curl --no-install-recommends -y + - echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" script: - - ./tools/ci/building/build-linux-x86_64/build.sh --debug --no-docker # We are already using the builder image + - ./tools/ci/building/build-linux-aarch64/build.sh --debug --no-docker # We are already using the builder image tags: - arch/arm @@ -48,7 +52,7 @@ linux-x86_64 build: image: urm.nvidia.com/ct-omniverse-docker/centos7-gcc10-builder:3.2.0 extends: - .save_warp_bin_artifact - - .runner-build-linux-x86_64 + - .runner-large-build-linux-x86_64 script: - ./tools/ci/building/build-linux-x86_64/build.sh --debug --no-docker # We are already using the builder image @@ -194,28 +198,3 @@ create pypi wheels: paths: - "dist/" when: always - -# ============================================================================== -# Deployment Jobs -# -# This section currently contains jobs that publish files to the internal -# GitLab service. -# ============================================================================== - -# Uploads the wheels to the internal GitLab package registry in the Warp project -# See files at https://gitlab-master.nvidia.com/omniverse/warp/-/packages -# Generated files will be in a branch/tag-specific folder -publish wheels to gitlab package registry: - stage: deploy - needs: ["create pypi wheels"] - extends: - - .runner-utility-linux-x86_64 - when: manual - before_script: - - apt-get update && apt-get install curl --no-install-recommends -y - script: - - | - for file in $(find . -name '*.whl'); do - filename=$(basename -- "$file") - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "$file" "https://gitlab-master.nvidia.com/api/v4/projects/${CI_PROJECT_ID}/packages/generic/warp-debug/${CI_COMMIT_REF_SLUG}/${filename}" - done diff --git a/PACKAGING.md b/PACKAGING.md index 9c61acc27..fd3813f96 100644 --- a/PACKAGING.md +++ b/PACKAGING.md @@ -114,6 +114,8 @@ First time: Per release: +Remove any `.whl` files from the upload folder that contain a `+cpu` or `+cu` (local) tag. + Run `python -m twine upload *` from the `.whl` packages folder (on Windows make sure to use `cmd` shell; Git Bash doesn't work). - username: `__token__` diff --git a/README.md b/README.md index 00b9923e8..91638a8b9 100644 --- a/README.md +++ b/README.md @@ -21,20 +21,25 @@ Please refer to the project [Documentation](https://nvidia.github.io/warp/) for

A selection of physical simulations computed with Warp

- ## Installing -Python version 3.9 or newer is recommended. Warp can run on x86-64 and ARMv8 CPUs on Windows, Linux, and macOS. GPU support requires a CUDA capable NVIDIA GPU and driver (minimum GeForce GTX 9xx). +Python version 3.9 or newer is recommended. Warp can run on x86-64 and ARMv8 CPUs on Windows, Linux, and macOS. +GPU support requires a CUDA-capable NVIDIA GPU and driver (minimum GeForce GTX 9xx). The easiest way to install Warp is from [PyPI](https://pypi.org/project/warp-lang/): pip install warp-lang -You can also use `pip install warp-lang[extras]` to install additional dependencies for running examples and USD-related features. +You can also use `pip install warp-lang[extras]` to install additional dependencies for running examples and USD-related features. + +The binaries hosted on PyPI are currently built with the CUDA 11.8 runtime. +We provide binaries built with the CUDA 12.5 runtime on the [GitHub Releases](https://github.com/NVIDIA/warp/releases) page. +Copy the URL of the appropriate wheel file (`warp-lang-{ver}+cu12-py3-none-{platform}.whl`) and pass it to +the `pip install` command, e.g. -Pre-built binary packages are also available on the [Releases](https://github.com/NVIDIA/warp/releases) page. To install in your local Python environment run the following command from the download directory: + pip install https://github.com/NVIDIA/warp/releases/download/v1.2.0/warp_lang-1.2.0+cu12-py3-none-manylinux2014_x86_64.whl - pip install warp_lang-.whl +The `--force-reinstall` option may need to be used to overwrite a previous installation. ## Getting Started @@ -73,10 +78,6 @@ print(lengths) The `examples` directory contains a number of scripts that show how to implement different simulation methods using the Warp API. Most examples will generate USD files containing time-sampled animations (stored in the current working directory). Before running examples, users should ensure that the ``usd-core``, ``matplotlib``, and ``pyglet`` packages are installed using: - pip install warp-lang[extras] - -Or can be manually installed with: - pip install usd-core matplotlib pyglet Examples can be run from the command-line as follows: diff --git a/deps/cuda-toolkit-deps.packman.xml b/deps/cuda-toolkit-deps.packman.xml new file mode 100644 index 000000000..7b3b4e6d6 --- /dev/null +++ b/deps/cuda-toolkit-deps.packman.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/deps/target-deps.packman.xml b/deps/target-deps.packman.xml index aba658fd9..06f32743e 100644 --- a/deps/target-deps.packman.xml +++ b/deps/target-deps.packman.xml @@ -1,27 +1,5 @@ - - - - - - - @@ -30,10 +8,4 @@ - - - - - - diff --git a/docs/index.rst b/docs/index.rst index fde0b2309..079569981 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,20 +15,15 @@ Below are some examples of simulations implemented using Warp: Quickstart ---------- -Python version 3.9 or newer is recommended. Warp can run on x86-64 and ARMv8 CPUs on Windows, Linux, and macOS. GPU support requires a CUDA-capable NVIDIA GPU and driver (minimum GeForce GTX 9xx). - The easiest way to install Warp is from `PyPI `_: .. code-block:: sh $ pip install warp-lang -Pre-built binary packages are also available on the `Releases `_ page. -To install in your local Python environment extract the archive and run the following command from the root directory: - -.. code-block:: sh - - $ pip install . +The binaries hosted on PyPI are currently built with the CUDA 11.8 runtime. +Users requiring a newer CUDA runtime in Warp can build Warp from source or +install wheels hosted on GitHub as described in :ref:`GitHub Installation`. Basic Example ------------- diff --git a/docs/installation.rst b/docs/installation.rst index a9e769df0..355680dd7 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -9,12 +9,21 @@ The easiest way to install Warp is from `PyPI `_ page. -To install in your local Python environment extract the archive and run the following command from the root directory: +.. _GitHub Installation: + +Installing from GitHub Releases +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The binaries hosted on PyPI are currently built with the CUDA 11.8 runtime. +We provide binaries built with the CUDA 12.5 runtime on the `GitHub Releases `_ page. +Copy the URL of the appropriate wheel file (``warp-lang-{ver}+cu12-py3-none-{platform}.whl``) and pass it to +the ``pip install`` command, e.g. .. code-block:: sh - $ pip install . + pip install https://github.com/NVIDIA/warp/releases/download/v1.2.0/warp_lang-1.2.0+cu12-py3-none-manylinux2014_x86_64.whl + +The ``--force-reinstall`` option may need to be used to overwrite a previous installation. Dependencies ------------ diff --git a/pyproject.toml b/pyproject.toml index 18c1a5791..f227f5ccf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ extras = ['usd-core', 'matplotlib', 'pyglet'] include = ["warp*"] [tool.setuptools.dynamic] -version = { attr = "warp.config.version" } +version = { file = ["VERSION.md"] } readme = { file = ["README.md"], content-type = "text/markdown" } [tool.ruff] diff --git a/tools/build_docs.bat b/tools/build_docs.bat deleted file mode 100644 index bef784752..000000000 --- a/tools/build_docs.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -call "%~dp0\repo.bat" build_docs %* diff --git a/tools/build_docs.sh b/tools/build_docs.sh deleted file mode 100755 index 5634c93ec..000000000 --- a/tools/build_docs.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) -source "$SCRIPT_DIR/repo.sh" build_docs $@ || exit $? diff --git a/tools/ci/building/build-linux-aarch64/build.sh b/tools/ci/building/build-linux-aarch64/build.sh index 8432ca544..519401837 100755 --- a/tools/ci/building/build-linux-aarch64/build.sh +++ b/tools/ci/building/build-linux-aarch64/build.sh @@ -10,29 +10,63 @@ fi USE_LINBUILD=1 BUILD_MODE="release" +SCRIPT_DIR=$(dirname ${BASH_SOURCE}) +CUDA_MAJOR_VER="12" -# scan command line for options -for arg; do - shift - case $arg in - --no-docker) - USE_LINBUILD=0 - ;; - --debug) - BUILD_MODE="debug" - ;; - esac +# Function to display usage information +usage() { + echo "Usage: $0 [options]" + echo "Options:" + echo " -h, --help Show this help message and exit." + echo " -d, --debug Enable debug mode." + echo " --no-docker Don't use Linbuild (Docker build)." + echo " --cuda MAJOR_VER Build Warp with a specific major version of the CUDA toolkit." +} - # keep all options (including --no-docker) to pass to repo.sh - if [[ $arg != "--debug" ]]; then - set -- "$@" "$arg" - fi +# Parse command-line arguments +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + usage + exit 0 + ;; + -d|--debug) + BUILD_MODE="debug" + shift + ;; + --no-docker) + USE_LINBUILD=0 + shift + ;; + --cuda) + if [[ -n "$2" ]]; then + CUDA_MAJOR_VER="$2" + shift 2 + else + echo "Error: --cuda requires a value" + usage + exit 1 + fi + ;; + *) + echo "Unknown option: $1" + usage + exit 1 + ;; + esac done -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) -#source "$SCRIPT_DIR/repo.sh" build --fetch-only $@ || exit $? +os="$(uname -s)" +os=$(echo "$os" | tr '[:upper:]' '[:lower:]') # to lowercase +if [[ "$os" == "darwin" ]]; then + os=macos +fi +arch=$(uname -m) +platform="$os-$arch" -"$SCRIPT_DIR/../../../repo.sh" build --fetch-only --config release $@ +source "${SCRIPT_DIR}/../../../packman/packman" pull --platform "${platform}" "${SCRIPT_DIR}/../../../../deps/host-deps.packman.xml" --verbose +source "${SCRIPT_DIR}/../../../packman/packman" pull --platform "${platform}" "${SCRIPT_DIR}/../../../../deps/target-deps.packman.xml" --verbose +source "${SCRIPT_DIR}/../../../packman/packman" pull --platform "${platform}" "${SCRIPT_DIR}/../../../../deps/cuda-toolkit-deps.packman.xml" --verbose --include-tag "cuda-${CUDA_MAJOR_VER}" PYTHON="$SCRIPT_DIR/../../../../_build/target-deps/python/python" LINBUILD="$SCRIPT_DIR/../../../../_build/host-deps/linbuild/linbuild.sh" @@ -40,21 +74,18 @@ CUDA="$SCRIPT_DIR/../../../../_build/target-deps/cuda" # pip deps $PYTHON -m pip install --upgrade pip -$PYTHON -m pip install numpy -$PYTHON -m pip install gitpython -$PYTHON -m pip install cmake -$PYTHON -m pip install ninja +$PYTHON -m pip install --upgrade numpy gitpython cmake ninja if [ "$GITLAB_CI" = "true" ]; then echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" fi -if [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$os" = "macos" ]]; then $PYTHON "$SCRIPT_DIR/../../../../build_lib.py" else if [ ${USE_LINBUILD} -ne 0 ]; then # build with docker for increased compatibility - $LINBUILD -- $PYTHON "$SCRIPT_DIR/../../../../build_lib.py" --cuda_path=$CUDA --mode=$BUILD_MODE + $LINBUILD --profile=centos7-gcc10-builder -- $PYTHON "$SCRIPT_DIR/../../../../build_lib.py" --cuda_path=$CUDA --mode=$BUILD_MODE else # build without docker $PYTHON "$SCRIPT_DIR/../../../../build_lib.py" --cuda_path=$CUDA --mode=$BUILD_MODE diff --git a/tools/ci/building/build-linux-x86_64/build.sh b/tools/ci/building/build-linux-x86_64/build.sh index ad9727f88..519401837 100755 --- a/tools/ci/building/build-linux-x86_64/build.sh +++ b/tools/ci/building/build-linux-x86_64/build.sh @@ -10,29 +10,63 @@ fi USE_LINBUILD=1 BUILD_MODE="release" +SCRIPT_DIR=$(dirname ${BASH_SOURCE}) +CUDA_MAJOR_VER="12" -# scan command line for options -for arg; do - shift - case $arg in - --no-docker) - USE_LINBUILD=0 - ;; - --debug) - BUILD_MODE="debug" - ;; - esac +# Function to display usage information +usage() { + echo "Usage: $0 [options]" + echo "Options:" + echo " -h, --help Show this help message and exit." + echo " -d, --debug Enable debug mode." + echo " --no-docker Don't use Linbuild (Docker build)." + echo " --cuda MAJOR_VER Build Warp with a specific major version of the CUDA toolkit." +} - # keep all options (including --no-docker) to pass to repo.sh - if [[ $arg != "--debug" ]]; then - set -- "$@" "$arg" - fi +# Parse command-line arguments +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + usage + exit 0 + ;; + -d|--debug) + BUILD_MODE="debug" + shift + ;; + --no-docker) + USE_LINBUILD=0 + shift + ;; + --cuda) + if [[ -n "$2" ]]; then + CUDA_MAJOR_VER="$2" + shift 2 + else + echo "Error: --cuda requires a value" + usage + exit 1 + fi + ;; + *) + echo "Unknown option: $1" + usage + exit 1 + ;; + esac done -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) -#source "$SCRIPT_DIR/repo.sh" build --fetch-only $@ || exit $? +os="$(uname -s)" +os=$(echo "$os" | tr '[:upper:]' '[:lower:]') # to lowercase +if [[ "$os" == "darwin" ]]; then + os=macos +fi +arch=$(uname -m) +platform="$os-$arch" -"$SCRIPT_DIR/../../../repo.sh" build --fetch-only --config release $@ +source "${SCRIPT_DIR}/../../../packman/packman" pull --platform "${platform}" "${SCRIPT_DIR}/../../../../deps/host-deps.packman.xml" --verbose +source "${SCRIPT_DIR}/../../../packman/packman" pull --platform "${platform}" "${SCRIPT_DIR}/../../../../deps/target-deps.packman.xml" --verbose +source "${SCRIPT_DIR}/../../../packman/packman" pull --platform "${platform}" "${SCRIPT_DIR}/../../../../deps/cuda-toolkit-deps.packman.xml" --verbose --include-tag "cuda-${CUDA_MAJOR_VER}" PYTHON="$SCRIPT_DIR/../../../../_build/target-deps/python/python" LINBUILD="$SCRIPT_DIR/../../../../_build/host-deps/linbuild/linbuild.sh" @@ -40,16 +74,13 @@ CUDA="$SCRIPT_DIR/../../../../_build/target-deps/cuda" # pip deps $PYTHON -m pip install --upgrade pip -$PYTHON -m pip install numpy -$PYTHON -m pip install gitpython -$PYTHON -m pip install cmake -$PYTHON -m pip install ninja +$PYTHON -m pip install --upgrade numpy gitpython cmake ninja if [ "$GITLAB_CI" = "true" ]; then echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K" fi -if [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$os" = "macos" ]]; then $PYTHON "$SCRIPT_DIR/../../../../build_lib.py" else if [ ${USE_LINBUILD} -ne 0 ]; then diff --git a/tools/ci/building/build-windows-x86_64/build.bat b/tools/ci/building/build-windows-x86_64/build.bat index 7a9318fc3..9a3fcd40a 100644 --- a/tools/ci/building/build-windows-x86_64/build.bat +++ b/tools/ci/building/build-windows-x86_64/build.bat @@ -1,26 +1,45 @@ -REM @echo off +@echo off +setlocal -REM pull packman dependencies -call "%~dp0..\..\..\repo.bat" build --fetch-only --config release %* +:: Enable delayed expansion +SETLOCAL ENABLEDELAYEDEXPANSION -REM Use Packman python +SET "BUILD_MODE=release" +SET "CUDA_MAJOR_VER=12" + +:: Loop through arguments +SET "PREV_ARG=" +for %%i in (%*) do ( + if "%%i"=="--debug" ( + SET "BUILD_MODE=debug" + ) else if "!PREV_ARG!"=="--cuda" ( + SET "CUDA_MAJOR_VER=%%i" + ) + SET "PREV_ARG=%%i" +) + +:: pull packman dependencies +SET "PLATFORM=windows-x86_64" +call "%~dp0..\..\..\packman\packman" pull --platform %PLATFORM% "%~dp0..\..\..\..\deps/host-deps.packman.xml" --verbose +call "%~dp0..\..\..\packman\packman" pull --platform %PLATFORM% "%~dp0..\..\..\..\deps/host-deps.packman.xml" --verbose +call "%~dp0..\..\..\packman\packman" pull --platform %PLATFORM% "%~dp0..\..\..\..\deps/target-deps.packman.xml" --verbose +call "%~dp0..\..\..\packman\packman" pull --platform %PLATFORM% "%~dp0..\..\..\..\deps/cuda-toolkit-deps.packman.xml" --verbose --include-tag "cuda-%CUDA_MAJOR_VER%" + +:: Use Packman python SET PYTHON="%~dp0..\..\..\..\_build\target-deps\python\python.exe" -REM Python dependencies +:: Python dependencies call %PYTHON% -m pip install --upgrade pip call %PYTHON% -m pip install numpy call %PYTHON% -m pip install gitpython call %PYTHON% -m pip install cmake call %PYTHON% -m pip install ninja -SET BUILD_MODE="release" -for %%i in (%*) do ( - if "%%i"=="--debug" set BUILD_MODE="debug" -) - -REM Build +:: Build call %PYTHON% "%~dp0..\..\..\..\build_lib.py" ^ --msvc_path="%~dp0..\..\..\..\_build\host-deps\msvc\VC\Tools\MSVC\14.29.30133" ^ --sdk_path="%~dp0..\..\..\..\_build\host-deps\winsdk" ^ --cuda_path="%~dp0..\..\..\..\_build\target-deps\cuda" ^ --mode=%BUILD_MODE% + +endlocal diff --git a/tools/package.bat b/tools/package.bat deleted file mode 100644 index 73935a9c0..000000000 --- a/tools/package.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -call "%~dp0\repo.bat" package %* diff --git a/tools/package.sh b/tools/package.sh deleted file mode 100755 index 92c39384a..000000000 --- a/tools/package.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) -source "$SCRIPT_DIR/repo.sh" package $@ || exit $? diff --git a/tools/publish.bat b/tools/publish.bat deleted file mode 100644 index af327d4c3..000000000 --- a/tools/publish.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -call "%~dp0\repo.bat" publish %* diff --git a/tools/publish.sh b/tools/publish.sh deleted file mode 100755 index a7f7a806a..000000000 --- a/tools/publish.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -SCRIPT_DIR=$(dirname ${BASH_SOURCE}) -source "$SCRIPT_DIR/repo.sh" publish $@ || exit $? diff --git a/tools/repo.bat b/tools/repo.bat deleted file mode 100755 index ba173748c..000000000 --- a/tools/repo.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off - -call "%~dp0\packman\python.bat" "%~dp0\repoman\repoman.py" %* -if %errorlevel% neq 0 ( goto Error ) - -:Success -exit /b 0 - -:Error -exit /b %errorlevel%