From 854e49edfb2b4305761788472259c840db6e38dc Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 08:53:29 -0500 Subject: [PATCH 01/22] change build config --- recipe/conda_build_config.yaml | 36 ++++++++-------------------------- recipe/meta.yaml | 4 ++-- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 8dd2a62..a993e3c 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,36 +1,16 @@ docker_image: # [os.environ.get("BUILD_PLATFORM", "").startswith("linux") or (os.environ.get("CONFIG_VERSION", "1") == "1" and linux)] - - quay.io/condaforge/linux-anvil-cuda:9.2 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] - - quay.io/condaforge/linux-anvil-cuda:10.2 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] - quay.io/condaforge/linux-anvil-cuda:11.2 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] -c_compiler_version: # [linux] - - 7 # [linux64 or aarch64] - - 7 # [linux64 or aarch64] - - 7 # [linux64 or aarch64] -cxx_compiler_version: # [linux] - - 7 # [linux64 or aarch64] - - 7 # [linux64 or aarch64] - - 7 # [linux64 or aarch64] -fortran_compiler_version: # [linux] - - 7 # [linux64 or aarch64] - - 7 # [linux64 or aarch64] - - 7 # [linux64 or aarch64] - +c_compiler_version: # [linux] + - 10 # [linux64 or aarch64] +cxx_compiler_version: # [linux] + - 10 # [linux64 or aarch64] cuda_compiler_version: - - 9.2 # [linux64] - - 10.2 # [linux64] - - 11.2 # [linux64] - -cudnn: - - 7 # [linux64] - - 8 # [linux64] - - 8 # [linux64] + - 11.2 # [linux64] -cdt_name: # [linux] - - cos6 # [linux64] - - cos7 # [linux64] - - cos7 # [linux64] +cdt_name: # [linux] + - cos7 # [linux64] channel_sources: - - conda-forge,defaults + - conda-forge \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index dd907c2..637a199 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -25,11 +25,11 @@ requirements: - make # [not win] - libgomp # [linux] host: - - boost-cpp + - libboost-devel - libtiff - fftw + - libcufft-dev # [(cuda_compiler_version or "").startswith("12")] run: - - boost-cpp test: commands: From 6e3bc99560bd7c3b59a92b2aa4880b523970c8b7 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 09:06:56 -0500 Subject: [PATCH 02/22] MNT: Re-rendered with conda-build 3.27.0, conda-smithy 3.29.0, and conda-forge-pinning 2023.11.18.11.24.55 --- .azure-pipelines/azure-pipelines-linux.yml | 22 ++-- .azure-pipelines/azure-pipelines-win.yml | 65 +++------- ...er_version11.2cxx_compiler_version10.yaml} | 16 ++- ...er_version12.0cxx_compiler_version12.yaml} | 22 ++-- .../linux_64_cuda_compiler_version9.2.yaml | 37 ------ .../win_64_cuda_compiler_version10.2.yaml | 23 ---- .../win_64_cuda_compiler_version11.1.yaml | 23 ---- ...ercuda-nvcccuda_compiler_version12.0.yaml} | 18 +-- ...ompilernvcccuda_compiler_version11.2.yaml} | 14 +-- .scripts/build_steps.sh | 18 ++- .scripts/logging_utils.sh | 4 +- .scripts/run_docker_build.sh | 3 + .scripts/run_win_build.bat | 116 ++++++++++++++++++ ... conda_build_config.yaml.conda.smithy.bak} | 23 +++- 14 files changed, 213 insertions(+), 191 deletions(-) rename .ci_support/{linux_64_cuda_compiler_version11.2.yaml => linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml} (79%) rename .ci_support/{linux_64_cuda_compiler_version10.2.yaml => linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml} (68%) delete mode 100644 .ci_support/linux_64_cuda_compiler_version9.2.yaml delete mode 100644 .ci_support/win_64_cuda_compiler_version10.2.yaml delete mode 100644 .ci_support/win_64_cuda_compiler_version11.1.yaml rename .ci_support/{win_64_cuda_compiler_version11.0.yaml => win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml} (59%) rename .ci_support/{win_64_cuda_compiler_version11.2.yaml => win_64_cuda_compilernvcccuda_compiler_version11.2.yaml} (66%) create mode 100755 .scripts/run_win_build.bat rename recipe/{conda_build_config.yaml => conda_build_config.yaml.conda.smithy.bak} (57%) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index ccbfe07..cf254ed 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -8,28 +8,19 @@ jobs: vmImage: ubuntu-latest strategy: matrix: - linux_64_cuda_compiler_version10.2: - CONFIG: linux_64_cuda_compiler_version10.2 - UPLOAD_PACKAGES: 'False' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:10.2 - linux_64_cuda_compiler_version11.2: - CONFIG: linux_64_cuda_compiler_version11.2 + linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10: + CONFIG: linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10 UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 - linux_64_cuda_compiler_version9.2: - CONFIG: linux_64_cuda_compiler_version9.2 + linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12: + CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12 UPLOAD_PACKAGES: 'False' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:9.2 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 steps: - checkout: self fetchDepth: 0 - - script: | - rm -rf /opt/ghc - df -h - displayName: Manage disk space - # configure qemu binfmt-misc running. This allows us to run docker containers # embedded qemu-static - script: | @@ -40,6 +31,9 @@ jobs: - script: | export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 8e62172..de46a63 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -5,28 +5,24 @@ jobs: - job: win pool: - vmImage: windows-2019 + vmImage: windows-2022 strategy: matrix: - win_64_cuda_compiler_version10.2: - CONFIG: win_64_cuda_compiler_version10.2 + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0: + CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0 UPLOAD_PACKAGES: 'False' - win_64_cuda_compiler_version11.0: - CONFIG: win_64_cuda_compiler_version11.0 - UPLOAD_PACKAGES: 'False' - win_64_cuda_compiler_version11.1: - CONFIG: win_64_cuda_compiler_version11.1 - UPLOAD_PACKAGES: 'False' - win_64_cuda_compiler_version11.2: - CONFIG: win_64_cuda_compiler_version11.2 + win_64_cuda_compilernvcccuda_compiler_version11.2: + CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.2 UPLOAD_PACKAGES: 'False' timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_TEMP: D:\\tmp steps: - checkout: self fetchDepth: 0 + - task: PythonScript@0 displayName: 'Download Miniforge' inputs: @@ -45,42 +41,15 @@ jobs: displayName: Add conda to PATH - script: | - call activate base - mamba.exe install "python=3.9" conda-build conda pip conda-forge-ci-setup=3 "py-lief<0.12" -c conda-forge --strict-channel-priority --yes - displayName: Install conda-build - - - script: set PYTHONUNBUFFERED=1 - displayName: Set PYTHONUNBUFFERED - - # Configure the VM - - script: | - call activate base - setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml - displayName: conda-forge CI setup - - # Configure the VM. - - script: | - set "CI=azure" - call activate base - run_conda_forge_build_setup - displayName: conda-forge build setup - - - script: | - call activate base - if EXIST LICENSE.txt ( - copy LICENSE.txt "recipe\\recipe-scripts-license.txt" - ) - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables - displayName: Build recipe + call ".scripts\run_win_build.bat" + displayName: Run Windows build env: PYTHONUNBUFFERED: 1 - - - script: | - set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" - set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" - call activate base - upload_package .\ ".\recipe" .ci_support\%CONFIG%.yaml - displayName: Upload package - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False')), not(eq(variables['Build.Reason'], 'PullRequest'))) \ No newline at end of file + CONFIG: $(CONFIG) + CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) + UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) + UPLOAD_TEMP: $(UPLOAD_TEMP) + BINSTAR_TOKEN: $(BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/linux_64_cuda_compiler_version11.2.yaml b/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml similarity index 79% rename from .ci_support/linux_64_cuda_compiler_version11.2.yaml rename to .ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml index 319239e..8f845a1 100644 --- a/.ci_support/linux_64_cuda_compiler_version11.2.yaml +++ b/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml @@ -1,13 +1,11 @@ -boost_cpp: -- 1.78.0 c_compiler: - gcc c_compiler_version: -- '7' +- '10' cdt_name: - cos7 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cuda_compiler: @@ -17,21 +15,21 @@ cuda_compiler_version: cxx_compiler: - gxx cxx_compiler_version: -- '7' +- '10' docker_image: - quay.io/condaforge/linux-anvil-cuda:11.2 fftw: - '3' +libboost_devel: +- '1.82' libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x +- '4.6' target_platform: - linux-64 zip_keys: - - c_compiler_version - cxx_compiler_version + - cuda_compiler - cuda_compiler_version - cdt_name - docker_image diff --git a/.ci_support/linux_64_cuda_compiler_version10.2.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml similarity index 68% rename from .ci_support/linux_64_cuda_compiler_version10.2.yaml rename to .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml index 179619d..c4b45b2 100644 --- a/.ci_support/linux_64_cuda_compiler_version10.2.yaml +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml @@ -1,37 +1,35 @@ -boost_cpp: -- 1.78.0 c_compiler: - gcc c_compiler_version: -- '7' +- '12' cdt_name: - cos7 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cuda_compiler: -- nvcc +- cuda-nvcc cuda_compiler_version: -- '10.2' +- '12.0' cxx_compiler: - gxx cxx_compiler_version: -- '7' +- '12' docker_image: -- quay.io/condaforge/linux-anvil-cuda:10.2 +- quay.io/condaforge/linux-anvil-cos7-x86_64 fftw: - '3' +libboost_devel: +- '1.82' libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x +- '4.6' target_platform: - linux-64 zip_keys: - - c_compiler_version - cxx_compiler_version + - cuda_compiler - cuda_compiler_version - cdt_name - docker_image diff --git a/.ci_support/linux_64_cuda_compiler_version9.2.yaml b/.ci_support/linux_64_cuda_compiler_version9.2.yaml deleted file mode 100644 index d66ee00..0000000 --- a/.ci_support/linux_64_cuda_compiler_version9.2.yaml +++ /dev/null @@ -1,37 +0,0 @@ -boost_cpp: -- 1.78.0 -c_compiler: -- gcc -c_compiler_version: -- '7' -cdt_name: -- cos6 -channel_sources: -- conda-forge,defaults -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '9.2' -cxx_compiler: -- gxx -cxx_compiler_version: -- '7' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:9.2 -fftw: -- '3' -libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - cuda_compiler_version - - cdt_name - - docker_image diff --git a/.ci_support/win_64_cuda_compiler_version10.2.yaml b/.ci_support/win_64_cuda_compiler_version10.2.yaml deleted file mode 100644 index a070cfb..0000000 --- a/.ci_support/win_64_cuda_compiler_version10.2.yaml +++ /dev/null @@ -1,23 +0,0 @@ -boost_cpp: -- 1.78.0 -c_compiler: -- vs2019 -channel_sources: -- conda-forge,defaults -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '10.2' -cxx_compiler: -- vs2019 -fftw: -- '3' -libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x -target_platform: -- win-64 diff --git a/.ci_support/win_64_cuda_compiler_version11.1.yaml b/.ci_support/win_64_cuda_compiler_version11.1.yaml deleted file mode 100644 index fa990f5..0000000 --- a/.ci_support/win_64_cuda_compiler_version11.1.yaml +++ /dev/null @@ -1,23 +0,0 @@ -boost_cpp: -- 1.78.0 -c_compiler: -- vs2019 -channel_sources: -- conda-forge,defaults -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.1' -cxx_compiler: -- vs2019 -fftw: -- '3' -libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x -target_platform: -- win-64 diff --git a/.ci_support/win_64_cuda_compiler_version11.0.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml similarity index 59% rename from .ci_support/win_64_cuda_compiler_version11.0.yaml rename to .ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml index 167dba3..3b3b5c0 100644 --- a/.ci_support/win_64_cuda_compiler_version11.0.yaml +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml @@ -1,23 +1,23 @@ -boost_cpp: -- 1.78.0 c_compiler: - vs2019 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cuda_compiler: -- nvcc +- cuda-nvcc cuda_compiler_version: -- '11.0' +- '12.0' cxx_compiler: - vs2019 fftw: - '3' +libboost_devel: +- '1.82' libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x +- '4.6' target_platform: - win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/.ci_support/win_64_cuda_compiler_version11.2.yaml b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml similarity index 66% rename from .ci_support/win_64_cuda_compiler_version11.2.yaml rename to .ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml index 2919beb..08de9d5 100644 --- a/.ci_support/win_64_cuda_compiler_version11.2.yaml +++ b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml @@ -1,9 +1,7 @@ -boost_cpp: -- 1.78.0 c_compiler: - vs2019 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cuda_compiler: @@ -14,10 +12,12 @@ cxx_compiler: - vs2019 fftw: - '3' +libboost_devel: +- '1.82' libtiff: -- '4' -pin_run_as_build: - boost-cpp: - max_pin: x.x.x +- '4.6' target_platform: - win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 9e26040..8021e3a 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -28,12 +28,15 @@ conda-build: pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache - /opt/conda/pkgs +solver: libmamba CONDARC +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 - -mamba install --update-specs --yes --quiet --channel conda-forge \ - conda-build pip conda-forge-ci-setup=3 "py-lief<0.12" +mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -51,6 +54,12 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi +if [[ "${sha:-}" == "" ]]; then + pushd ${FEEDSTOCK_ROOT} + sha=$(git rev-parse HEAD) + popd +fi + 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}" @@ -64,7 +73,8 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then else conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" ( startgroup "Uploading packages" ) 2> /dev/null diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh index 57bc95c..aff009f 100644 --- a/.scripts/logging_utils.sh +++ b/.scripts/logging_utils.sh @@ -12,7 +12,7 @@ function startgroup { echo "##[group]$1";; travis ) echo "$1" - echo -en 'travis_fold:start:'"${1// /}"'\\r';; + echo -en 'travis_fold:start:'"${1// /}"'\r';; github_actions ) echo "::group::$1";; * ) @@ -28,7 +28,7 @@ function endgroup { azure ) echo "##[endgroup]";; travis ) - echo -en 'travis_fold:end:'"${1// /}"'\\r';; + echo -en 'travis_fold:end:'"${1// /}"'\r';; github_actions ) echo "::endgroup::";; esac diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index c4079b7..db9a6e2 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -91,6 +91,9 @@ docker run ${DOCKER_RUN_ARGS} \ -e CPU_COUNT \ -e BUILD_WITH_CONDA_DEBUG \ -e BUILD_OUTPUT_ID \ + -e flow_run_id \ + -e remote_url \ + -e sha \ -e BINSTAR_TOKEN \ "${DOCKER_IMAGE}" \ bash \ diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 0000000..c9c6d54 --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,116 @@ +:: PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +:: will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +:: benefit from the improvement. + +:: Note: we assume a Miniforge installation is available + +:: INPUTS (required environment variables) +:: CONFIG: name of the .ci_support/*.yaml file for this job +:: CI: azure, github_actions, or unset +:: UPLOAD_PACKAGES: true or false +:: UPLOAD_ON_BRANCH: true or false + +setlocal enableextensions enabledelayedexpansion + +call :start_group "Configuring conda" + +:: Activate the base conda environment +call activate base +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" + +:: Provision the necessary dependencies to build the recipe later +echo Installing dependencies +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 -c conda-forge --strict-channel-priority --yes +if !errorlevel! neq 0 exit /b !errorlevel! + +:: Set basic configuration +echo Setting up configuration +setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml +if !errorlevel! neq 0 exit /b !errorlevel! +echo Running build setup +CALL run_conda_forge_build_setup + + +if !errorlevel! neq 0 exit /b !errorlevel! + +if EXIST LICENSE.txt ( + echo Copying feedstock license + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" +) + +if NOT [%flow_run_id%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" +) + +call :end_group + +:: Build the recipe +echo Building recipe +conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +if !errorlevel! neq 0 exit /b !errorlevel! + +:: 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/=%" + if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%RUNNER_TEMP%" +) +if /i "%CI%" == "azure" ( + set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" + set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" + if /i "%BUILD_REASON%" == "PullRequest" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%UPLOAD_TEMP%" +) + +:: Validate + +if /i "%UPLOAD_PACKAGES%" == "true" ( + if /i "%IS_PR_BUILD%" == "false" ( + call :start_group "Uploading packages" + if not exist "%TEMP%\" md "%TEMP%" + set "TMP=%TEMP%" + upload_package .\ ".\recipe" .ci_support\%CONFIG%.yaml + if !errorlevel! neq 0 exit /b !errorlevel! + call :end_group + ) +) + +exit + +:: Logging subroutines + +:start_group +if /i "%CI%" == "github_actions" ( + echo ::group::%~1 + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[group]%~1 + exit /b +) +echo %~1 +exit /b + +:end_group +if /i "%CI%" == "github_actions" ( + echo ::endgroup:: + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[endgroup] + exit /b +) +exit /b \ No newline at end of file diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml.conda.smithy.bak similarity index 57% rename from recipe/conda_build_config.yaml rename to recipe/conda_build_config.yaml.conda.smithy.bak index a993e3c..09def04 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml.conda.smithy.bak @@ -1,16 +1,33 @@ docker_image: # [os.environ.get("BUILD_PLATFORM", "").startswith("linux") or (os.environ.get("CONFIG_VERSION", "1") == "1" and linux)] - quay.io/condaforge/linux-anvil-cuda:11.2 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] + - quay.io/condaforge/linux-anvil-cos7-x86_64 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] c_compiler_version: # [linux] - 10 # [linux64 or aarch64] + - 12 # [linux64 or aarch64] cxx_compiler_version: # [linux] - 10 # [linux64 or aarch64] - -cuda_compiler_version: - - 11.2 # [linux64] + - 12 # [linux64 or aarch64] cdt_name: # [linux] - cos7 # [linux64] + - cos7 # [linux64] + +cuda_compiler: + - nvcc + - cuda-nvcc + +cuda_compiler_version: + - 11.2 + - 12.0 + +libboost_devel: + - '1.82' + - '1.82' + +libtiff: + - 4.6 + - 4.6 channel_sources: - conda-forge \ No newline at end of file From c97d35d6691f545b52186b573bb88dac5fa5cf0d Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 09:08:10 -0500 Subject: [PATCH 03/22] commit config --- ...ild_config.yaml.conda.smithy.bak => conda_build_config.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename recipe/{conda_build_config.yaml.conda.smithy.bak => conda_build_config.yaml} (98%) diff --git a/recipe/conda_build_config.yaml.conda.smithy.bak b/recipe/conda_build_config.yaml similarity index 98% rename from recipe/conda_build_config.yaml.conda.smithy.bak rename to recipe/conda_build_config.yaml index 09def04..78ba5fd 100644 --- a/recipe/conda_build_config.yaml.conda.smithy.bak +++ b/recipe/conda_build_config.yaml @@ -30,4 +30,4 @@ libtiff: - 4.6 channel_sources: - - conda-forge \ No newline at end of file + - conda-forge From bd25635e9a48157ff8f52cdfce6188b8323ec160 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 10:08:30 -0500 Subject: [PATCH 04/22] updates for cuda12 --- src/geometryTransform.cu | 75 ++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/src/geometryTransform.cu b/src/geometryTransform.cu index ce9a3f3..9ea1eb9 100644 --- a/src/geometryTransform.cu +++ b/src/geometryTransform.cu @@ -177,13 +177,12 @@ __host__ void duplicateReversedStack_GPU(GPUBuffer &zExpanded, int nx, int ny, i } -texture texRef; // Simple transformation kernel __global__ void transformKernel(float *output, int nx, int ny, int nz, - float *mat) + float *mat, cudaTextureObject_t texObj) { // Calculate texture coordinates @@ -210,14 +209,16 @@ __global__ void transformKernel(float *output, // Read from texture and write to global memory int idx = z * (nx*ny) + y * nx + x; - output[idx] = tex3D(texRef, tu, tv, tw); + float val; + cudaTex3D(&val, texObj, tu, tv, tw); + output[idx] = val; } // Simple transformation kernel __global__ void transformKernelRA(float *output, int nx, int ny, int nz, float dx, float dy, float dz, - float *mat) + float *mat, cudaTextureObject_t texObj) { // Calculate texture coordinates @@ -250,7 +251,9 @@ __global__ void transformKernelRA(float *output, // Read from texture and write to global memory int idx = z * (nx*ny) + y * nx + x; - output[idx] = tex3D(texRef, tu, tv, tw); + float val; + cudaTex3D(&val, texObj, tu, tv, tw); + output[idx] = val; } @@ -259,19 +262,23 @@ __host__ void affine_GPU(cudaArray *cuArray, int nx, int ny, int nz, float * result, GPUBuffer &affMat) { - // Allocate CUDA array in device memory - cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc( - 32, 0, 0, 0, cudaChannelFormatKindFloat); + // Create texture object + cudaTextureObject_t texObj; + cudaResourceDesc resDesc; + memset(&resDesc, 0, sizeof(resDesc)); + resDesc.resType = cudaResourceTypeArray; + resDesc.res.array.array = cuArray; - // Set texture reference parameters - texRef.addressMode[0] = cudaAddressModeBorder; - texRef.addressMode[1] = cudaAddressModeBorder; - texRef.addressMode[2] = cudaAddressModeBorder; - texRef.filterMode = cudaFilterModeLinear; - texRef.normalized = false; + cudaTextureDesc texDesc; + memset(&texDesc, 0, sizeof(texDesc)); + texDesc.readMode = cudaReadModeElementType; + texDesc.addressMode[0] = cudaAddressModeBorder; + texDesc.addressMode[1] = cudaAddressModeBorder; + texDesc.addressMode[2] = cudaAddressModeBorder; + texDesc.filterMode = cudaFilterModeLinear; + texDesc.normalizedCoords = false; - // Bind the array to the texture reference - cudaBindTextureToArray(texRef, cuArray, channelDesc); + cudaCreateTextureObject(&texObj, &resDesc, &texDesc, NULL); // Allocate result of transformation in device memory float* output; @@ -283,9 +290,12 @@ __host__ void affine_GPU(cudaArray *cuArray, int nx, int ny, int nz, (ny + dimBlock.y - 1) / dimBlock.y, (nz + dimBlock.z - 1) / dimBlock.z); - transformKernel<<>>(output, nx, ny, nz, (float *) affMat.getPtr()); + transformKernel<<>>(output, nx, ny, nz, (float *) affMat.getPtr(), texObj); CudaCheckError(); + // Destroy texture object + cudaDestroyTextureObject(texObj); + //transfer result back to host cudaMemcpy(result, output, nz * nx * ny * sizeof(float), cudaMemcpyDeviceToHost); @@ -300,19 +310,23 @@ __host__ void affine_GPU_RA(cudaArray *cuArray, int nx, int ny, int nz, float * result, GPUBuffer &affMat) { - // Allocate CUDA array in device memory - cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc( - 32, 0, 0, 0, cudaChannelFormatKindFloat); + // Create texture object + cudaTextureObject_t texObj; + cudaResourceDesc resDesc; + memset(&resDesc, 0, sizeof(resDesc)); + resDesc.resType = cudaResourceTypeArray; + resDesc.res.array.array = cuArray; - // Set texture reference parameters - texRef.addressMode[0] = cudaAddressModeBorder; - texRef.addressMode[1] = cudaAddressModeBorder; - texRef.addressMode[2] = cudaAddressModeBorder; - texRef.filterMode = cudaFilterModeLinear; - texRef.normalized = false; + cudaTextureDesc texDesc; + memset(&texDesc, 0, sizeof(texDesc)); + texDesc.readMode = cudaReadModeElementType; + texDesc.addressMode[0] = cudaAddressModeBorder; + texDesc.addressMode[1] = cudaAddressModeBorder; + texDesc.addressMode[2] = cudaAddressModeBorder; + texDesc.filterMode = cudaFilterModeLinear; + texDesc.normalizedCoords = false; - // Bind the array to the texture reference - cudaBindTextureToArray(texRef, cuArray, channelDesc); + cudaCreateTextureObject(&texObj, &resDesc, &texDesc, NULL); // Allocate result of transformation in device memory float* output; @@ -324,9 +338,12 @@ __host__ void affine_GPU_RA(cudaArray *cuArray, int nx, int ny, int nz, (ny + dimBlock.y - 1) / dimBlock.y, (nz + dimBlock.z - 1) / dimBlock.z); - transformKernelRA<<>>(output, nx, ny, nz, dx, dy, dz, (float *) affMat.getPtr()); + transformKernelRA<<>>(output, nx, ny, nz, dx, dy, dz, (float *) affMat.getPtr(), texObj); CudaCheckError(); + // Destroy texture object + cudaDestroyTextureObject(texObj); + //transfer result back to host cudaMemcpy(result, output, nz * nx * ny * sizeof(float), cudaMemcpyDeviceToHost); From d7982bf0cc84e29b9e213cd3ac50b5c18a07163b Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 10:22:44 -0500 Subject: [PATCH 05/22] back to tex3D --- src/geometryTransform.cu | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/geometryTransform.cu b/src/geometryTransform.cu index 9ea1eb9..aed3d05 100644 --- a/src/geometryTransform.cu +++ b/src/geometryTransform.cu @@ -209,9 +209,7 @@ __global__ void transformKernel(float *output, // Read from texture and write to global memory int idx = z * (nx*ny) + y * nx + x; - float val; - cudaTex3D(&val, texObj, tu, tv, tw); - output[idx] = val; + output[idx] = tex3D(texObj, tu, tv, tw); } // Simple transformation kernel @@ -251,9 +249,7 @@ __global__ void transformKernelRA(float *output, // Read from texture and write to global memory int idx = z * (nx*ny) + y * nx + x; - float val; - cudaTex3D(&val, texObj, tu, tv, tw); - output[idx] = val; + output[idx] = tex3D(texObj, tu, tv, tw); } From 1122a00208de6252c164c81df969abd9a3953ed2 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 10:30:02 -0500 Subject: [PATCH 06/22] bump version --- src/CMakeLists.txt | 4 ++-- src/linearDecon.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7d53726..6a28976 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,8 +19,8 @@ project (cudaDecon) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) set(VERSION_MAJOR "0") -set(VERSION_MINOR "6") -set(VERSION_PATCH "1") +set(VERSION_MINOR "7") +set(VERSION_PATCH "0") set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) # set -fPIC for all targets (for shared libraries) diff --git a/src/linearDecon.cpp b/src/linearDecon.cpp index c6a3df6..4573f37 100644 --- a/src/linearDecon.cpp +++ b/src/linearDecon.cpp @@ -10,7 +10,7 @@ #pragma warning(disable : 4305) // Disregard loss of data from double to float. #endif -std::string version_number = "0.6.2"; +std::string version_number = "0.7.0"; CImg<> next_file_image; CImg<> ToSave; From b2ef409569bf5df8d85285f079d7159cbc7a09dd Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 11:20:07 -0500 Subject: [PATCH 07/22] rerender --- .azure-pipelines/azure-pipelines-linux.yml | 8 ++++---- .azure-pipelines/azure-pipelines-win.yml | 8 ++++---- ...ecuda_compiler_version11.2cxx_compiler_version10.yaml} | 2 +- ...ccuda_compiler_version12.0cxx_compiler_version12.yaml} | 2 +- ...in_64_cuda_compilerNonecuda_compiler_version11.2.yaml} | 2 +- ...in_64_cuda_compilernvcccuda_compiler_version12.0.yaml} | 2 +- recipe/conda_build_config.yaml | 4 ---- 7 files changed, 12 insertions(+), 16 deletions(-) rename .ci_support/{linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml => linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml} (98%) rename .ci_support/{linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml => linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml} (97%) rename .ci_support/{win_64_cuda_compilernvcccuda_compiler_version11.2.yaml => win_64_cuda_compilerNonecuda_compiler_version11.2.yaml} (97%) rename .ci_support/{win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml => win_64_cuda_compilernvcccuda_compiler_version12.0.yaml} (96%) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index cf254ed..289bb28 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -8,12 +8,12 @@ jobs: vmImage: ubuntu-latest strategy: matrix: - linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10: - CONFIG: linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10 + linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10: + CONFIG: linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10 UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 - linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12: - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12 + linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12: + CONFIG: linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12 UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index de46a63..29d0de4 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -8,11 +8,11 @@ jobs: vmImage: windows-2022 strategy: matrix: - win_64_cuda_compilercuda-nvcccuda_compiler_version12.0: - CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0 + win_64_cuda_compilerNonecuda_compiler_version11.2: + CONFIG: win_64_cuda_compilerNonecuda_compiler_version11.2 UPLOAD_PACKAGES: 'False' - win_64_cuda_compilernvcccuda_compiler_version11.2: - CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.2 + win_64_cuda_compilernvcccuda_compiler_version12.0: + CONFIG: win_64_cuda_compilernvcccuda_compiler_version12.0 UPLOAD_PACKAGES: 'False' timeoutInMinutes: 360 variables: diff --git a/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml b/.ci_support/linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml similarity index 98% rename from .ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml rename to .ci_support/linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml index 8f845a1..a9e100a 100644 --- a/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml +++ b/.ci_support/linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml @@ -9,7 +9,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- nvcc +- None cuda_compiler_version: - '11.2' cxx_compiler: diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml similarity index 97% rename from .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml rename to .ci_support/linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml index c4b45b2..3be5536 100644 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml @@ -9,7 +9,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- cuda-nvcc +- nvcc cuda_compiler_version: - '12.0' cxx_compiler: diff --git a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml b/.ci_support/win_64_cuda_compilerNonecuda_compiler_version11.2.yaml similarity index 97% rename from .ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml rename to .ci_support/win_64_cuda_compilerNonecuda_compiler_version11.2.yaml index 08de9d5..b7ddb5f 100644 --- a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml +++ b/.ci_support/win_64_cuda_compilerNonecuda_compiler_version11.2.yaml @@ -5,7 +5,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- nvcc +- None cuda_compiler_version: - '11.2' cxx_compiler: diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version12.0.yaml similarity index 96% rename from .ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml rename to .ci_support/win_64_cuda_compilernvcccuda_compiler_version12.0.yaml index 3b3b5c0..58c7616 100644 --- a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml +++ b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version12.0.yaml @@ -5,7 +5,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- cuda-nvcc +- nvcc cuda_compiler_version: - '12.0' cxx_compiler: diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 78ba5fd..e477089 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -13,10 +13,6 @@ cdt_name: # [linux] - cos7 # [linux64] - cos7 # [linux64] -cuda_compiler: - - nvcc - - cuda-nvcc - cuda_compiler_version: - 11.2 - 12.0 From 786ace1cbe38b70202d9e35294db7a7338deb39a Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 18 Nov 2023 11:26:21 -0500 Subject: [PATCH 08/22] undo --- .azure-pipelines/azure-pipelines-linux.yml | 8 ++++---- .azure-pipelines/azure-pipelines-win.yml | 8 ++++---- ...ccuda_compiler_version11.2cxx_compiler_version10.yaml} | 2 +- ...ccuda_compiler_version12.0cxx_compiler_version12.yaml} | 2 +- ..._cuda_compilercuda-nvcccuda_compiler_version12.0.yaml} | 2 +- ...in_64_cuda_compilernvcccuda_compiler_version11.2.yaml} | 2 +- recipe/conda_build_config.yaml | 4 ++++ 7 files changed, 16 insertions(+), 12 deletions(-) rename .ci_support/{linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml => linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml} (98%) rename .ci_support/{linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml => linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml} (97%) rename .ci_support/{win_64_cuda_compilernvcccuda_compiler_version12.0.yaml => win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml} (96%) rename .ci_support/{win_64_cuda_compilerNonecuda_compiler_version11.2.yaml => win_64_cuda_compilernvcccuda_compiler_version11.2.yaml} (97%) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 289bb28..cf254ed 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -8,12 +8,12 @@ jobs: vmImage: ubuntu-latest strategy: matrix: - linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10: - CONFIG: linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10 + linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10: + CONFIG: linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10 UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 - linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12: - CONFIG: linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12 + linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12: + CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12 UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 29d0de4..de46a63 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -8,11 +8,11 @@ jobs: vmImage: windows-2022 strategy: matrix: - win_64_cuda_compilerNonecuda_compiler_version11.2: - CONFIG: win_64_cuda_compilerNonecuda_compiler_version11.2 + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0: + CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0 UPLOAD_PACKAGES: 'False' - win_64_cuda_compilernvcccuda_compiler_version12.0: - CONFIG: win_64_cuda_compilernvcccuda_compiler_version12.0 + win_64_cuda_compilernvcccuda_compiler_version11.2: + CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.2 UPLOAD_PACKAGES: 'False' timeoutInMinutes: 360 variables: diff --git a/.ci_support/linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml b/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml similarity index 98% rename from .ci_support/linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml rename to .ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml index a9e100a..8f845a1 100644 --- a/.ci_support/linux_64_c_compiler_version10cuda_compilerNonecuda_compiler_version11.2cxx_compiler_version10.yaml +++ b/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml @@ -9,7 +9,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- None +- nvcc cuda_compiler_version: - '11.2' cxx_compiler: diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml similarity index 97% rename from .ci_support/linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml rename to .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml index 3be5536..c4b45b2 100644 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilernvcccuda_compiler_version12.0cxx_compiler_version12.yaml +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml @@ -9,7 +9,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- nvcc +- cuda-nvcc cuda_compiler_version: - '12.0' cxx_compiler: diff --git a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version12.0.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml similarity index 96% rename from .ci_support/win_64_cuda_compilernvcccuda_compiler_version12.0.yaml rename to .ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml index 58c7616..3b3b5c0 100644 --- a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version12.0.yaml +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml @@ -5,7 +5,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- nvcc +- cuda-nvcc cuda_compiler_version: - '12.0' cxx_compiler: diff --git a/.ci_support/win_64_cuda_compilerNonecuda_compiler_version11.2.yaml b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml similarity index 97% rename from .ci_support/win_64_cuda_compilerNonecuda_compiler_version11.2.yaml rename to .ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml index b7ddb5f..08de9d5 100644 --- a/.ci_support/win_64_cuda_compilerNonecuda_compiler_version11.2.yaml +++ b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml @@ -5,7 +5,7 @@ channel_sources: channel_targets: - conda-forge main cuda_compiler: -- None +- nvcc cuda_compiler_version: - '11.2' cxx_compiler: diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index e477089..78ba5fd 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -13,6 +13,10 @@ cdt_name: # [linux] - cos7 # [linux64] - cos7 # [linux64] +cuda_compiler: + - nvcc + - cuda-nvcc + cuda_compiler_version: - 11.2 - 12.0 From ce634eb78728be1bef2e0e72ea8a93a1dc2b3d7c Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 11:55:45 -0500 Subject: [PATCH 09/22] comment out camcor stuff --- src/CMakeLists.txt | 4 +-- src/RL-Biggs-Andrews.cpp | 46 ++++++++++++++++----------------- src/linearDecon.h | 18 ++++++------- src/llspy.cpp | 56 ++++++++++++++++++++-------------------- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a28976..2964e94 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -221,7 +221,7 @@ endif() RLgpuImpl.cu geometryTransform.cu # camcor.cpp - camcor.cu + # camcor.cu ) set_target_properties(libcudaDecon PROPERTIES PREFIX "") @@ -267,7 +267,7 @@ CUDA_ADD_EXECUTABLE( boostfs.cpp RLgpuImpl.cu geometryTransform.cu - camcor.cu + # camcor.cu ) add_dependencies( diff --git a/src/RL-Biggs-Andrews.cpp b/src/RL-Biggs-Andrews.cpp index 6049bc5..b4d6ac4 100644 --- a/src/RL-Biggs-Andrews.cpp +++ b/src/RL-Biggs-Andrews.cpp @@ -853,29 +853,29 @@ int Affine_interface_RA(const float * const raw_data, -int camcor_interface_init(int nx, int ny, int nz, - const float * const camparam) -{ - CImg<> h_camparam(camparam, nx, ny, 3); - setupConst(nx, ny, nz); - setupCamCor(nx, ny, h_camparam.data()); - return 1; -} - - -int camcor_interface(const unsigned short * const raw_data, - int nx, int ny, int nz, - unsigned short * const result) -{ - CImg input(raw_data, nx, ny, nz); - CImg raw_image(input); - GPUBuffer d_correctedResult(nx * ny * nz * sizeof(unsigned short), 0, false); - setupData(nx, ny, nz, raw_image.data()); - camcor_GPU(nx, ny, nz, d_correctedResult); - //transfer result back to host - cudaMemcpy(result, d_correctedResult.getPtr(), nx * ny * nz * sizeof(unsigned short), cudaMemcpyDeviceToHost); - return 1; -} +// int camcor_interface_init(int nx, int ny, int nz, +// const float * const camparam) +// { +// CImg<> h_camparam(camparam, nx, ny, 3); +// setupConst(nx, ny, nz); +// setupCamCor(nx, ny, h_camparam.data()); +// return 1; +// } + + +// int camcor_interface(const unsigned short * const raw_data, +// int nx, int ny, int nz, +// unsigned short * const result) +// { +// CImg input(raw_data, nx, ny, nz); +// CImg raw_image(input); +// GPUBuffer d_correctedResult(nx * ny * nz * sizeof(unsigned short), 0, false); +// setupData(nx, ny, nz, raw_image.data()); +// camcor_GPU(nx, ny, nz, d_correctedResult); +// //transfer result back to host +// cudaMemcpy(result, d_correctedResult.getPtr(), nx * ny * nz * sizeof(unsigned short), cudaMemcpyDeviceToHost); +// return 1; +// } diff --git a/src/linearDecon.h b/src/linearDecon.h index 4f95f99..b7ec5fe 100644 --- a/src/linearDecon.h +++ b/src/linearDecon.h @@ -200,13 +200,13 @@ void affine_GPU(cudaArray *cuArray, int nx, int ny, int nz, float *result, void affine_GPU_RA(cudaArray *cuArray, int nx, int ny, int nz, float dx, float dy, float dz, float *result, GPUBuffer &affMat); -void camcor_GPU(int nx, int ny, int nz, GPUBuffer &outBuf); +// void camcor_GPU(int nx, int ny, int nz, GPUBuffer &outBuf); -void setupConst(int nx, int ny, int nz); +// void setupConst(int nx, int ny, int nz); -void setupCamCor(int nx, int ny, float *h_caparam); +// void setupCamCor(int nx, int ny, float *h_caparam); -void setupData(int nx, int ny, int nz, unsigned *h_data); +// void setupData(int nx, int ny, int nz, unsigned *h_data); void cropGPU(GPUBuffer &inBuf, int nx, int ny, int nz, int new_nx, int new_ny, int new_nz, GPUBuffer &outBuf); @@ -296,12 +296,12 @@ void makeNewDir(std::string subdirname); const float *const raw_data, int nx, int ny, int nz, float dx, float dy, float dz, float *const result, const float *affMat); - CUDADECON_API int camcor_interface_init(int nx, int ny, int nz, - const float *const camparam); + // CUDADECON_API int camcor_interface_init(int nx, int ny, int nz, + // const float *const camparam); - CUDADECON_API int camcor_interface(const unsigned short *const raw_data, - int nx, int ny, int nz, - unsigned short *const result); + // CUDADECON_API int camcor_interface(const unsigned short *const raw_data, + // int nx, int ny, int nz, + // unsigned short *const result); //! Call this before program quits to release global GPUBuffer d_interpOTF CUDADECON_API void RL_cleanup(); diff --git a/src/llspy.cpp b/src/llspy.cpp index 4000cc1..17d596e 100644 --- a/src/llspy.cpp +++ b/src/llspy.cpp @@ -42,12 +42,12 @@ extern "C" { float * const result, const float * affMat); - LLSPY_API int camcor_interface_init(int nx, int ny, int nz, - const float * const camparam); + // LLSPY_API int camcor_interface_init(int nx, int ny, int nz, + // const float * const camparam); - LLSPY_API int camcor_interface(const unsigned short * const raw_data, - int nx, int ny, int nz, - unsigned short * const result); + // LLSPY_API int camcor_interface(const unsigned short * const raw_data, + // int nx, int ny, int nz, + // unsigned short * const result); LLSPY_API void cuda_reset(); @@ -66,29 +66,29 @@ void cuda_reset() cudaDeviceReset(); } -int camcor_interface_init(int nx, int ny, int nz, - const float * const camparam) -{ - CImg<> h_camparam(camparam, nx, ny, 3); - setupConst(nx, ny, nz); - setupCamCor(nx, ny, h_camparam.data()); - return 1; -} - - -int camcor_interface(const unsigned short * const raw_data, - int nx, int ny, int nz, - unsigned short * const result) -{ - CImg input(raw_data, nx, ny, nz); - CImg raw_image(input); - GPUBuffer d_correctedResult(nx * ny * nz * sizeof(unsigned short), 0, false); - setupData(nx, ny, nz, raw_image.data()); - camcor_GPU(nx, ny, nz, d_correctedResult); - //transfer result back to host - cudaMemcpy(result, d_correctedResult.getPtr(), nx * ny * nz * sizeof(unsigned short), cudaMemcpyDeviceToHost); - return 1; -} +// int camcor_interface_init(int nx, int ny, int nz, +// const float * const camparam) +// { +// CImg<> h_camparam(camparam, nx, ny, 3); +// setupConst(nx, ny, nz); +// setupCamCor(nx, ny, h_camparam.data()); +// return 1; +// } + + +// int camcor_interface(const unsigned short * const raw_data, +// int nx, int ny, int nz, +// unsigned short * const result) +// { +// CImg input(raw_data, nx, ny, nz); +// CImg raw_image(input); +// GPUBuffer d_correctedResult(nx * ny * nz * sizeof(unsigned short), 0, false); +// setupData(nx, ny, nz, raw_image.data()); +// camcor_GPU(nx, ny, nz, d_correctedResult); +// //transfer result back to host +// cudaMemcpy(result, d_correctedResult.getPtr(), nx * ny * nz * sizeof(unsigned short), cudaMemcpyDeviceToHost); +// return 1; +// } From a3dfd07d14e4ff1812fcd8b1ad6c34d855fdd5ba Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 11:58:05 -0500 Subject: [PATCH 10/22] export path --- recipe/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/build.sh b/recipe/build.sh index 9e020cc..18e3062 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PATH="$PATH:$BUILD_PREFIX/nvvm/bin/cicc" + mkdir cmake_build cd cmake_build cmake ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release ../src From 2ea2dbde362c138247899e92b8dba10ab7be82bc Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 11:58:26 -0500 Subject: [PATCH 11/22] fix path --- recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 18e3062..504db00 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -export PATH="$PATH:$BUILD_PREFIX/nvvm/bin/cicc" +export PATH="$PATH:$BUILD_PREFIX/nvvm/bin/" mkdir cmake_build cd cmake_build From 6f963e5420838724efbaecca5c5b285964ab8352 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 12:10:18 -0500 Subject: [PATCH 12/22] try remove find_package cuda --- src/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2964e94..96ddebf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,14 +14,10 @@ cmake_minimum_required (VERSION 3.12) # cmake_policy(SET CMP0054 OLD) #Set IF statements to dereference variables like in CMAKE version < 3.1 # cmake_policy(SET CMP0012 NEW) #Set IF statements to use values of numbers and booleans rather than pretend that they could be variables -project (cudaDecon) +project (cudaDecon, VERSION 0.7.0 LANGUAGES CXX CUDA) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -set(VERSION_MAJOR "0") -set(VERSION_MINOR "7") -set(VERSION_PATCH "0") -set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) # set -fPIC for all targets (for shared libraries) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -103,7 +99,7 @@ endif() # ###################################################################### -find_package(CUDA REQUIRED) +# find_package(CUDA REQUIRED) if (WIN32) set (FFTW3_INCLUDE_DIR $ENV{CONDA_PREFIX}/Library/lib) set (FFTW3F_LIBRARY fftw3f) From 5f63d57bab3e814f7350c4ae9ed67229f4bbb52a Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 12:40:26 -0500 Subject: [PATCH 13/22] undo cmake changes --- src/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 96ddebf..2964e94 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,10 +14,14 @@ cmake_minimum_required (VERSION 3.12) # cmake_policy(SET CMP0054 OLD) #Set IF statements to dereference variables like in CMAKE version < 3.1 # cmake_policy(SET CMP0012 NEW) #Set IF statements to use values of numbers and booleans rather than pretend that they could be variables -project (cudaDecon, VERSION 0.7.0 LANGUAGES CXX CUDA) +project (cudaDecon) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +set(VERSION_MAJOR "0") +set(VERSION_MINOR "7") +set(VERSION_PATCH "0") +set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) # set -fPIC for all targets (for shared libraries) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -99,7 +103,7 @@ endif() # ###################################################################### -# find_package(CUDA REQUIRED) +find_package(CUDA REQUIRED) if (WIN32) set (FFTW3_INCLUDE_DIR $ENV{CONDA_PREFIX}/Library/lib) set (FFTW3F_LIBRARY fftw3f) From dde9e56a7ab6e8c81e02bbc8e9a4db0d39cd230b Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 14:12:57 -0500 Subject: [PATCH 14/22] pin cmake --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 637a199..5ddc0d9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('cuda') }} - - cmake + - cmake ==3.24 - make # [not win] - libgomp # [linux] host: From 35b57da02b7759d82e8d62663f3f8e35d407db8d Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 14:17:09 -0500 Subject: [PATCH 15/22] rerender --- .azure-pipelines/azure-pipelines-linux.yml | 12 ++++++------ ..._compilercuda-nvcccuda_compiler_version12.0.yaml} | 4 ++-- ..._cuda_compilernvcccuda_compiler_version11.2.yaml} | 0 recipe/conda_build_config.yaml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename .ci_support/{linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml => linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml} (97%) rename .ci_support/{linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml => linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml} (100%) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index cf254ed..0c778f0 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -8,14 +8,14 @@ jobs: vmImage: ubuntu-latest strategy: matrix: - linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10: - CONFIG: linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10 - UPLOAD_PACKAGES: 'False' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 - linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12: - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12 + linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0: + CONFIG: linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0 UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + linux_64_cuda_compilernvcccuda_compiler_version11.2: + CONFIG: linux_64_cuda_compilernvcccuda_compiler_version11.2 + UPLOAD_PACKAGES: 'False' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 timeoutInMinutes: 360 steps: diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml b/.ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml similarity index 97% rename from .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml rename to .ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml index c4b45b2..4f88ea1 100644 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml +++ b/.ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '12' +- '10' cdt_name: - cos7 channel_sources: @@ -15,7 +15,7 @@ cuda_compiler_version: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '10' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 fftw: diff --git a/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml b/.ci_support/linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml similarity index 100% rename from .ci_support/linux_64_c_compiler_version10cuda_compilernvcccuda_compiler_version11.2cxx_compiler_version10.yaml rename to .ci_support/linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 78ba5fd..d2dee57 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -4,10 +4,10 @@ docker_image: # [os.environ.get("BUILD_PLATF c_compiler_version: # [linux] - 10 # [linux64 or aarch64] - - 12 # [linux64 or aarch64] + - 10 # [linux64 or aarch64] cxx_compiler_version: # [linux] - 10 # [linux64 or aarch64] - - 12 # [linux64 or aarch64] + - 10 # [linux64 or aarch64] cdt_name: # [linux] - cos7 # [linux64] From 672221384e648e78dc2cc2a64f91ec303c00cb90 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 14:55:28 -0500 Subject: [PATCH 16/22] update cmake --- recipe/meta.yaml | 2 +- src/Buffers/CMakeLists.txt | 2 +- src/CMakeLists.txt | 99 +++++++------------------------------- 3 files changed, 20 insertions(+), 83 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5ddc0d9..a226906 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('cuda') }} - - cmake ==3.24 + - cmake >=3.18 - make # [not win] - libgomp # [linux] host: diff --git a/src/Buffers/CMakeLists.txt b/src/Buffers/CMakeLists.txt index 0fd2b32..273000a 100644 --- a/src/Buffers/CMakeLists.txt +++ b/src/Buffers/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/gtest/include" ) -CUDA_ADD_LIBRARY( +add_library( Buffer Buffer.cpp bufferExample.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2964e94..e08ca96 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,19 +10,13 @@ ###################################################################### -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) # cmake_policy(SET CMP0054 OLD) #Set IF statements to dereference variables like in CMAKE version < 3.1 # cmake_policy(SET CMP0012 NEW) #Set IF statements to use values of numbers and booleans rather than pretend that they could be variables -project (cudaDecon) - +project (cudaDecon VERSION 0.7.0 LANGUAGES CXX CUDA) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -set(VERSION_MAJOR "0") -set(VERSION_MINOR "7") -set(VERSION_PATCH "0") -set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - # set -fPIC for all targets (for shared libraries) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -103,7 +97,6 @@ endif() # ###################################################################### -find_package(CUDA REQUIRED) if (WIN32) set (FFTW3_INCLUDE_DIR $ENV{CONDA_PREFIX}/Library/lib) set (FFTW3F_LIBRARY fftw3f) @@ -124,50 +117,8 @@ message(STATUS "FFTW3 Library: " ${FFTW3F_LIBRARY}) find_package(Boost REQUIRED COMPONENTS program_options filesystem system) -message(STATUS "CUDA version : ${CUDA_VERSION}") -if(NOT(CUDA_VERSION LESS 11.1)) # if CUDA version is > or = 11.1 - set(CUDA_NVCC_FLAGS "-O3;\ - -lcudart;\ - -gencode=arch=compute_61,code=sm_61;\ - -gencode=arch=compute_62,code=sm_62;\ - -gencode=arch=compute_70,code=sm_70;\ - -gencode=arch=compute_72,code=sm_72;\ - -gencode=arch=compute_75,code=sm_75,\ - -gencode=arch=compute_75,code=compute_75,\ - -gencode=arch=compute_80,code=compute_80,\ - -gencode=arch=compute_86,code=compute_86") -elseif(NOT(CUDA_VERSION LESS 10.0)) # if CUDA version is > or = 10.0 - set(CUDA_NVCC_FLAGS "-O3;\ - -lcudart;\ - -gencode=arch=compute_52,code=sm_52;\ - -gencode=arch=compute_61,code=sm_61;\ - -gencode=arch=compute_62,code=sm_62;\ - -gencode=arch=compute_70,code=sm_70;\ - -gencode=arch=compute_72,code=sm_72;\ - -gencode=arch=compute_75,code=sm_75,\ - -gencode=arch=compute_75,code=compute_75") -elseif(NOT(CUDA_VERSION LESS 8.0)) # if CUDA version is > or = 8.0 - set(CUDA_NVCC_FLAGS "-O2;\ - -gencode=arch=compute_30,code=sm_30;\ - -gencode=arch=compute_35,code=sm_35;\ - -gencode=arch=compute_37,code=sm_37;\ - -gencode=arch=compute_50,code=sm_50;\ - -gencode=arch=compute_52,code=sm_52;\ - -gencode=arch=compute_61,code=sm_61") # compute capability 6.1 only avaiable in CUDA 8.0 or greater -else() - set(CUDA_NVCC_FLAGS "-O2;\ - -gencode=arch=compute_20,code=sm_20;\ - -gencode=arch=compute_30,code=sm_30;\ - -gencode=arch=compute_35,code=sm_35;\ - -gencode=arch=compute_37,code=sm_37;\ - -gencode=arch=compute_50,code=sm_50;\ - -gencode=arch=compute_52,code=sm_52") - # compute capability 6.1 only avaiable in CUDA 8.0 or greater -endif() - -# Specifies which compute capabilities are supported by the built .exe http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architecture-feature-list http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list -# Need to add to these if different GPUs are targeted. -#--ptxas-options=-v; +message(STATUS "CUDA version : ${CMAKE_CUDA_COMPILER_VERSION}") +set(CMAKE_CUDA_ARCHITECTURES all-major) ###################################################################### # @@ -182,13 +133,10 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/Buffers" ${CUDA_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} - # ${X11_INCLUDE_DIR} ) if(WIN32) - set(CUDA_NVCC_FLAGS - ${CUDA_NVCC_FLAGS};--use-local-env;) link_directories ( ${Boost_LIBRARY_DIRS} ${FFTW3_INCLUDE_DIR} ${TIFF_LIBRARY} ) include_directories( ${Boost_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} "$ENV{NVCUDASAMPLES_ROOT}/common/inc" ) @@ -196,34 +144,22 @@ else() include_directories( ${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc ) endif() - - - -##### Make this everything time so that linearDecon.cpp is remade each time. This will ensure that the build date is correct ##### -#add_custom_target(invalidate_files ALL -# COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_SOURCE_DIR}/linearDecon.cpp") - - ###################################################################### # # Add build outputs and their dependencies # ###################################################################### - - ##### libcudaDecon.dll ########################################### - CUDA_ADD_LIBRARY( - libcudaDecon - SHARED - RL-Biggs-Andrews.cpp - RLgpuImpl.cu - geometryTransform.cu -# camcor.cpp +add_library( + libcudaDecon + SHARED + RL-Biggs-Andrews.cpp + RLgpuImpl.cu + geometryTransform.cu # camcor.cu - ) - + ) set_target_properties(libcudaDecon PROPERTIES PREFIX "") add_dependencies( @@ -260,7 +196,7 @@ endif() ##### cudaDecon.exe ########################################### -CUDA_ADD_EXECUTABLE( +add_executable( cudaDecon linearDecon.cpp RL-Biggs-Andrews.cpp @@ -288,9 +224,11 @@ add_executable(radialft radialft-nonSIM.cpp) # Link libraries # ###################################################################### +find_library(CUFFT_LIBRARY cufft) target_link_libraries( cudaDecon + PRIVATE Buffer ${FFTW3F_LIBRARY} ${FFTW3F_THREADS_LIBRARY} @@ -300,10 +238,11 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} + ${CUFFT_LIBRARY} ) if (UNIX) - target_link_libraries(cudaDecon rt) + target_link_libraries(cudaDecon PRIVATE rt) endif () target_link_libraries( @@ -315,9 +254,9 @@ target_link_libraries( ${TIFF_LIBRARIES} ) - target_link_libraries( libcudaDecon + PRIVATE Buffer ${FFTW3F_LIBRARY} ${FFTW3F_THREADS_LIBRARY} @@ -327,8 +266,8 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} + ${CUFFT_LIBRARY} ) -CUDA_ADD_CUFFT_TO_TARGET(libcudaDecon) target_link_libraries( @@ -337,8 +276,6 @@ target_link_libraries( ${TIFF_LIBRARIES} ) -CUDA_ADD_CUFFT_TO_TARGET(cudaDecon) - # added for make install to work in conda set(HEADERS CImg.h From e144a332076ff2102923df289187e27edafa43d9 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Nov 2023 15:57:20 -0500 Subject: [PATCH 17/22] revert --- recipe/meta.yaml | 2 +- src/Buffers/CMakeLists.txt | 2 +- src/CMakeLists.txt | 99 +++++++++++++++++++++++++++++++------- 3 files changed, 83 insertions(+), 20 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a226906..5ddc0d9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('cuda') }} - - cmake >=3.18 + - cmake ==3.24 - make # [not win] - libgomp # [linux] host: diff --git a/src/Buffers/CMakeLists.txt b/src/Buffers/CMakeLists.txt index 273000a..0fd2b32 100644 --- a/src/Buffers/CMakeLists.txt +++ b/src/Buffers/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/gtest/include" ) -add_library( +CUDA_ADD_LIBRARY( Buffer Buffer.cpp bufferExample.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e08ca96..2964e94 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,13 +10,19 @@ ###################################################################### -cmake_minimum_required (VERSION 3.18) +cmake_minimum_required (VERSION 3.12) # cmake_policy(SET CMP0054 OLD) #Set IF statements to dereference variables like in CMAKE version < 3.1 # cmake_policy(SET CMP0012 NEW) #Set IF statements to use values of numbers and booleans rather than pretend that they could be variables -project (cudaDecon VERSION 0.7.0 LANGUAGES CXX CUDA) +project (cudaDecon) + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +set(VERSION_MAJOR "0") +set(VERSION_MINOR "7") +set(VERSION_PATCH "0") +set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + # set -fPIC for all targets (for shared libraries) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -97,6 +103,7 @@ endif() # ###################################################################### +find_package(CUDA REQUIRED) if (WIN32) set (FFTW3_INCLUDE_DIR $ENV{CONDA_PREFIX}/Library/lib) set (FFTW3F_LIBRARY fftw3f) @@ -117,8 +124,50 @@ message(STATUS "FFTW3 Library: " ${FFTW3F_LIBRARY}) find_package(Boost REQUIRED COMPONENTS program_options filesystem system) -message(STATUS "CUDA version : ${CMAKE_CUDA_COMPILER_VERSION}") -set(CMAKE_CUDA_ARCHITECTURES all-major) +message(STATUS "CUDA version : ${CUDA_VERSION}") +if(NOT(CUDA_VERSION LESS 11.1)) # if CUDA version is > or = 11.1 + set(CUDA_NVCC_FLAGS "-O3;\ + -lcudart;\ + -gencode=arch=compute_61,code=sm_61;\ + -gencode=arch=compute_62,code=sm_62;\ + -gencode=arch=compute_70,code=sm_70;\ + -gencode=arch=compute_72,code=sm_72;\ + -gencode=arch=compute_75,code=sm_75,\ + -gencode=arch=compute_75,code=compute_75,\ + -gencode=arch=compute_80,code=compute_80,\ + -gencode=arch=compute_86,code=compute_86") +elseif(NOT(CUDA_VERSION LESS 10.0)) # if CUDA version is > or = 10.0 + set(CUDA_NVCC_FLAGS "-O3;\ + -lcudart;\ + -gencode=arch=compute_52,code=sm_52;\ + -gencode=arch=compute_61,code=sm_61;\ + -gencode=arch=compute_62,code=sm_62;\ + -gencode=arch=compute_70,code=sm_70;\ + -gencode=arch=compute_72,code=sm_72;\ + -gencode=arch=compute_75,code=sm_75,\ + -gencode=arch=compute_75,code=compute_75") +elseif(NOT(CUDA_VERSION LESS 8.0)) # if CUDA version is > or = 8.0 + set(CUDA_NVCC_FLAGS "-O2;\ + -gencode=arch=compute_30,code=sm_30;\ + -gencode=arch=compute_35,code=sm_35;\ + -gencode=arch=compute_37,code=sm_37;\ + -gencode=arch=compute_50,code=sm_50;\ + -gencode=arch=compute_52,code=sm_52;\ + -gencode=arch=compute_61,code=sm_61") # compute capability 6.1 only avaiable in CUDA 8.0 or greater +else() + set(CUDA_NVCC_FLAGS "-O2;\ + -gencode=arch=compute_20,code=sm_20;\ + -gencode=arch=compute_30,code=sm_30;\ + -gencode=arch=compute_35,code=sm_35;\ + -gencode=arch=compute_37,code=sm_37;\ + -gencode=arch=compute_50,code=sm_50;\ + -gencode=arch=compute_52,code=sm_52") + # compute capability 6.1 only avaiable in CUDA 8.0 or greater +endif() + +# Specifies which compute capabilities are supported by the built .exe http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architecture-feature-list http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list +# Need to add to these if different GPUs are targeted. +#--ptxas-options=-v; ###################################################################### # @@ -133,10 +182,13 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/Buffers" ${CUDA_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} + # ${X11_INCLUDE_DIR} ) if(WIN32) + set(CUDA_NVCC_FLAGS + ${CUDA_NVCC_FLAGS};--use-local-env;) link_directories ( ${Boost_LIBRARY_DIRS} ${FFTW3_INCLUDE_DIR} ${TIFF_LIBRARY} ) include_directories( ${Boost_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} "$ENV{NVCUDASAMPLES_ROOT}/common/inc" ) @@ -144,22 +196,34 @@ else() include_directories( ${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc ) endif() + + + +##### Make this everything time so that linearDecon.cpp is remade each time. This will ensure that the build date is correct ##### +#add_custom_target(invalidate_files ALL +# COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_SOURCE_DIR}/linearDecon.cpp") + + ###################################################################### # # Add build outputs and their dependencies # ###################################################################### + + ##### libcudaDecon.dll ########################################### -add_library( - libcudaDecon - SHARED - RL-Biggs-Andrews.cpp - RLgpuImpl.cu - geometryTransform.cu + CUDA_ADD_LIBRARY( + libcudaDecon + SHARED + RL-Biggs-Andrews.cpp + RLgpuImpl.cu + geometryTransform.cu +# camcor.cpp # camcor.cu - ) + ) + set_target_properties(libcudaDecon PROPERTIES PREFIX "") add_dependencies( @@ -196,7 +260,7 @@ endif() ##### cudaDecon.exe ########################################### -add_executable( +CUDA_ADD_EXECUTABLE( cudaDecon linearDecon.cpp RL-Biggs-Andrews.cpp @@ -224,11 +288,9 @@ add_executable(radialft radialft-nonSIM.cpp) # Link libraries # ###################################################################### -find_library(CUFFT_LIBRARY cufft) target_link_libraries( cudaDecon - PRIVATE Buffer ${FFTW3F_LIBRARY} ${FFTW3F_THREADS_LIBRARY} @@ -238,11 +300,10 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} - ${CUFFT_LIBRARY} ) if (UNIX) - target_link_libraries(cudaDecon PRIVATE rt) + target_link_libraries(cudaDecon rt) endif () target_link_libraries( @@ -254,9 +315,9 @@ target_link_libraries( ${TIFF_LIBRARIES} ) + target_link_libraries( libcudaDecon - PRIVATE Buffer ${FFTW3F_LIBRARY} ${FFTW3F_THREADS_LIBRARY} @@ -266,8 +327,8 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} - ${CUFFT_LIBRARY} ) +CUDA_ADD_CUFFT_TO_TARGET(libcudaDecon) target_link_libraries( @@ -276,6 +337,8 @@ target_link_libraries( ${TIFF_LIBRARIES} ) +CUDA_ADD_CUFFT_TO_TARGET(cudaDecon) + # added for make install to work in conda set(HEADERS CImg.h From fbfaae98decf39b9aa951432ac3f8337120dffe5 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 29 Nov 2023 10:16:19 -0500 Subject: [PATCH 18/22] update cmake with find cudatoolkit --- recipe/meta.yaml | 2 +- src/Buffers/CMakeLists.txt | 2 +- src/CMakeLists.txt | 101 +++++++------------------------------ 3 files changed, 21 insertions(+), 84 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5ddc0d9..a226906 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('cuda') }} - - cmake ==3.24 + - cmake >=3.18 - make # [not win] - libgomp # [linux] host: diff --git a/src/Buffers/CMakeLists.txt b/src/Buffers/CMakeLists.txt index 0fd2b32..273000a 100644 --- a/src/Buffers/CMakeLists.txt +++ b/src/Buffers/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/gtest/include" ) -CUDA_ADD_LIBRARY( +add_library( Buffer Buffer.cpp bufferExample.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2964e94..a0b09f1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,19 +10,13 @@ ###################################################################### -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) # cmake_policy(SET CMP0054 OLD) #Set IF statements to dereference variables like in CMAKE version < 3.1 # cmake_policy(SET CMP0012 NEW) #Set IF statements to use values of numbers and booleans rather than pretend that they could be variables -project (cudaDecon) - +project (cudaDecon VERSION 0.7.0 LANGUAGES CXX CUDA) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -set(VERSION_MAJOR "0") -set(VERSION_MINOR "7") -set(VERSION_PATCH "0") -set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - # set -fPIC for all targets (for shared libraries) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -103,7 +97,6 @@ endif() # ###################################################################### -find_package(CUDA REQUIRED) if (WIN32) set (FFTW3_INCLUDE_DIR $ENV{CONDA_PREFIX}/Library/lib) set (FFTW3F_LIBRARY fftw3f) @@ -123,51 +116,9 @@ message(STATUS "FFTW3 Library: " ${FFTW3F_LIBRARY}) find_package(Boost REQUIRED COMPONENTS program_options filesystem system) - -message(STATUS "CUDA version : ${CUDA_VERSION}") -if(NOT(CUDA_VERSION LESS 11.1)) # if CUDA version is > or = 11.1 - set(CUDA_NVCC_FLAGS "-O3;\ - -lcudart;\ - -gencode=arch=compute_61,code=sm_61;\ - -gencode=arch=compute_62,code=sm_62;\ - -gencode=arch=compute_70,code=sm_70;\ - -gencode=arch=compute_72,code=sm_72;\ - -gencode=arch=compute_75,code=sm_75,\ - -gencode=arch=compute_75,code=compute_75,\ - -gencode=arch=compute_80,code=compute_80,\ - -gencode=arch=compute_86,code=compute_86") -elseif(NOT(CUDA_VERSION LESS 10.0)) # if CUDA version is > or = 10.0 - set(CUDA_NVCC_FLAGS "-O3;\ - -lcudart;\ - -gencode=arch=compute_52,code=sm_52;\ - -gencode=arch=compute_61,code=sm_61;\ - -gencode=arch=compute_62,code=sm_62;\ - -gencode=arch=compute_70,code=sm_70;\ - -gencode=arch=compute_72,code=sm_72;\ - -gencode=arch=compute_75,code=sm_75,\ - -gencode=arch=compute_75,code=compute_75") -elseif(NOT(CUDA_VERSION LESS 8.0)) # if CUDA version is > or = 8.0 - set(CUDA_NVCC_FLAGS "-O2;\ - -gencode=arch=compute_30,code=sm_30;\ - -gencode=arch=compute_35,code=sm_35;\ - -gencode=arch=compute_37,code=sm_37;\ - -gencode=arch=compute_50,code=sm_50;\ - -gencode=arch=compute_52,code=sm_52;\ - -gencode=arch=compute_61,code=sm_61") # compute capability 6.1 only avaiable in CUDA 8.0 or greater -else() - set(CUDA_NVCC_FLAGS "-O2;\ - -gencode=arch=compute_20,code=sm_20;\ - -gencode=arch=compute_30,code=sm_30;\ - -gencode=arch=compute_35,code=sm_35;\ - -gencode=arch=compute_37,code=sm_37;\ - -gencode=arch=compute_50,code=sm_50;\ - -gencode=arch=compute_52,code=sm_52") - # compute capability 6.1 only avaiable in CUDA 8.0 or greater -endif() - -# Specifies which compute capabilities are supported by the built .exe http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architecture-feature-list http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list -# Need to add to these if different GPUs are targeted. -#--ptxas-options=-v; +find_package(CUDAToolkit REQUIRED) +message(STATUS "CUDA version : ${CMAKE_CUDA_COMPILER_VERSION}") +set(CMAKE_CUDA_ARCHITECTURES all-major) ###################################################################### # @@ -182,13 +133,10 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/Buffers" ${CUDA_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} - # ${X11_INCLUDE_DIR} ) if(WIN32) - set(CUDA_NVCC_FLAGS - ${CUDA_NVCC_FLAGS};--use-local-env;) link_directories ( ${Boost_LIBRARY_DIRS} ${FFTW3_INCLUDE_DIR} ${TIFF_LIBRARY} ) include_directories( ${Boost_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} "$ENV{NVCUDASAMPLES_ROOT}/common/inc" ) @@ -196,34 +144,22 @@ else() include_directories( ${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc ) endif() - - - -##### Make this everything time so that linearDecon.cpp is remade each time. This will ensure that the build date is correct ##### -#add_custom_target(invalidate_files ALL -# COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_SOURCE_DIR}/linearDecon.cpp") - - ###################################################################### # # Add build outputs and their dependencies # ###################################################################### - - ##### libcudaDecon.dll ########################################### - CUDA_ADD_LIBRARY( - libcudaDecon - SHARED - RL-Biggs-Andrews.cpp - RLgpuImpl.cu - geometryTransform.cu -# camcor.cpp +add_library( + libcudaDecon + SHARED + RL-Biggs-Andrews.cpp + RLgpuImpl.cu + geometryTransform.cu # camcor.cu - ) - + ) set_target_properties(libcudaDecon PROPERTIES PREFIX "") add_dependencies( @@ -260,7 +196,7 @@ endif() ##### cudaDecon.exe ########################################### -CUDA_ADD_EXECUTABLE( +add_executable( cudaDecon linearDecon.cpp RL-Biggs-Andrews.cpp @@ -288,9 +224,11 @@ add_executable(radialft radialft-nonSIM.cpp) # Link libraries # ###################################################################### +find_library(CUFFT_LIBRARY cufft) target_link_libraries( cudaDecon + PRIVATE Buffer ${FFTW3F_LIBRARY} ${FFTW3F_THREADS_LIBRARY} @@ -300,10 +238,11 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} + ${CUFFT_LIBRARY} ) if (UNIX) - target_link_libraries(cudaDecon rt) + target_link_libraries(cudaDecon PRIVATE rt) endif () target_link_libraries( @@ -315,9 +254,9 @@ target_link_libraries( ${TIFF_LIBRARIES} ) - target_link_libraries( libcudaDecon + PRIVATE Buffer ${FFTW3F_LIBRARY} ${FFTW3F_THREADS_LIBRARY} @@ -327,8 +266,8 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} + ${CUFFT_LIBRARY} ) -CUDA_ADD_CUFFT_TO_TARGET(libcudaDecon) target_link_libraries( @@ -337,8 +276,6 @@ target_link_libraries( ${TIFF_LIBRARIES} ) -CUDA_ADD_CUFFT_TO_TARGET(cudaDecon) - # added for make install to work in conda set(HEADERS CImg.h From 937942579292bab46575039795721f8b75e0a4e8 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 29 Nov 2023 10:45:57 -0500 Subject: [PATCH 19/22] change lib strategy --- src/CMakeLists.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0b09f1..563fd25 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,7 @@ ###################################################################### -cmake_minimum_required (VERSION 3.18) +cmake_minimum_required (VERSION 3.20) # cmake_policy(SET CMP0054 OLD) #Set IF statements to dereference variables like in CMAKE version < 3.1 # cmake_policy(SET CMP0012 NEW) #Set IF statements to use values of numbers and booleans rather than pretend that they could be variables @@ -162,11 +162,6 @@ add_library( ) set_target_properties(libcudaDecon PROPERTIES PREFIX "") -add_dependencies( - libcudaDecon - Buffer - ) - ##### libradialft.dll ########################################### @@ -176,10 +171,6 @@ add_dependencies( radialft_interface.cpp ) -add_dependencies( - libradialft - Buffer - ) if (WIN32) set_property(TARGET libradialft PROPERTY POSITION_INDEPENDENT_CODE ON) @@ -224,7 +215,6 @@ add_executable(radialft radialft-nonSIM.cpp) # Link libraries # ###################################################################### -find_library(CUFFT_LIBRARY cufft) target_link_libraries( cudaDecon @@ -238,7 +228,7 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} - ${CUFFT_LIBRARY} + CUDA::cufft ) if (UNIX) @@ -266,7 +256,7 @@ target_link_libraries( ${Boost_PREDICATE_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${TIFF_LIBRARIES} - ${CUFFT_LIBRARY} + CUDA::cufft ) From ec0af1678d7390f40cfefc5ba00495e6fc501f34 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 15 Jul 2024 10:52:38 -0400 Subject: [PATCH 20/22] MNT: Re-rendered with conda-build 24.5.1, conda-smithy 3.36.2, and conda-forge-pinning 2024.07.15.13.31.46 --- .azure-pipelines/azure-pipelines-linux.yml | 1 + ...lercuda-nvcccuda_compiler_version12.0.yaml | 2 +- ...compilernvcccuda_compiler_version11.2.yaml | 2 +- .github/workflows/automerge.yml | 2 -- .scripts/build_steps.sh | 19 ++++++++++--------- .scripts/run_docker_build.sh | 6 ++++++ .scripts/run_win_build.bat | 9 +++++++-- README.md | 11 ++++------- 8 files changed, 30 insertions(+), 22 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 0c778f0..817ba90 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -17,6 +17,7 @@ jobs: UPLOAD_PACKAGES: 'False' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 timeoutInMinutes: 360 + variables: {} steps: - checkout: self diff --git a/.ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml b/.ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml index 4f88ea1..a37bd8b 100644 --- a/.ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml +++ b/.ci_support/linux_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml @@ -29,7 +29,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - cdt_name - cuda_compiler - cuda_compiler_version - - cdt_name - docker_image diff --git a/.ci_support/linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml b/.ci_support/linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml index 8f845a1..b533918 100644 --- a/.ci_support/linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml +++ b/.ci_support/linux_64_cuda_compilernvcccuda_compiler_version11.2.yaml @@ -29,7 +29,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - cdt_name - cuda_compiler - cuda_compiler_version - - cdt_name - docker_image diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index da1368a..0535f6a 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -9,8 +9,6 @@ jobs: runs-on: ubuntu-latest name: automerge steps: - - name: checkout - uses: actions/checkout@v3 - name: automerge-action id: automerge-action uses: conda-forge/automerge-action@main diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 8021e3a..8b6dc08 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -34,9 +34,9 @@ CONDARC export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -54,12 +54,6 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi -if [[ "${sha:-}" == "" ]]; then - pushd ${FEEDSTOCK_ROOT} - sha=$(git rev-parse HEAD) - popd -fi - 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}" @@ -71,11 +65,18 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda-build "${RECIPE_ROOT}" -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:-}" + ( startgroup "Inspecting artifacts" ) 2> /dev/null + + # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null + ( startgroup "Uploading packages" ) 2> /dev/null if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index db9a6e2..a16e7e7 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -21,6 +21,12 @@ if [ -z ${FEEDSTOCK_NAME} ]; then export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) fi +if [[ "${sha:-}" == "" ]]; then + pushd "${FEEDSTOCK_ROOT}" + sha=$(git rev-parse HEAD) + popd +fi + docker info # In order for the conda-build process in the container to write to the mounted diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index c9c6d54..93b09d5 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -24,7 +24,7 @@ set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" :: Provision the necessary dependencies to build the recipe later echo Installing dependencies -mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 -c conda-forge --strict-channel-priority --yes +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes if !errorlevel! neq 0 exit /b !errorlevel! :: Set basic configuration @@ -50,9 +50,14 @@ call :end_group :: Build the recipe echo Building recipe -conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% if !errorlevel! neq 0 exit /b !errorlevel! +call :start_group "Inspecting artifacts" +:: inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" +call :end_group + :: Prepare some environment variables for the upload step if /i "%CI%" == "github_actions" ( set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" diff --git a/README.md b/README.md index 3cd745d..7dd6540 100644 --- a/README.md +++ b/README.md @@ -54,17 +54,15 @@ conda install -c conda-forge cudadecon cudatoolkit=10.2 | 11.1 | ≥ 455.23 | ≥ 456.38 | | 11.2 | ≥ 460.27.03 | ≥ 460.82 | - If you run into trouble, feel free to [open an issue](https://github.com/scopetools/cudaDecon/issues) and describe your setup. - ------ +----------------------- ## Notes * Compatible GPUs are specified in this "C:\cudaDecon\CMakeLists.txt". This also sets up all of the linking to dependent libraries. If you end up adding other code libraries, or changing versions, etc you will want to edit this file. Specifically where you see the lines like : "-gencode=arch=compute_75,code=sm_75" -* GPU based resources have a d_ prefix in their name such as : GPUBuffer & d_interpOTF +* GPU based resources have a `d_` prefix in their name such as : GPUBuffer & d_interpOTF * transferConstants() is a function to send small data values from host to GPU device. @@ -83,7 +81,7 @@ Running this command from an adminstrator command prompt should set the timeout * Better yet, use a second GPU. The GPU you wish to use for computation only should use the TCC driver (must be a Titan or Tesla or other GPU that supports TCC). This card should be initialized after the display GPU, so put the compute card in a slot that is > display card. The TCC driver is selected with NVIDIAsmi.exe -L from an administrator cmd window to show the GPUs, then NVIDIAsmi.exe -dm 1 -i 0 to set TCC on GPU 0. Then use `set CUDA_VISIBLE_DEVICES` to pick the GPU the deconv code should execute on. ---------------------- +----------------------- ## Local build instructions @@ -96,7 +94,7 @@ To build the source locally, you have two options: With docker installed, use `.scripts/run_docker_build.sh` with one of the configs available in `.ci_support`, for instance: -``` +```shell CONFIG=linux_64_cuda_compiler_version10.2 .scripts/run_docker_build.sh ``` @@ -106,7 +104,6 @@ Here we create a dedicated conda environment with all of the build dependencies installed, and then use cmake directly. This method is faster and creates an immediately useable binary (i.e. it is better for iteration if you're changing the source code), but requires that you set up build dependencies correctly. - 1. install [miniconda](https://docs.conda.io/en/latest/miniconda.html) 2. install [cudatoolkit](https://developer.nvidia.com/cuda-10.1-download-archive-update2) (I haven't yet tried 10.2) From 79bc12fd40e81a4c1ba157416b6b25860c3a9ff2 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 15 Jul 2024 11:48:08 -0400 Subject: [PATCH 21/22] add include --- .gitignore | 1 + src/Buffers/CMakeLists.txt | 1 + src/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 500bffe..8cc9e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ VS/cudaDeconv.vcxproj.filters build_artifacts # conda smithy ci-skeleton end +cmake_build diff --git a/src/Buffers/CMakeLists.txt b/src/Buffers/CMakeLists.txt index 273000a..9a28084 100644 --- a/src/Buffers/CMakeLists.txt +++ b/src/Buffers/CMakeLists.txt @@ -2,6 +2,7 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}" ${CUDA_INCLUDE_DIRS} "${CMAKE_SOURCE_DIR}/gtest/include" + ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} ) add_library( diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 563fd25..f5b73e2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -133,6 +133,7 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/Buffers" ${CUDA_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIR} + ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} ) From 348dfa4013b82955ba981d05bc94e0edc61ee321 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 15 Jul 2024 14:37:11 -0400 Subject: [PATCH 22/22] drop cuda 11.2 on windows --- .azure-pipelines/azure-pipelines-win.yml | 7 ++---- ...compiler_version12.0.yaml => win_64_.yaml} | 0 ...compilernvcccuda_compiler_version11.2.yaml | 23 ------------------- recipe/conda_build_config.yaml | 8 +++---- 4 files changed, 6 insertions(+), 32 deletions(-) rename .ci_support/{win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml => win_64_.yaml} (100%) delete mode 100644 .ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index de46a63..3e6193a 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -8,11 +8,8 @@ jobs: vmImage: windows-2022 strategy: matrix: - win_64_cuda_compilercuda-nvcccuda_compiler_version12.0: - CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0 - UPLOAD_PACKAGES: 'False' - win_64_cuda_compilernvcccuda_compiler_version11.2: - CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.2 + win_64_: + CONFIG: win_64_ UPLOAD_PACKAGES: 'False' timeoutInMinutes: 360 variables: diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml b/.ci_support/win_64_.yaml similarity index 100% rename from .ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml rename to .ci_support/win_64_.yaml diff --git a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml deleted file mode 100644 index 08de9d5..0000000 --- a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.2.yaml +++ /dev/null @@ -1,23 +0,0 @@ -c_compiler: -- vs2019 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.2' -cxx_compiler: -- vs2019 -fftw: -- '3' -libboost_devel: -- '1.82' -libtiff: -- '4.6' -target_platform: -- win-64 -zip_keys: -- - cuda_compiler - - cuda_compiler_version diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index d2dee57..94350b5 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -14,19 +14,19 @@ cdt_name: # [linux] - cos7 # [linux64] cuda_compiler: - - nvcc + - nvcc # [not win] - cuda-nvcc cuda_compiler_version: - - 11.2 + - 11.2 # [not win] - 12.0 libboost_devel: - - '1.82' + - '1.82' # [not win] - '1.82' libtiff: - - 4.6 + - 4.6 # [not win] - 4.6 channel_sources: