diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml old mode 100755 new mode 100644 diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml deleted file mode 100755 index f533bda..0000000 --- a/.azure-pipelines/azure-pipelines-win.yml +++ /dev/null @@ -1,41 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: win - pool: - vmImage: windows-2022 - strategy: - matrix: - win_64_: - CONFIG: win_64_ - UPLOAD_PACKAGES: 'True' - build_workspace_dir: D:\\bld\\ - free_disk_space: skip - pagefile_size: 0 - resize_partitions: false - store_build_artifacts: false - tools_install_dir: D:\Miniforge - timeoutInMinutes: 360 - variables: - UPLOAD_TEMP: D:\\tmp - - steps: - - script: | - call ".scripts\run_win_build.bat" - displayName: Run Windows build - env: - CI: azure - CONFIG: $(CONFIG) - CONDA_BLD_PATH: $(build_workspace_dir) - MINIFORGE_HOME: $(tools_install_dir) - PYTHONUNBUFFERED: 1 - UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) - UPLOAD_TEMP: $(UPLOAD_TEMP) - flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) - remote_url: $(Build.Repository.Uri) - sha: $(Build.SourceVersion) - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index fc6364b..9225de7 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -13,9 +13,9 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma9 +- quay.io/condaforge/linux-anvil-x86_64:alma10 rust_compiler: - rust target_platform: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index bd46690..ee55be1 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -13,9 +13,9 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma9 +- quay.io/condaforge/linux-anvil-x86_64:alma10 rust_compiler: - rust target_platform: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index d8a5d5f..1eef5c7 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -13,9 +13,9 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma9 +- quay.io/condaforge/linux-anvil-x86_64:alma10 rust_compiler: - rust target_platform: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index 2bbf602..78b8fc1 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' macos_machine: - x86_64-apple-darwin13.4.0 rust_compiler: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index 9c91225..a1771c8 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' macos_machine: - arm64-apple-darwin20.0.0 rust_compiler: diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 20b3107..30fb83d 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -23,7 +23,7 @@ jobs: matrix: include: - CONFIG: linux_64_ - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -35,7 +35,7 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_ - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -47,7 +47,7 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_ppc64le_ - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -58,10 +58,22 @@ jobs: resize_partitions: False runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 + - CONFIG: win_64_ + STORE_BUILD_ARTIFACTS: False + UPLOAD_PACKAGES: True + build_platform: win-64 + build_workspace_dir: D:\\bld\\ + docker_run_args: + free_disk_space: skip + os: windows + pagefile_size: 0 + resize_partitions: False + runs_on: ['windows-2022'] + tools_install_dir: D:\Miniforge steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Configure binfmt_misc if: matrix.os == 'ubuntu' shell: bash @@ -90,7 +102,7 @@ jobs: run: | export CONDA_BLD_PATH="${CONDA_BLD_PATH/#~/${HOME}}" export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" - export GIT_BRANCH="$(basename $GITHUB_REF)" + export GIT_BRANCH="${GITHUB_REF_NAME}" export MINIFORGE_HOME="${MINIFORGE_HOME/#~/${HOME}}" export flow_run_id="github_$GITHUB_RUN_ID" export remote_url="https://github.com/$GITHUB_REPOSITORY" @@ -120,7 +132,7 @@ jobs: run: | export CONDA_BLD_PATH="${CONDA_BLD_PATH/#~/${HOME}}" export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" - export GIT_BRANCH="$(basename $GITHUB_REF)" + export GIT_BRANCH="${GITHUB_REF_NAME}" export MINIFORGE_HOME="${MINIFORGE_HOME/#~/${HOME}}" export flow_run_id="github_$GITHUB_RUN_ID" export remote_url="https://github.com/$GITHUB_REPOSITORY" @@ -142,6 +154,7 @@ jobs: set "sha=%GITHUB_SHA%" call ".scripts\run_win_build.bat" env: + BUILD_PLATFORM: ${{ matrix.build_platform }} CI: github_actions CONDA_BLD_PATH: ${{ matrix.build_workspace_dir }} CONFIG: ${{ matrix.CONFIG }} diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index f5f84e1..857e215 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -64,7 +64,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # - --output-id vs. --output-name # - --clobber-file vs. none # - none vs. --target-platform - conda debug \ + CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug \ "${RECIPE_ROOT}" \ -m "${CI_SUPPORT}/${CONFIG}.yaml" \ ${EXTRA_CB_OPTIONS:-} \ @@ -80,7 +80,7 @@ else # - --clobber-file vs. none # - none vs. --target-platform # - --extra-meta a=b c=d vs. --extra-meta a=b --extra-meta c=d - conda-build \ + CONDA_SUBDIR="${BUILD_PLATFORM}" conda-build \ "${RECIPE_ROOT}" \ -m "${CI_SUPPORT}/${CONFIG}.yaml" \ ${EXTRA_CB_OPTIONS:-} \ diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh old mode 100644 new mode 100755 diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 5d1cbe6..4a041de 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -100,7 +100,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" fi - conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ + CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ ${EXTRA_CB_OPTIONS:-} \ --clobber-file ./.ci_support/clobber_${CONFIG}.yaml @@ -108,7 +108,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then /bin/bash else - conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ + CONDA_SUBDIR="${BUILD_PLATFORM}" conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 2f875ca..8210660 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -71,8 +71,12 @@ call :end_group :: Build the recipe echo Building recipe +set "_OLD_CONDA_SUBDIR=%CONDA_SUBDIR%" +set "CONDA_SUBDIR=%BUILD_PLATFORM%" conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% if !errorlevel! neq 0 exit /b !errorlevel! +set "_OLD_CONDA_SUBDIR=" +set "CONDA_SUBDIR=%_OLD_CONDA_SUBDIR%" call :start_group "Inspecting artifacts" :: inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 @@ -82,7 +86,7 @@ call :end_group :: Prepare some environment variables for the upload step if /i "%CI%" == "github_actions" ( set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" - set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%" + set "GIT_BRANCH=%GITHUB_REF_NAME%" if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( set "IS_PR_BUILD=True" ) else ( diff --git a/README.md b/README.md index e6c6e0f..27ef716 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,6 @@ Current build status variant - - win_64 - - - variant - - @@ -90,31 +83,73 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `wgpu-native` can be installed with `conda`: +How to use +---------- + +
+With conda ``` conda install wgpu-native ``` -or with `mamba`: +
+ +
+With mamba ``` mamba install wgpu-native ``` -It is possible to list all of the versions of `wgpu-native` available on your platform with `conda`: +
+ +
+With pixi + +``` +# for adding to your local project +pixi add wgpu-native +# for installing globally +pixi global install wgpu-native +``` + +
+ +Search package versions +----------------------- + +It is possible to list all of the versions of `wgpu-native` available on your platform: + +
+With conda ``` conda search wgpu-native --channel conda-forge ``` -or with `mamba`: +
+ +
+With mamba ``` mamba search wgpu-native --channel conda-forge ``` -Alternatively, `mamba repoquery` may provide more information: +
+ +
+With pixi + +``` +pixi search wgpu-native --channel conda-forge +``` + +
+ +
+With mamba repoquery, which may provide more information ``` # Search all versions available on your platform: @@ -127,6 +162,8 @@ mamba repoquery whoneeds wgpu-native --channel conda-forge mamba repoquery depends wgpu-native --channel conda-forge ``` +
+ About conda-forge ================= diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 03594e4..7e0f633 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,5 +28,4 @@ stages: condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) dependsOn: Check jobs: - - template: ./.azure-pipelines/azure-pipelines-osx.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 576215c..c088809 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,15 +1,32 @@ {% set version = "29.0.1.1" %} +{% set gpu_allocator_version = "0.28.0" %} package: name: wgpu-native version: {{ version }} source: - url: https://github.com/gfx-rs/wgpu-native/archive/refs/tags/v{{ version }}.tar.gz - sha256: 6008651e1d10022d4ded15b69405b4ba88577be5d623938ba98ad241b2cbf818 + - url: https://github.com/gfx-rs/wgpu-native/archive/refs/tags/v{{ version }}.tar.gz + sha256: 6008651e1d10022d4ded15b69405b4ba88577be5d623938ba98ad241b2cbf818 + patches: + # Build against the vendored gpu-allocator below rather than crates.io. + - patches/0001-use-the-vendored-patched-gpu-allocator.patch + # wgpu's vulkan backend has used gpu-allocator since wgpu v28, and its + # GpuToCpu path requires HOST_COHERENT, which on Intel's ANV forces every + # readback onto uncached memory -- 0.29 GB/s against 25 GB/s for the cached + # type on an Arrow Lake iGPU. Vendored here so the fix can be carried until + # it lands upstream. + - url: https://static.crates.io/crates/gpu-allocator/gpu-allocator-{{ gpu_allocator_version }}.crate + # A .crate file is a gzipped tarball, but conda-build dispatches on the + # file extension and does not recognise .crate, so name it .tar.gz here. + fn: gpu-allocator-{{ gpu_allocator_version }}.tar.gz + sha256: 51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795 + folder: gpu-allocator + patches: + - patches/0001-gpu-allocator-prefer-cached-for-readback.patch build: - number: 0 + number: 1 run_exports: # hmaarrfk: 2025/02/20 -- Too experimental for looser pinnings - {{ pin_subpackage('wgpu-native', max_pin='x.x.x.x') }} diff --git a/recipe/patches/0001-gpu-allocator-prefer-cached-for-readback.patch b/recipe/patches/0001-gpu-allocator-prefer-cached-for-readback.patch new file mode 100644 index 0000000..24508f4 --- /dev/null +++ b/recipe/patches/0001-gpu-allocator-prefer-cached-for-readback.patch @@ -0,0 +1,23 @@ +--- a/src/vulkan/mod.rs 2026-08-19 19:42:13.765780322 -0400 ++++ b/src/vulkan/mod.rs 2026-08-19 19:42:13.773392911 -0400 +@@ -817,6 +817,20 @@ + let mut memory_type_index_opt = + self.find_memorytype_index(&desc.requirements, mem_loc_preferred_bits); + ++ // A GpuToCpu allocation exists to be read by the CPU, so being cached ++ // matters more than being coherent. Some adapters -- Intel's ANV on ++ // parts whose GPU does not share the CPU's last level cache -- expose ++ // cached memory and coherent memory but never both, and reading the ++ // uncached (write-combined) type is about two orders of magnitude ++ // slower. Callers must flush and invalidate non-coherent ranges ++ // regardless, so prefer cached before giving that up. ++ if memory_type_index_opt.is_none() && desc.location == MemoryLocation::GpuToCpu { ++ memory_type_index_opt = self.find_memorytype_index( ++ &desc.requirements, ++ vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_CACHED, ++ ); ++ } ++ + if memory_type_index_opt.is_none() { + let mem_loc_required_bits = match desc.location { + MemoryLocation::GpuOnly => vk::MemoryPropertyFlags::DEVICE_LOCAL, diff --git a/recipe/patches/0001-use-the-vendored-patched-gpu-allocator.patch b/recipe/patches/0001-use-the-vendored-patched-gpu-allocator.patch new file mode 100644 index 0000000..12e9f10 --- /dev/null +++ b/recipe/patches/0001-use-the-vendored-patched-gpu-allocator.patch @@ -0,0 +1,12 @@ +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -133,3 +133,9 @@ + + [build-dependencies] + bindgen = "0.72" ++ ++# Build against the copy of gpu-allocator vendored by this recipe, which ++# carries a fix for readback allocations landing on uncached memory. See ++# recipe/patches/0001-gpu-allocator-prefer-cached-for-readback.patch. ++[patch.crates-io] ++gpu-allocator = { path = "gpu-allocator" }