From dc8834a1872ac468d229b553df7d2942300c92a7 Mon Sep 17 00:00:00 2001 From: kazhang Date: Mon, 12 Feb 2024 12:25:30 -0800 Subject: [PATCH] Use gcc-10 in linux workflow Link with -ldl on linux --- .github/workflows/linux-x86_64.yml | 13 ++++++++++++- .github/workflows/release-linux.yml | 13 ++++++++++++- source/CMakeLists.txt | 1 + source/DeviceWrapper.cpp | 3 +++ source/main.cpp | 1 + 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index a053c5f..a110558 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -9,9 +9,20 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: + - name: select gcc 10 + run: | + sudo update-alternatives \ + --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ + --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ + --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-10 \ + --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 \ + --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \ + --slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-10 \ + --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-10 - uses: actions/checkout@v3 - name: Install prerequisite run: sudo apt-get install ninja-build diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 96a94fe..a94db46 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -9,9 +9,20 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: + - name: select gcc 10 + run: | + sudo update-alternatives \ + --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ + --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ + --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-10 \ + --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 \ + --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \ + --slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-10 \ + --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-10 - uses: actions/checkout@v3 - name: Install prerequisite run: sudo apt-get install ninja-build diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index b8de763..8d00559 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -117,6 +117,7 @@ target_link_libraries(falcor_perftest PUBLIC slang slang-gfx external_includes + $<$:dl> ) set_target_properties(falcor_perftest PROPERTIES diff --git a/source/DeviceWrapper.cpp b/source/DeviceWrapper.cpp index c16bcae..493ab1d 100644 --- a/source/DeviceWrapper.cpp +++ b/source/DeviceWrapper.cpp @@ -3,6 +3,7 @@ Device::Device() { + printf("slang: create global session\n"); slang::createGlobalSession(m_slangGlobalSession.writeRef()); m_pProgramManager = std::make_unique(this); @@ -21,6 +22,7 @@ Device::Device() gfxDesc.extendedDescCount = extendedDescs.size(); gfxDesc.extendedDescs = extendedDescs.data(); + printf("gfx:: get GPU adapters\n"); gfx::AdapterList adapters = gfx::gfxGetAdapters(gfxDesc.deviceType); if (adapters.getCount() == 0) { @@ -33,6 +35,7 @@ Device::Device() mpAPIDispatcher.reset(new PipelineCreationAPIDispatcher()); gfxDesc.apiCommandDispatcher = static_cast(mpAPIDispatcher.get()); + printf("gfx create device\n"); if (SLANG_FAILED(gfx::gfxCreateDevice(&gfxDesc, m_gfxDevice.writeRef()))) { printf("Failed to create device on GPU 0 (%s).", adapters.getAdapters()[0].name); diff --git a/source/main.cpp b/source/main.cpp index 37eb3cf..c3df783 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -128,6 +128,7 @@ void TestCase(ref& device) int main(int argc, char* argv[]) { + printf("Starting creating device\n"); ref device = make_ref(); TestCase(device);