Skip to content

Commit

Permalink
Use gcc-10 in linux workflow
Browse files Browse the repository at this point in the history
Link with -ldl on linux
  • Loading branch information
kaizhangNV committed Feb 13, 2024
1 parent 40db068 commit bf4d8a3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ target_link_libraries(falcor_perftest
PUBLIC
slang slang-gfx
external_includes
$<$<PLATFORM_ID:Linux>:dl>
)

set_target_properties(falcor_perftest PROPERTIES
Expand Down
12 changes: 3 additions & 9 deletions source/DeviceWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Device::Device()
{
printf("slang: create global session\n");
slang::createGlobalSession(m_slangGlobalSession.writeRef());
m_pProgramManager = std::make_unique<ProgramManager>(this);

Expand All @@ -12,15 +13,7 @@ Device::Device()
gfxDesc.shaderCache.maxEntryCount = 1000;
gfxDesc.shaderCache.shaderCachePath = nullptr;

std::vector<void*> extendedDescs;
// Add extended desc for root parameter attribute.
gfx::D3D12DeviceExtendedDesc extDesc = {};
extDesc.rootParameterShaderAttributeName = "root";
extendedDescs.push_back(&extDesc);

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)
{
Expand All @@ -33,6 +26,7 @@ Device::Device()
mpAPIDispatcher.reset(new PipelineCreationAPIDispatcher());
gfxDesc.apiCommandDispatcher = static_cast<ISlangUnknown*>(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);
Expand Down
5 changes: 3 additions & 2 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ void TestCase(ref<Device>& device)

int main(int argc, char* argv[])
{
ref<Device> device = make_ref<Device>();
TestCase(device);
printf("Starting creating device\n");
// ref<Device> device = make_ref<Device>();
// TestCase(device);

return 0;
}

0 comments on commit bf4d8a3

Please sign in to comment.