From 327d6a2ee540d64fb2425c81d2c7b80ebac7bc5a Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 12:31:43 +0000 Subject: [PATCH 01/24] [CI] Experimental Windows build --- .../workflows/sycl_windows_build_and_test.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/sycl_windows_build_and_test.yml diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml new file mode 100644 index 0000000000000..c8e0f465b795e --- /dev/null +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -0,0 +1,35 @@ +name: SYCL Windows Test + +on: + pull_request: + branches: + - sycl + +jobs: + build: + name: Build + runs-on: windows-2022 + steps: + - uses: actions/checkout@v2 + with: + path: src + fetch-depth: 1 + - name: Install dependencies + run: | + choco install -y cuda + - name: Configure + shell: cmd + run: | + mkdir build + mkdir install + python.exe src/buildbot/configure.py -o build ^ + --cmake-opt="-DCMAKE_C_COMPILER=clang-cl" ^ + --cmake-opt="-DCMAKE_CXX_COMPILER=clang-cl" ^ + --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ + --cuda + - name: Build + shell: cmd + run: cmake --build build --target sycl-toolchain + - name: Install + shell: cmd + run: cmake --build build --target deploy-sycl-toolchain From beb41f00b349a825f8ea3cc35bd9ebc4fcf7e7f2 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 12:55:22 +0000 Subject: [PATCH 02/24] discover msvc? --- .github/workflows/sycl_windows_build_and_test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index c8e0f465b795e..81019567827fc 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -16,7 +16,10 @@ jobs: fetch-depth: 1 - name: Install dependencies run: | - choco install -y cuda + choco install -y cuda ninja + - uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f + with: + arch: amd64 - name: Configure shell: cmd run: | From 1676bb9c58a1b420218979c7138e47ee269b95f9 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 13:46:24 +0000 Subject: [PATCH 03/24] set env? --- .github/workflows/sycl_windows_build_and_test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 81019567827fc..2d02c6a725839 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -15,8 +15,11 @@ jobs: path: src fetch-depth: 1 - name: Install dependencies + shell: cmd run: | choco install -y cuda ninja + refreshenv + echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV% - uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f with: arch: amd64 @@ -36,3 +39,8 @@ jobs: - name: Install shell: cmd run: cmake --build build --target deploy-sycl-toolchain + - name: Upload toolchain + uses: actions/upload-artifact@v2 + with: + name: sycl_windows_default + path: install/**/* From 404fee159e8d787708a3d01b62d967d4ebcaf6f8 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 14:05:16 +0000 Subject: [PATCH 04/24] more env --- .github/workflows/sycl_windows_build_and_test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 2d02c6a725839..95f1addd5c056 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -17,8 +17,10 @@ jobs: - name: Install dependencies shell: cmd run: | - choco install -y cuda ninja + choco install -y cuda --version 11.6 + choco install -y ninja refreshenv + echo CUDA_PATH=%CUDA_PATH% echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV% - uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f with: @@ -35,6 +37,9 @@ jobs: --cuda - name: Build shell: cmd + env: + CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' + CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' run: cmake --build build --target sycl-toolchain - name: Install shell: cmd From 674b299fa69be78f40d1b77eaa153c8620e16183 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 14:11:50 +0000 Subject: [PATCH 05/24] update version --- .github/workflows/sycl_windows_build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 95f1addd5c056..3a9cbc498d3fb 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies shell: cmd run: | - choco install -y cuda --version 11.6 + choco install -y cuda --version 11.6.0.51123 choco install -y ninja refreshenv echo CUDA_PATH=%CUDA_PATH% From 0925ae752f249add43b26d5443dd30afcf0ee7d8 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 14:24:26 +0000 Subject: [PATCH 06/24] copy env --- .github/workflows/sycl_windows_build_and_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 3a9cbc498d3fb..c90e4c67d791e 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -27,6 +27,9 @@ jobs: arch: amd64 - name: Configure shell: cmd + env: + CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' + CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' run: | mkdir build mkdir install From 87ec293e997e0d3967bc7443f03d75bb3d420380 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 15:02:05 +0000 Subject: [PATCH 07/24] move to nightly --- .github/workflows/sycl_nightly.yml | 8 +++++++- .../workflows/sycl_windows_build_and_test.yml | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sycl_nightly.yml b/.github/workflows/sycl_nightly.yml index f2177125d9cde..4d1b7bfe74f3c 100644 --- a/.github/workflows/sycl_nightly.yml +++ b/.github/workflows/sycl_nightly.yml @@ -19,6 +19,13 @@ jobs: build_cache_root: "/__w/" build_artifact_suffix: default lts_config: "ocl_gen9;ocl_x64;hip_amdgpu" + + windows_default: + name: Windows (experimental) + if: github.repository == 'intel/llvm' + continue-on-error: true + uses: ./.github/workflows/sycl_windows_build_and_test.yml + ubuntu2004_docker_build_push: if: github.repository == 'intel/llvm' runs-on: ubuntu-latest @@ -55,4 +62,3 @@ jobs: tags: | ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers-${{ github.sha }} ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers - diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index c90e4c67d791e..9f5b7d1141125 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -1,9 +1,7 @@ name: SYCL Windows Test on: - pull_request: - branches: - - sycl + workflow_call: jobs: build: @@ -19,12 +17,22 @@ jobs: run: | choco install -y cuda --version 11.6.0.51123 choco install -y ninja + choco install -y sccache --version 0.2.15 refreshenv echo CUDA_PATH=%CUDA_PATH% echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV% - uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f with: arch: amd64 + - name: Setup Cache + uses: actions/cache@v2 + if: ${{ github.event_name != 'pull_request' }} + id: cache + with: + path: cache + key: sycl-win-build-${{ github.sha }} + restore-keys: | + sycl-win-build- - name: Configure shell: cmd env: @@ -33,10 +41,15 @@ jobs: run: | mkdir build mkdir install + IF NOT EXIST cache MKDIR cache + set SCCACHE_DIR=%GITHUB_WORKSPACE%\cache + set PATH=C:\ProgramData\chocolatey\lib\sccache\tools\sccache-v0.2.15-x86_64-pc-windows-msvc;%PATH% python.exe src/buildbot/configure.py -o build ^ --cmake-opt="-DCMAKE_C_COMPILER=clang-cl" ^ --cmake-opt="-DCMAKE_CXX_COMPILER=clang-cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ + --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ + --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ --cuda - name: Build shell: cmd From 9237aa4f95783bb864a171a9261c0c3b94256e72 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 15:05:25 +0000 Subject: [PATCH 08/24] more fixes --- .github/workflows/sycl_nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sycl_nightly.yml b/.github/workflows/sycl_nightly.yml index 1c6e10443745b..20a0fba1428de 100644 --- a/.github/workflows/sycl_nightly.yml +++ b/.github/workflows/sycl_nightly.yml @@ -23,7 +23,6 @@ jobs: windows_default: name: Windows (experimental) if: github.repository == 'intel/llvm' - continue-on-error: true uses: ./.github/workflows/sycl_windows_build_and_test.yml ubuntu2004_docker_build_push: From 202292d7b683457daedffd330e3c8dbae33e75f1 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sat, 12 Feb 2022 19:01:37 +0000 Subject: [PATCH 09/24] propagate compiler --- sycl/plugins/level_zero/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sycl/plugins/level_zero/CMakeLists.txt b/sycl/plugins/level_zero/CMakeLists.txt index f4e6a48bc7688..108e299a141c2 100755 --- a/sycl/plugins/level_zero/CMakeLists.txt +++ b/sycl/plugins/level_zero/CMakeLists.txt @@ -41,6 +41,8 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR) -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR:PATH=lib${LLVM_LIBDIR_SUFFIX} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ${AUX_CMAKE_FLAGS} LOG_DOWNLOAD 1 LOG_UPDATE 1 From 74ebfaa39f0bf3b62ea333752bb12bf377a2b689 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 06:22:37 +0000 Subject: [PATCH 10/24] save logs --- .github/workflows/sycl_windows_build_and_test.yml | 10 +++++++++- sycl/plugins/level_zero/CMakeLists.txt | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 9f5b7d1141125..3bfcdddde5589 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -56,7 +56,9 @@ jobs: env: CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' - run: cmake --build build --target sycl-toolchain + run: | + cmake --build build --target pi_level_zero + cmake --build build --target sycl-toolchain - name: Install shell: cmd run: cmake --build build --target deploy-sycl-toolchain @@ -65,3 +67,9 @@ jobs: with: name: sycl_windows_default path: install/**/* + - name: Upload logs + if: always() + uses: actions/upload-artifact@v2 + with: + name: sycl_windows_build_logs + path: build/tools/sycl/plugins/level_zero/level-zero-loader-prefix/src/level-zero-loader-stamp/level-zero-loader-build-*.log diff --git a/sycl/plugins/level_zero/CMakeLists.txt b/sycl/plugins/level_zero/CMakeLists.txt index 108e299a141c2..f4e6a48bc7688 100755 --- a/sycl/plugins/level_zero/CMakeLists.txt +++ b/sycl/plugins/level_zero/CMakeLists.txt @@ -41,8 +41,6 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR) -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR:PATH=lib${LLVM_LIBDIR_SUFFIX} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ${AUX_CMAKE_FLAGS} LOG_DOWNLOAD 1 LOG_UPDATE 1 From 4b6da79d3e4bdce227ccaa7c6770c8ac95dff64b Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 06:46:21 +0000 Subject: [PATCH 11/24] go back to msvc --- .github/workflows/sycl_windows_build_and_test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 3bfcdddde5589..680c15d9ee659 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -38,6 +38,7 @@ jobs: env: CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' + # TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83 run: | mkdir build mkdir install @@ -45,8 +46,8 @@ jobs: set SCCACHE_DIR=%GITHUB_WORKSPACE%\cache set PATH=C:\ProgramData\chocolatey\lib\sccache\tools\sccache-v0.2.15-x86_64-pc-windows-msvc;%PATH% python.exe src/buildbot/configure.py -o build ^ - --cmake-opt="-DCMAKE_C_COMPILER=clang-cl" ^ - --cmake-opt="-DCMAKE_CXX_COMPILER=clang-cl" ^ + --cmake-opt="-DCMAKE_C_COMPILER=cl" ^ + --cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ From be2c30f51f384b7a58e2f6580fa75f8725a35f2f Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 07:07:51 +0000 Subject: [PATCH 12/24] add /FS flag --- sycl/plugins/level_zero/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/plugins/level_zero/CMakeLists.txt b/sycl/plugins/level_zero/CMakeLists.txt index f4e6a48bc7688..76adcbd5bb080 100755 --- a/sycl/plugins/level_zero/CMakeLists.txt +++ b/sycl/plugins/level_zero/CMakeLists.txt @@ -23,6 +23,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR) endif() if (WIN32) set(LEVEL_ZERO_LOADER_SOURCE_VERSION v1.2.3) + list(APPEND AUX_CMAKE_FLAGS -DCMAKE_CXX_FLAGS=/FS) else() set(LEVEL_ZERO_LOADER_SOURCE_VERSION v1.4.1) endif() From 00f1af9b181d1a1fd73f605228c9f89a05e40a9e Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 07:30:51 +0000 Subject: [PATCH 13/24] massage compiler flags --- .github/workflows/sycl_windows_build_and_test.yml | 1 + sycl/CMakeLists.txt | 2 +- sycl/plugins/level_zero/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 680c15d9ee659..da8e722d9880c 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -59,6 +59,7 @@ jobs: CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' run: | cmake --build build --target pi_level_zero + cmake --build build --target sycl cmake --build build --target sycl-toolchain - name: Install shell: cmd diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 01df5c048a4fe..8fc1229127097 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -62,7 +62,7 @@ if(MSVC) include(LLVMCheckLinkerFlag) llvm_check_linker_flag(CXX "/DEBUG" LINKER_SUPPORTS_DEBUG) if(LINKER_SUPPORTS_DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /FS") add_link_options("/DEBUG") # Enable unreferenced removal and ICF in Release mode. diff --git a/sycl/plugins/level_zero/CMakeLists.txt b/sycl/plugins/level_zero/CMakeLists.txt index 76adcbd5bb080..428722f911681 100755 --- a/sycl/plugins/level_zero/CMakeLists.txt +++ b/sycl/plugins/level_zero/CMakeLists.txt @@ -23,7 +23,6 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR) endif() if (WIN32) set(LEVEL_ZERO_LOADER_SOURCE_VERSION v1.2.3) - list(APPEND AUX_CMAKE_FLAGS -DCMAKE_CXX_FLAGS=/FS) else() set(LEVEL_ZERO_LOADER_SOURCE_VERSION v1.4.1) endif() @@ -42,6 +41,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR) -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR:PATH=lib${LLVM_LIBDIR_SUFFIX} + -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${AUX_CMAKE_FLAGS} LOG_DOWNLOAD 1 LOG_UPDATE 1 From 0d90ae0bac5ce58a7d3421302c39e0ca0d50051a Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 08:02:56 +0000 Subject: [PATCH 14/24] more options massaging --- sycl/CMakeLists.txt | 8 +++++++- sycl/plugins/level_zero/CMakeLists.txt | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 8fc1229127097..f06aeda9035f2 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -57,12 +57,18 @@ if(MSVC) set(LLVM_REQUIRES_RTTI ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # Make sure PDBs are written synchronously + if (CMAKE_GENERATOR EQUALS "Ninja") + list(APPEND CMAKE_C_FLAGS /FS) + list(APPEND CMAKE_CXX_FLAGS /FS) + endif() + # Add PDB debug information list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") include(LLVMCheckLinkerFlag) llvm_check_linker_flag(CXX "/DEBUG" LINKER_SUPPORTS_DEBUG) if(LINKER_SUPPORTS_DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /FS") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") add_link_options("/DEBUG") # Enable unreferenced removal and ICF in Release mode. diff --git a/sycl/plugins/level_zero/CMakeLists.txt b/sycl/plugins/level_zero/CMakeLists.txt index 428722f911681..f4e6a48bc7688 100755 --- a/sycl/plugins/level_zero/CMakeLists.txt +++ b/sycl/plugins/level_zero/CMakeLists.txt @@ -41,7 +41,6 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR) -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR:PATH=lib${LLVM_LIBDIR_SUFFIX} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${AUX_CMAKE_FLAGS} LOG_DOWNLOAD 1 LOG_UPDATE 1 From f8a9c04c9f4a4c8ec449e80f0395fcc8e51fbb2a Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 08:07:26 +0000 Subject: [PATCH 15/24] bad syntax --- sycl/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index f06aeda9035f2..697111481017d 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -58,10 +58,8 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") # Make sure PDBs are written synchronously - if (CMAKE_GENERATOR EQUALS "Ninja") - list(APPEND CMAKE_C_FLAGS /FS) - list(APPEND CMAKE_CXX_FLAGS /FS) - endif() + list(APPEND CMAKE_C_FLAGS /FS) + list(APPEND CMAKE_CXX_FLAGS /FS) # Add PDB debug information list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") From 475f08e4ec4bbfe95b74331c6a3ee6ccea89dcf1 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 08:22:10 +0000 Subject: [PATCH 16/24] damn cmake --- sycl/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 697111481017d..5002dadc615b1 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -58,8 +58,8 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") # Make sure PDBs are written synchronously - list(APPEND CMAKE_C_FLAGS /FS) - list(APPEND CMAKE_CXX_FLAGS /FS) + set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /FS") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FS") # Add PDB debug information list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") From 227b3c6acb5ebea090dd9bce82e9792c104a3e03 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 08:39:43 +0000 Subject: [PATCH 17/24] i just want the compiler to build my program am i asking for too much --- sycl/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 5002dadc615b1..b33434d309373 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -60,6 +60,7 @@ if(MSVC) # Make sure PDBs are written synchronously set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /FS") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FS") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FS") # Add PDB debug information list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") From b86751f8bb9c8e349dbec87a7eeb0e580260e52d Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 08:58:32 +0000 Subject: [PATCH 18/24] dear compiler please build this commit i swear it is good --- sycl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index b33434d309373..60b4717ef8295 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -60,7 +60,7 @@ if(MSVC) # Make sure PDBs are written synchronously set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /FS") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FS") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FS") + link_libraries(/FS) # Add PDB debug information list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") From 80b16e3606b090ec4e1faf097efa4b6c0f9200c0 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 09:21:46 +0000 Subject: [PATCH 19/24] disable sccache --- .github/workflows/sycl_windows_build_and_test.yml | 5 +++-- sycl/CMakeLists.txt | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index da8e722d9880c..a8dd140220fb7 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -39,6 +39,7 @@ jobs: CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' # TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83 + # TODO enable sccache run: | mkdir build mkdir install @@ -49,9 +50,9 @@ jobs: --cmake-opt="-DCMAKE_C_COMPILER=cl" ^ --cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ - --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ - --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ --cuda + REM --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" + REM --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" - name: Build shell: cmd env: diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 60b4717ef8295..01df5c048a4fe 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -57,11 +57,6 @@ if(MSVC) set(LLVM_REQUIRES_RTTI ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - # Make sure PDBs are written synchronously - set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /FS") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FS") - link_libraries(/FS) - # Add PDB debug information list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") include(LLVMCheckLinkerFlag) From 9cb9a511a5020c4de1996e03b8e6a26401f29ceb Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 09:47:20 +0000 Subject: [PATCH 20/24] ok, sccache is guilty, can we change that? --- .github/workflows/sycl_windows_build_and_test.yml | 6 +++--- sycl/CMakeLists.txt | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index a8dd140220fb7..fe8d5a0560bec 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -50,9 +50,9 @@ jobs: --cmake-opt="-DCMAKE_C_COMPILER=cl" ^ --cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ - --cuda - REM --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" - REM --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + --cuda ^ + --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ + --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" - name: Build shell: cmd env: diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 01df5c048a4fe..84bb82e430f7a 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -62,8 +62,13 @@ if(MSVC) include(LLVMCheckLinkerFlag) llvm_check_linker_flag(CXX "/DEBUG" LINKER_SUPPORTS_DEBUG) if(LINKER_SUPPORTS_DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") + if ("${CMAKE_CXX_COMPILER_LAUNCHER}" EQUAL "sccache") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Z7") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") + endif() add_link_options("/DEBUG") + add_link_options("/FS") # Enable unreferenced removal and ICF in Release mode. llvm_check_linker_flag(CXX "/OPT:REF /OPT:ICF" LINKER_SUPPORTS_OPTS) From 37a2766e863426a28a7f599cd997b581a38d7a4f Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 10:02:05 +0000 Subject: [PATCH 21/24] what's going on? --- .github/workflows/sycl_windows_build_and_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index fe8d5a0560bec..935cb077b182e 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -50,9 +50,9 @@ jobs: --cmake-opt="-DCMAKE_C_COMPILER=cl" ^ --cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ - --cuda ^ --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ - --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ + --cuda - name: Build shell: cmd env: From 1703c6d90fbe82607bfc64831c6a684b7e94acda Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 10:17:26 +0000 Subject: [PATCH 22/24] test --- .github/workflows/sycl_windows_build_and_test.yml | 8 ++++---- sycl/CMakeLists.txt | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 935cb077b182e..0fb52715d66cd 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies shell: cmd run: | - choco install -y cuda --version 11.6.0.51123 + REM choco install -y cuda --version 11.6.0.51123 choco install -y ninja choco install -y sccache --version 0.2.15 refreshenv @@ -50,9 +50,9 @@ jobs: --cmake-opt="-DCMAKE_C_COMPILER=cl" ^ --cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ - --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ - --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ - --cuda + REM --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ + REM --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ + REM --cuda - name: Build shell: cmd env: diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 84bb82e430f7a..01df5c048a4fe 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -62,13 +62,8 @@ if(MSVC) include(LLVMCheckLinkerFlag) llvm_check_linker_flag(CXX "/DEBUG" LINKER_SUPPORTS_DEBUG) if(LINKER_SUPPORTS_DEBUG) - if ("${CMAKE_CXX_COMPILER_LAUNCHER}" EQUAL "sccache") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Z7") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") - endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi") add_link_options("/DEBUG") - add_link_options("/FS") # Enable unreferenced removal and ICF in Release mode. llvm_check_linker_flag(CXX "/OPT:REF /OPT:ICF" LINKER_SUPPORTS_OPTS) From 11bda34a3202fcdd77baac953cbc4bc564854624 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 10:33:21 +0000 Subject: [PATCH 23/24] final? --- .../workflows/sycl_windows_build_and_test.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index 0fb52715d66cd..a2e8d7375ecfa 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies shell: cmd run: | - REM choco install -y cuda --version 11.6.0.51123 + choco install -y cuda --version 11.6.0.51123 choco install -y ninja choco install -y sccache --version 0.2.15 refreshenv @@ -39,7 +39,7 @@ jobs: CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' # TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83 - # TODO enable sccache + # TODO enable sccache, when problems with PDB are resolved run: | mkdir build mkdir install @@ -50,17 +50,13 @@ jobs: --cmake-opt="-DCMAKE_C_COMPILER=cl" ^ --cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^ --cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ - REM --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^ - REM --cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^ - REM --cuda + --cuda - name: Build shell: cmd env: CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6' run: | - cmake --build build --target pi_level_zero - cmake --build build --target sycl cmake --build build --target sycl-toolchain - name: Install shell: cmd @@ -69,10 +65,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: sycl_windows_default - path: install/**/* - - name: Upload logs - if: always() - uses: actions/upload-artifact@v2 - with: - name: sycl_windows_build_logs - path: build/tools/sycl/plugins/level_zero/level-zero-loader-prefix/src/level-zero-loader-stamp/level-zero-loader-build-*.log + path: install/**/* \ No newline at end of file From fdee1355f42b41bd40c3f0ddd2c36436a79b6479 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Sun, 13 Feb 2022 17:24:04 +0300 Subject: [PATCH 24/24] Update .github/workflows/sycl_windows_build_and_test.yml --- .github/workflows/sycl_windows_build_and_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index a2e8d7375ecfa..28a5af49c0ee9 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -17,7 +17,6 @@ jobs: run: | choco install -y cuda --version 11.6.0.51123 choco install -y ninja - choco install -y sccache --version 0.2.15 refreshenv echo CUDA_PATH=%CUDA_PATH% echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV%