-
Notifications
You must be signed in to change notification settings - Fork 370
135 lines (118 loc) · 4.61 KB
/
Copy pathubuntu.yml
File metadata and controls
135 lines (118 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Ubuntu CUDA Build
on:
push:
branches: [ dev, master ]
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches: [ dev, master ]
paths-ignore:
- '**.md'
- 'docs/**'
workflow_dispatch:
jobs:
build-ubuntu:
if: github.repository == 'MrNeRF/LichtFeld-Studio' || github.event.pull_request.base.repo.full_name == 'MrNeRF/LichtFeld-Studio'
runs-on: ubuntu-24.04
container:
image: nvidia/cuda:12.8.0-devel-ubuntu24.04
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
env:
VCPKG_ROOT: ${{ github.workspace }}/../vcpkg
CC: gcc-14
CXX: g++-14
VCPKG_BUILD_TYPE: release
VCPKG_FORCE_SYSTEM_BINARIES: 1
CMAKE_MAKE_PROGRAM: /usr/bin/ninja
steps:
- name: Install Git
run: |
apt-get update
apt-get install -y git
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive
- name: Free disk space
run: |
apt-get clean
rm -rf /var/lib/apt/lists/*
# Host paths (may not exist in container)
rm -rf /usr/share/dotnet /opt/ghc /opt/hostedtoolcache /usr/local/lib/android /opt/az
# CUDA extras - samples, docs, tools we don't need
rm -rf /usr/local/cuda/nsight* /usr/local/cuda/compute-sanitizer
rm -rf /usr/local/cuda/extras /usr/local/cuda/tools
rm -rf /usr/local/cuda/doc
# Remove large static libs but keep ones needed for build
find /usr/local/cuda/targets/x86_64-linux/lib -name '*.a' \
! -name 'libcudart_static.a' \
! -name 'libcudadevrt.a' \
! -name 'libnvjpeg_static.a' \
! -name 'libnvjpeg2k_static.a' \
! -name 'libculibos.a' \
-delete 2>/dev/null || true
df -h
- name: Install build dependencies
run: |
apt-get update
apt-get install -y ca-certificates gpg wget
# CMake 3.30+ from Kitware
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get update
apt-get install -y kitware-archive-keyring
apt-get install -y git curl unzip cmake gcc-14 g++-14 ccache ninja-build \
zip tar pkg-config python3 python3-dev libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev \
libwayland-dev libxkbcommon-dev libegl-dev libdecor-0-dev libibus-1.0-dev libdbus-1-dev \
libsystemd-dev \
nasm autoconf autoconf-archive automake libtool
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-14
- name: Cache vcpkg tool
id: cache-vcpkg-tool
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_ROOT }}
key: vcpkg-tool-${{ runner.os }}-2026-02-21
restore-keys: vcpkg-tool-${{ runner.os }}-
- name: Setup vcpkg
if: steps.cache-vcpkg-tool.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Configure vcpkg triplet
run: |
cat >> $VCPKG_ROOT/triplets/x64-linux.cmake << 'EOF'
set(VCPKG_BUILD_TYPE release)
set(VCPKG_MAX_CONCURRENCY 2)
EOF
- name: Cache ccache
uses: actions/cache@v4
with:
path: /github/home/.cache/ccache
key: ccache-${{ runner.os }}-${{ matrix.build_type }}-${{ github.run_id }}
restore-keys: ccache-${{ runner.os }}-${{ matrix.build_type }}-
- name: Cache vcpkg packages
uses: actions/cache@v4
with:
path: /github/home/.cache/vcpkg/archives
key: vcpkg-pkgs-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}
restore-keys: vcpkg-pkgs-${{ runner.os }}-
- name: Configure
run: |
cmake -B build -S . -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
-DBUILD_PYTHON_STUBS=OFF \
-DCUDA_DEVICE_DEBUG=OFF
- name: Clean vcpkg buildtrees
run: |
rm -rf build/vcpkg_installed/vcpkg/blds
df -h
- name: Build
run: cmake --build build -j $(nproc)