diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95527c0..e2e6440 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,35 +6,69 @@ on: jobs: linux_cuda: - name: cuda/release/linux - runs-on: ubuntu-latest - container: nvidia/cuda:12.9.1-devel-ubuntu22.04 - env: - DEBIAN_FRONTEND: noninteractive - TZ: Etc/UTC - strategy: - matrix: - biomes: [0, 1] - steps: - - name: Install build tools - run: | - apt-get update - apt-get install -y build-essential g++-11 - - uses: actions/checkout@v7 - - name: Build (Linux, LARGE_BIOMES=${{ matrix.biomes }}) - run: | - make LARGE_BIOMES=${{ matrix.biomes }} ARCH=sm_89 CC=gcc-11 CXX=g++-11 - - uses: actions/upload-artifact@v7 - with: - name: ${{ github.event.repository.name }}.${{ github.run_id }}.linux_x86.biomes${{ matrix.biomes }} - path: ./main + name: cuda/release/linux + runs-on: ubuntu-latest + container: nvidia/cuda:12.9.1-devel-ubuntu22.04 + env: + DEBIAN_FRONTEND: noninteractive + TZ: Etc/UTC + strategy: + matrix: + variants: [0, 1, 2, 3] + include: + - variants: 0 + biome_name: "small_biomes" + large_biomes: 0 + unbound: 0 + - variants: 1 + biome_name: "small_biomes" + large_biomes: 0 + unbound: 1 + - variants: 2 + biome_name: "large_biomes" + large_biomes: 1 + unbound: 0 + - variants: 3 + biome_name: "large_biomes" + large_biomes: 1 + unbound: 1 + steps: + - name: Install build tools + run: | + apt-get update + apt-get install -y build-essential g++-11 + - uses: actions/checkout@v7 + - name: Build (Linux, biomes:${{ matrix.biomes }}, unbound:${{matrix.unbound}}) + run: | + make LARGE_BIOMES=${{ matrix.large_biomes }} UNBOUND=${{matrix.unbound}} ARCH=all CC=gcc-11 CXX=g++-11 + - uses: actions/upload-artifact@v7 + with: + name: ${{ github.event.repository.name }}.${{ github.run_id }}.linux_x86.${{ matrix.biome_name }} + path: ./main-* windows_cuda: name: cuda/release/windows runs-on: windows-2022 strategy: matrix: - biomes: [0, 1] + variants: [0, 1, 2, 3] + include: + - variants: 0 + biome_name: "small_biomes" + large_biomes: 0 + unbound: 0 + - variants: 1 + biome_name: "small_biomes" + large_biomes: 0 + unbound: 1 + - variants: 2 + biome_name: "large_biomes" + large_biomes: 1 + unbound: 0 + - variants: 3 + biome_name: "large_biomes" + large_biomes: 1 + unbound: 1 steps: - uses: actions/checkout@v7 - uses: ilammy/msvc-dev-cmd@v1 @@ -76,11 +110,11 @@ jobs: echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Build with Makefile (Windows, LARGE_BIOMES=${{ matrix.biomes }}) + - name: Build with Makefile (Windows, biomes:${{ matrix.biome_name }}, unbound:${{ matrix.unbound }}) shell: msys2 {0} run: | - make LARGE_BIOMES=${{ matrix.biomes }} ARCH=sm_89 + make LARGE_BIOMES=${{ matrix.large_biomes }} UNBOUND=${{matrix.unbound}} ARCH=all - uses: actions/upload-artifact@v7 with: - name: ${{ github.event.repository.name }}.${{ github.run_id }}.windows_x86.biomes${{ matrix.biomes }} - path: ./main.exe + name: ${{ github.event.repository.name }}.${{ github.run_id }}.windows_x86.${{matrix.biome_name}} + path: ./main-*.exe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f60e86d..f746354 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,37 +15,61 @@ jobs: TZ: Etc/UTC strategy: matrix: - biomes: [0, 1] + variants: [0, 1, 2, 3] include: - - biomes: 0 + - variants: 0 biome_name: "small_biomes" - - biomes: 1 + large_biomes: 0 + unbound: 0 + - variants: 1 + biome_name: "small_biomes" + large_biomes: 0 + unbound: 1 + - variants: 2 + biome_name: "large_biomes" + large_biomes: 1 + unbound: 0 + - variants: 3 biome_name: "large_biomes" + large_biomes: 1 + unbound: 1 steps: - name: Install build tools run: | apt-get update apt-get install -y build-essential g++-11 - uses: actions/checkout@v7 - - name: Build (Linux, LARGE_BIOMES=${{ matrix.biomes }}) + - name: Build (Linux, biomes:${{ matrix.biomes }}, unbound:${{matrix.unbound}}) run: | - make LARGE_BIOMES=${{ matrix.biomes }} ARCH=all CC=gcc-11 CXX=g++-11 + make LARGE_BIOMES=${{ matrix.large_biomes }} UNBOUND=${{matrix.unbound}} ARCH=all CC=gcc-11 CXX=g++-11 - uses: actions/upload-artifact@v7 with: name: ${{ github.event.repository.name }}.${{ github.run_id }}.linux_x86.${{ matrix.biome_name }} - path: ./main + path: ./main-* windows_cuda: name: cuda/release/windows runs-on: windows-2022 strategy: matrix: - biomes: [0, 1] + variants: [0, 1, 2, 3] include: - - biomes: 0 + - variants: 0 biome_name: "small_biomes" - - biomes: 1 + large_biomes: 0 + unbound: 0 + - variants: 1 + biome_name: "small_biomes" + large_biomes: 0 + unbound: 1 + - variants: 2 + biome_name: "large_biomes" + large_biomes: 1 + unbound: 0 + - variants: 3 biome_name: "large_biomes" + large_biomes: 1 + unbound: 1 steps: - uses: actions/checkout@v7 - uses: ilammy/msvc-dev-cmd@v1 @@ -87,14 +111,14 @@ jobs: echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Build with Makefile (Windows, LARGE_BIOMES=${{ matrix.biomes }}) + - name: Build with Makefile (Windows, biomes:${{ matrix.biome_name }}, unbound:${{ matrix.unbound }}) shell: msys2 {0} run: | - make LARGE_BIOMES=${{ matrix.biomes }} ARCH=all + make LARGE_BIOMES=${{ matrix.large_biomes }} UNBOUND=${{matrix.unbound}} ARCH=all - uses: actions/upload-artifact@v7 with: name: ${{ github.event.repository.name }}.${{ github.run_id }}.windows_x86.${{matrix.biome_name}} - path: ./main.exe + path: ./main-*.exe create_release: runs-on: ubuntu-latest diff --git a/makefile b/makefile index 0669883..15afc77 100644 --- a/makefile +++ b/makefile @@ -2,6 +2,17 @@ CUBIOMES_SRC := $(addprefix cubiomes/,biomenoise.c biomes.c finders.c generator. LARGE_BIOMES ?= 0 UNBOUND ?= 0 + +ifeq (UNBOUND, 1) + BIN_SUFFIX += u +endif + +ifeq (LARGE_BIOMES, 1) + BIN_SUFFIX += lb +else + BIN_SUFFIX += sb +endif + PRINT_INTERVAL ?= 256 # Auto-detect GPU architecture: # - RTX 40xx/50xx series: sm_89 is faster than native sm_120 @@ -36,7 +47,7 @@ clean: # nvcc src/*.cpp src/*.c src/*.cu -o main.exe cubiomes/biomenoise.c cubiomes/biomes.c cubiomes/finders.c cubiomes/generator.c cubiomes/layers.c cubiomes/noise.c -arch=native -O3 -std=c++20 -I asio-1.34.2/include -DOMISSION_LARGE_BIOMES=1 --expt-relaxed-constexpr --default-stream per-thread -D_WIN32_WINNT=0x0601 main.exe: $(SRC) $(CUBIOMES_SRC) - nvcc $(SRC) $(CUBIOMES_SRC) -o $@ $(NVCC_FLAGS) -D_WIN32_WINNT=0x0601 + nvcc $(SRC) $(CUBIOMES_SRC) -o $@-$(BIN_SUFFIX) $(NVCC_FLAGS) -D_WIN32_WINNT=0x0601 else override NVCC_FLAGS += -ccbin $(CXX) @@ -92,5 +103,5 @@ server.o: src/server.cpp src/server.h src/common.h $(CXX) -c $< -o $@ $(CXXFLAGS) main: $(MAIN_DEP) - $(MAIN_CXX) $(MAIN_SRC) -o $@ $(MAIN_CXXFLAGS) + $(MAIN_CXX) $(MAIN_SRC) -o $@-$(BIN_SUFFIX) $(MAIN_CXXFLAGS) endif