elungky commited on
Commit
1e34ce9
·
1 Parent(s): 8d604f9

Ensured gui/requirements.txt is explicitly added and committed

Browse files
.gitignore CHANGED
@@ -36,7 +36,6 @@ apex/
36
  *.pt
37
  *.bin
38
  *.pickle
39
- *.txt
40
 
41
  # Other uncheckable file types
42
  *.zip
 
36
  *.pt
37
  *.bin
38
  *.pickle
 
39
 
40
  # Other uncheckable file types
41
  *.zip
gui/CMakeLists.txt ADDED
@@ -0,0 +1,448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ cmake_minimum_required(VERSION 3.18)
17
+
18
+ project(gen3c-gui
19
+ VERSION 1.0
20
+ DESCRIPTION "Gen3C Graphical User Interface"
21
+ LANGUAGES C CXX CUDA
22
+ )
23
+ set(NGP_VERSION "${CMAKE_PROJECT_VERSION}")
24
+
25
+ if (NOT NGP_DEPLOY)
26
+ set(NGP_VERSION "${NGP_VERSION}dev")
27
+ endif()
28
+
29
+ option(NGP_BUILD_EXECUTABLE "Build Gen3C executable?" OFF)
30
+ option(NGP_BUILD_WITH_GUI "Build with GUI support (requires GLFW and GLEW)?" ON)
31
+ option(NGP_BUILD_WITH_PYTHON_BINDINGS "Build bindings that allow instrumenting Gen3C with Python?" ON)
32
+ option(NGP_BUILD_WITH_VULKAN "Build with Vulkan to enable DLSS support?" OFF)
33
+
34
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
35
+
36
+ ###############################################################################
37
+ # Build type and C++ compiler setup
38
+ ###############################################################################
39
+
40
+ # Set a default configuration if none was specified
41
+ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
42
+ message(STATUS "No release type specified. Setting to 'Release'.")
43
+ set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
44
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")
45
+ endif()
46
+
47
+ if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/glfw/CMakeLists.txt")
48
+ message(FATAL_ERROR
49
+ "Some Gen3C dependencies are missing. "
50
+ "If you forgot the \"--recursive\" flag when cloning this project, "
51
+ "this can be fixed by calling \"git submodule update --init --recursive\"."
52
+ )
53
+ endif()
54
+
55
+ if (APPLE)
56
+ set(CMAKE_MACOSX_RPATH ON)
57
+ endif()
58
+
59
+ if (CMAKE_EXPORT_COMPILE_COMMANDS)
60
+ set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
61
+ set(CMAKE_CUDA_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES})
62
+ endif()
63
+
64
+ if (MSVC)
65
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS")
66
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP24")
67
+ else()
68
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
69
+ endif()
70
+
71
+ set(CMAKE_CXX_STANDARD 14)
72
+ set(CMAKE_CXX_EXTENSIONS OFF)
73
+
74
+ ###############################################################################
75
+ # CUDA compiler setup
76
+ ###############################################################################
77
+
78
+ set(CMAKE_CUDA_STANDARD 14)
79
+ set(CMAKE_CUDA_STANDARD_REQUIRED ON)
80
+ set(CMAKE_CUDA_EXTENSIONS OFF)
81
+ set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC)
82
+ set(CMAKE_CUDA_RUNTIME_LIBRARY Shared)
83
+
84
+ if (MSVC)
85
+ list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=/bigobj")
86
+ else()
87
+ list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-Wno-float-conversion")
88
+ list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-fno-strict-aliasing")
89
+ list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-fPIC")
90
+ endif()
91
+ list(APPEND CUDA_NVCC_FLAGS "--extended-lambda")
92
+ list(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr")
93
+ list(APPEND CUDA_NVCC_FLAGS "--use_fast_math")
94
+
95
+ # Figure out CUDA version
96
+ if(CMAKE_CUDA_COMPILER_LOADED)
97
+ if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
98
+ set(CUDA_VERSION "${CMAKE_MATCH_1}")
99
+ endif()
100
+ endif()
101
+
102
+ # Adapted from the CMake source code at https://github.com/Kitware/CMake/blob/master/Modules/FindCUDA/select_compute_arch.cmake
103
+ # Simplified to return a semicolon-separated list of the compute capabilities of installed devices
104
+ function(TCNN_AUTODETECT_CUDA_ARCHITECTURES OUT_VARIABLE)
105
+ if (NOT TCNN_AUTODETECT_CUDA_ARCHITECTURES_OUTPUT)
106
+ if (CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
107
+ set(file "${PROJECT_BINARY_DIR}/detect_tcnn_cuda_architectures.cu")
108
+ else()
109
+ set(file "${PROJECT_BINARY_DIR}/detect_tcnn_cuda_architectures.cpp")
110
+ endif()
111
+
112
+ file(WRITE ${file} ""
113
+ "#include <cuda_runtime.h>\n"
114
+ "#include <cstdio>\n"
115
+ "int main() {\n"
116
+ " int count = 0;\n"
117
+ " if (cudaSuccess != cudaGetDeviceCount(&count)) return -1;\n"
118
+ " if (count == 0) return -1;\n"
119
+ " for (int device = 0; device < count; ++device) {\n"
120
+ " cudaDeviceProp prop;\n"
121
+ " if (cudaSuccess == cudaGetDeviceProperties(&prop, device)) {\n"
122
+ " std::printf(\"%d%d\", prop.major, prop.minor);\n"
123
+ " if (device < count - 1) std::printf(\";\");\n"
124
+ " }\n"
125
+ " }\n"
126
+ " return 0;\n"
127
+ "}\n"
128
+ )
129
+
130
+ try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file} RUN_OUTPUT_VARIABLE compute_capabilities)
131
+ if (run_result EQUAL 0)
132
+ # If the user has multiple GPUs with the same compute capability installed, list that capability only once.
133
+ list(REMOVE_DUPLICATES compute_capabilities)
134
+ set(TCNN_AUTODETECT_CUDA_ARCHITECTURES_OUTPUT ${compute_capabilities} CACHE INTERNAL "Returned GPU architectures from detect_gpus tool" FORCE)
135
+ endif()
136
+ endif()
137
+
138
+ if (NOT TCNN_AUTODETECT_CUDA_ARCHITECTURES_OUTPUT)
139
+ message(STATUS "Automatic GPU detection failed. Building for Turing and Ampere as a best guess.")
140
+ set(${OUT_VARIABLE} "75;86" PARENT_SCOPE)
141
+ else()
142
+ set(${OUT_VARIABLE} ${TCNN_AUTODETECT_CUDA_ARCHITECTURES_OUTPUT} PARENT_SCOPE)
143
+ endif()
144
+ endfunction()
145
+
146
+ set(TCNN_CUDA_ARCHITECTURES "" CACHE STRING "Build tiny-cuda-nn for a specific GPU architecture.")
147
+ if (DEFINED ENV{TCNN_CUDA_ARCHITECTURES})
148
+ message(STATUS "Obtained CUDA architectures from environment variable TCNN_CUDA_ARCHITECTURES=$ENV{TCNN_CUDA_ARCHITECTURES}")
149
+ set(CMAKE_CUDA_ARCHITECTURES $ENV{TCNN_CUDA_ARCHITECTURES})
150
+ elseif (TCNN_CUDA_ARCHITECTURES)
151
+ message(STATUS "Obtained CUDA architectures from CMake variable TCNN_CUDA_ARCHITECTURES=${TCNN_CUDA_ARCHITECTURES}")
152
+ set(CMAKE_CUDA_ARCHITECTURES ${TCNN_CUDA_ARCHITECTURES})
153
+ else()
154
+ message(STATUS "Obtained CUDA architectures automatically from installed GPUs")
155
+ TCNN_AUTODETECT_CUDA_ARCHITECTURES(CMAKE_CUDA_ARCHITECTURES)
156
+ endif()
157
+
158
+ # If the CUDA version does not support the chosen architecture, target
159
+ # the latest supported one instead.
160
+ if (CUDA_VERSION VERSION_LESS 11.0)
161
+ set(LATEST_SUPPORTED_CUDA_ARCHITECTURE 75)
162
+ elseif (CUDA_VERSION VERSION_LESS 11.1)
163
+ set(LATEST_SUPPORTED_CUDA_ARCHITECTURE 80)
164
+ elseif (CUDA_VERSION VERSION_LESS 11.8)
165
+ set(LATEST_SUPPORTED_CUDA_ARCHITECTURE 86)
166
+ else()
167
+ set(LATEST_SUPPORTED_CUDA_ARCHITECTURE 90)
168
+ endif()
169
+
170
+ if (CUDA_VERSION VERSION_GREATER_EQUAL 12.0)
171
+ set(EARLIEST_SUPPORTED_CUDA_ARCHITECTURE 50)
172
+ else()
173
+ set(EARLIEST_SUPPORTED_CUDA_ARCHITECTURE 20)
174
+ endif()
175
+
176
+ foreach (CUDA_CC IN LISTS CMAKE_CUDA_ARCHITECTURES)
177
+ if (CUDA_CC GREATER ${LATEST_SUPPORTED_CUDA_ARCHITECTURE})
178
+ message(WARNING "CUDA version ${CUDA_VERSION} is too low for detected architecture ${CUDA_CC}. Targeting the highest supported architecture ${LATEST_SUPPORTED_CUDA_ARCHITECTURE} instead.")
179
+ list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES ${CUDA_CC})
180
+ if (NOT CMAKE_CUDA_ARCHITECTURES)
181
+ list(APPEND CMAKE_CUDA_ARCHITECTURES ${LATEST_SUPPORTED_CUDA_ARCHITECTURE})
182
+ endif()
183
+ endif()
184
+
185
+ if (CUDA_CC LESS ${EARLIEST_SUPPORTED_CUDA_ARCHITECTURE})
186
+ message(ERROR "CUDA version ${CUDA_VERSION} no longer supports detected architecture ${CUDA_CC}. Targeting the lowest supported architecture ${EARLIEST_SUPPORTED_CUDA_ARCHITECTURE} instead.")
187
+ list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES ${CUDA_CC})
188
+ if (NOT CMAKE_CUDA_ARCHITECTURES)
189
+ list(APPEND CMAKE_CUDA_ARCHITECTURES ${EARLIEST_SUPPORTED_CUDA_ARCHITECTURE})
190
+ endif()
191
+ endif()
192
+ endforeach(CUDA_CC)
193
+
194
+ if (NOT CMAKE_CUDA_ARCHITECTURES)
195
+ list(APPEND CMAKE_CUDA_ARCHITECTURES ${LATEST_SUPPORTED_CUDA_ARCHITECTURE})
196
+ endif()
197
+
198
+ # Sort the list to obtain lowest architecture that must be compiled for.
199
+ list(SORT CMAKE_CUDA_ARCHITECTURES COMPARE NATURAL ORDER ASCENDING)
200
+ list(GET CMAKE_CUDA_ARCHITECTURES 0 MIN_GPU_ARCH)
201
+
202
+ string(REPLACE "-virtual" "" MIN_GPU_ARCH "${MIN_GPU_ARCH}")
203
+
204
+ message(STATUS "Targeting CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
205
+ if (CUDA_VERSION VERSION_LESS 10.2)
206
+ message(FATAL_ERROR "CUDA version too low. tiny-cuda-nn require CUDA 10.2 or higher.")
207
+ endif()
208
+
209
+ list(APPEND NGP_DEFINITIONS -DTCNN_MIN_GPU_ARCH=${MIN_GPU_ARCH})
210
+ list(APPEND NGP_LIBRARIES cuda)
211
+
212
+ ###############################################################################
213
+ # Dependencies
214
+ ###############################################################################
215
+
216
+ add_subdirectory("dependencies/fmt")
217
+ list(APPEND NGP_LIBRARIES fmt)
218
+ list(APPEND NGP_INCLUDES "dependencies/fmt/include")
219
+
220
+ if (NGP_BUILD_WITH_GUI)
221
+ find_package(Vulkan)
222
+ if (Vulkan_FOUND AND NGP_BUILD_WITH_VULKAN)
223
+ set(NGP_VULKAN ON)
224
+ list(APPEND NGP_DEFINITIONS -DNGP_VULKAN -DGLFW_INCLUDE_VULKAN)
225
+ list(APPEND NGP_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
226
+ list(APPEND NGP_LIBRARIES ${Vulkan_LIBRARIES})
227
+
228
+ list(APPEND GUI_SOURCES src/dlss.cu)
229
+
230
+ # DLSS depends on vulkan, so appears here
231
+ list(APPEND NGP_INCLUDE_DIRECTORIES "dependencies/dlss/include")
232
+ if (MSVC)
233
+ list(APPEND NGP_LINK_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Windows_x86_64/x86_64")
234
+ list(APPEND NGP_LIBRARIES "$<IF:$<CONFIG:Debug>,nvsdk_ngx_d_dbg,nvsdk_ngx_d>")
235
+ else()
236
+ list(APPEND NGP_LINK_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Linux_x86_64")
237
+ list(APPEND NGP_LIBRARIES nvsdk_ngx)
238
+ endif()
239
+ else()
240
+ set(NGP_VULKAN OFF)
241
+ if (NGP_BUILD_WITH_VULKAN)
242
+ message(WARNING
243
+ "Vulkan was not found. Gen3C GUI will still compile and run correctly, but DLSS will not be supported."
244
+ )
245
+ endif()
246
+ endif()
247
+
248
+ # OpenXR
249
+ if (WIN32)
250
+ list(APPEND NGP_DEFINITIONS -DXR_USE_PLATFORM_WIN32 -DGLFW_EXPOSE_NATIVE_WGL)
251
+ elseif (UNIX AND NOT APPLE)
252
+ list(APPEND NGP_DEFINITIONS -DGLFW_EXPOSE_NATIVE_GLX)
253
+ if (JK_USE_WAYLAND)
254
+ set(PRESENTATION_BACKEND wayland CACHE STRING " " FORCE)
255
+ set(BUILD_WITH_XLIB_HEADERS OFF CACHE BOOL " " FORCE)
256
+ set(BUILD_WITH_XCB_HEADERS OFF CACHE BOOL " " FORCE)
257
+ set(BUILD_WITH_WAYLAND_HEADERS ON CACHE BOOL " " FORCE)
258
+ list(APPEND NGP_DEFINITIONS -DGLFW_EXPOSE_NATIVE_WAYLAND -DXR_USE_PLATFORM_WAYLAND)
259
+ else()
260
+ set(PRESENTATION_BACKEND xlib CACHE STRING " " FORCE)
261
+ set(BUILD_WITH_XLIB_HEADERS ON CACHE BOOL " " FORCE)
262
+ set(BUILD_WITH_XCB_HEADERS OFF CACHE BOOL " " FORCE)
263
+ set(BUILD_WITH_WAYLAND_HEADERS OFF CACHE BOOL " " FORCE)
264
+ list(APPEND NGP_DEFINITIONS -DGLFW_EXPOSE_NATIVE_X11 -DXR_USE_PLATFORM_XLIB)
265
+ endif()
266
+ else()
267
+ message(FATAL_ERROR "No OpenXR platform set for this OS")
268
+ endif()
269
+
270
+ add_subdirectory(dependencies/OpenXR-SDK)
271
+
272
+ list(APPEND NGP_INCLUDE_DIRECTORIES "dependencies/OpenXR-SDK/include" "dependencies/OpenXR-SDK/src/common")
273
+ list(APPEND NGP_LIBRARIES openxr_loader)
274
+ list(APPEND GUI_SOURCES src/openxr_hmd.cu)
275
+
276
+ # OpenGL
277
+ find_package(OpenGL REQUIRED)
278
+
279
+ # GLFW
280
+ set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE)
281
+ set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE)
282
+ set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE)
283
+ set(GLFW_BUILD_INSTALL OFF CACHE BOOL " " FORCE)
284
+ set(GLFW_INSTALL OFF CACHE BOOL " " FORCE)
285
+ set(GLFW_USE_CHDIR OFF CACHE BOOL " " FORCE)
286
+ set(GLFW_VULKAN_STATIC OFF CACHE BOOL " " FORCE)
287
+ set(BUILD_SHARED_LIBS ON CACHE BOOL " " FORCE)
288
+
289
+ add_subdirectory(dependencies/glfw)
290
+
291
+ set_target_properties(glfw PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
292
+
293
+ mark_as_advanced(
294
+ GLFW_BUILD_DOCS GLFW_BUILD_EXAMPLES GLFW_BUILD_INSTALL GLFW_BUILD_TESTS
295
+ GLFW_DOCUMENT_INTERNALS GLFW_INSTALL GLFW_USE_CHDIR GLFW_USE_MENUBAR
296
+ GLFW_USE_OSMESA GLFW_VULKAN_STATIC GLFW_USE_RETINA GLFW_USE_MIR
297
+ BUILD_SHARED_LIBS USE_MSVC_RUNTIME_LIBRARY_DLL
298
+ )
299
+
300
+ list(APPEND NGP_INCLUDE_DIRECTORIES "dependencies/glfw/include" "dependencies/imgui")
301
+
302
+ if (MSVC)
303
+ list(APPEND NGP_INCLUDE_DIRECTORIES "dependencies/gl3w")
304
+ list(APPEND GUI_SOURCES "dependencies/gl3w/GL/gl3w.c")
305
+ list(APPEND NGP_LIBRARIES opengl32 $<TARGET_OBJECTS:glfw_objects>)
306
+ else()
307
+ find_package(GLEW REQUIRED)
308
+ list(APPEND NGP_INCLUDE_DIRECTORIES ${GLEW_INCLUDE_DIRS})
309
+ list(APPEND NGP_LIBRARIES GL ${GLEW_LIBRARIES} $<TARGET_OBJECTS:glfw_objects>)
310
+ endif()
311
+
312
+ list(APPEND GUI_SOURCES
313
+ dependencies/imguizmo/ImGuizmo.cpp
314
+ dependencies/imgui/imgui.cpp
315
+ dependencies/imgui/backends/imgui_impl_glfw.cpp
316
+ dependencies/imgui/backends/imgui_impl_opengl3.cpp
317
+ dependencies/imgui/imgui_draw.cpp
318
+ dependencies/imgui/imgui_tables.cpp
319
+ dependencies/imgui/imgui_widgets.cpp
320
+ dependencies/imgui/misc/cpp/imgui_stdlib.cpp
321
+ )
322
+
323
+ list(APPEND NGP_DEFINITIONS -DNGP_GUI)
324
+ endif(NGP_BUILD_WITH_GUI)
325
+
326
+ list(APPEND NGP_INCLUDE_DIRECTORIES
327
+ "dependencies"
328
+ "dependencies/filesystem"
329
+ "dependencies/tinylogger"
330
+ )
331
+
332
+ find_package(OpenMP)
333
+ if (OPENMP_FOUND)
334
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
335
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
336
+ endif()
337
+
338
+ if (NGP_BUILD_WITH_PYTHON_BINDINGS)
339
+ find_package(Python 3.7 COMPONENTS Interpreter Development)
340
+ if (Python_FOUND)
341
+ add_subdirectory("dependencies/pybind11")
342
+ endif()
343
+ endif()
344
+
345
+ # Compile zlib (only on Windows)
346
+ if (WIN32)
347
+ set(ZLIB_USE_STATIC_LIBS ON CACHE BOOL " " FORCE)
348
+ set(ZLIB_BUILD_STATIC_LIBS ON CACHE BOOL " " FORCE)
349
+ set(ZLIB_BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE)
350
+ set(SKIP_INSTALL_ALL ON CACHE BOOL " " FORCE)
351
+ add_subdirectory("dependencies/zlib")
352
+ set_property(TARGET zlibstatic PROPERTY FOLDER "dependencies")
353
+
354
+ set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib" CACHE PATH " " FORCE)
355
+ set(ZLIB_LIBRARY zlibstatic)
356
+
357
+ include_directories(${ZLIB_INCLUDE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/dependencies/zlib")
358
+
359
+ list(APPEND NGP_LIBRARIES zlibstatic)
360
+ endif()
361
+
362
+ ###############################################################################
363
+ # Program
364
+ ###############################################################################
365
+
366
+ list(APPEND NGP_DEFINITIONS -DNGP_VERSION="${NGP_VERSION}")
367
+ list(APPEND NGP_INCLUDE_DIRECTORIES "include")
368
+ if (NOT MSVC)
369
+ list(APPEND NGP_LIBRARIES ${CMAKE_DL_LIBS})
370
+ endif()
371
+ list(APPEND NGP_SOURCES
372
+ ${GUI_SOURCES}
373
+ src/tiny-cuda-nn/common_host.cu
374
+ src/camera_path.cu
375
+ src/common_host.cu
376
+ src/render_buffer.cu
377
+ src/testbed.cu
378
+ src/thread_pool.cpp
379
+ )
380
+
381
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
382
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
383
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR})
384
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR})
385
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
386
+
387
+ get_filename_component(CUDA_COMPILER_BIN "${CMAKE_CUDA_COMPILER}" DIRECTORY)
388
+ get_filename_component(CUDA_DIR "${CUDA_COMPILER_BIN}" DIRECTORY)
389
+ set(CUDA_INCLUDE "${CUDA_DIR}/include")
390
+
391
+ add_library(ngp STATIC ${NGP_SOURCES})
392
+ set_target_properties(ngp PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON CUDA_SEPARABLE_COMPILATION ON)
393
+ target_compile_definitions(ngp PUBLIC ${NGP_DEFINITIONS})
394
+ target_compile_options(ngp PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:${CUDA_NVCC_FLAGS}>)
395
+ target_include_directories(ngp PUBLIC ${NGP_INCLUDE_DIRECTORIES})
396
+ target_link_directories(ngp PUBLIC ${NGP_LINK_DIRECTORIES})
397
+ target_link_libraries(ngp PUBLIC ${NGP_LIBRARIES})
398
+
399
+ # Copy shared libraries to the binary directory as needed
400
+ if (NGP_VULKAN)
401
+ set(NGX_BUILD_DIR "$<IF:$<CONFIG:Debug>,dev,rel>")
402
+ if (MSVC)
403
+ set(NGX_SHARED_LIB "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Windows_x86_64/${NGX_BUILD_DIR}/nvngx_dlss.dll")
404
+ else()
405
+ set(NGX_SHARED_LIB "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Linux_x86_64/${NGX_BUILD_DIR}/libnvidia-ngx-dlss.so.*")
406
+ endif()
407
+
408
+ add_custom_command(TARGET ngp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${NGX_SHARED_LIB}" "${CMAKE_CURRENT_BINARY_DIR}" COMMAND_EXPAND_LISTS)
409
+ endif()
410
+
411
+ if (MSVC)
412
+ file(GLOB CUDA_DLLS "${CUDA_COMPILER_BIN}/cudart64*.dll")
413
+ if (CUDA_DLLS)
414
+ add_custom_command(TARGET ngp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CUDA_DLLS} "${CMAKE_CURRENT_BINARY_DIR}" COMMAND_EXPAND_LISTS)
415
+ endif()
416
+ endif()
417
+
418
+ if (NGP_BUILD_EXECUTABLE)
419
+ add_executable(gen3c-gui src/main.cu)
420
+ target_link_libraries(gen3c-gui PRIVATE ngp)
421
+
422
+ # Link the executable to the project directory and copy over DLLs such that gen3c-gui can be invoked without going into the build folder.
423
+ set(NGP_BINARY_FILE "\"${CMAKE_CURRENT_SOURCE_DIR}/$<TARGET_FILE_NAME:gen3c-gui>\"")
424
+ if (MSVC)
425
+ add_custom_command(TARGET gen3c-gui POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gen3c-gui> ${CMAKE_CURRENT_SOURCE_DIR})
426
+ file(GLOB NGP_REQUIRED_DLLS "${CUDA_COMPILER_BIN}/cudart64*.dll")
427
+ if (NGP_VULKAN)
428
+ list(APPEND NGP_REQUIRED_DLLS "${NGX_SHARED_LIB}")
429
+ endif()
430
+ if (NGP_REQUIRED_DLLS)
431
+ add_custom_command(TARGET gen3c-gui POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${NGP_REQUIRED_DLLS} ${CMAKE_CURRENT_SOURCE_DIR} COMMAND_EXPAND_LISTS)
432
+ endif()
433
+ else()
434
+ add_custom_command(TARGET gen3c-gui POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE:gen3c-gui> "${NGP_BINARY_FILE}")
435
+
436
+ if (NGP_VULKAN)
437
+ add_custom_command(TARGET gen3c-gui POST_BUILD COMMAND "ln" -s -f "${NGX_SHARED_LIB}" "${CMAKE_CURRENT_SOURCE_DIR}/")
438
+ endif()
439
+ endif()
440
+ endif(NGP_BUILD_EXECUTABLE)
441
+
442
+ if (Python_FOUND)
443
+ add_library(pyngp SHARED src/python_api.cu)
444
+ set_target_properties(pyngp PROPERTIES CXX_VISIBILITY_PRESET "hidden" CUDA_VISIBILITY_PRESET "hidden")
445
+ target_link_libraries(pyngp PRIVATE ngp PUBLIC ${PYTHON_LIBRARIES} pybind11::module)
446
+ target_compile_definitions(pyngp PUBLIC -DNGP_PYTHON)
447
+ pybind11_extension(pyngp)
448
+ endif()
gui/dependencies/filesystem/CMakeLists.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 2.8)
2
+ project(path)
3
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
4
+ # Enable C++11 mode on GCC / Clang
5
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
6
+ endif()
7
+ add_executable(path_demo path_demo.cpp filesystem/path.h filesystem/resolver.h)
gui/dependencies/pcg32/LICENSE.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2014 Melissa O'Neill,
2
+ 2015 Wenzel Jakob
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
gui/dependencies/playne-equivalence/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2018 - Daniel Peter Playne
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
gui/requirements.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ commentjson
2
+ fastapi[standard]
3
+ httpx # Already included by fastapi
4
+ imageio
5
+ loguru
6
+ numpy
7
+ opencv-python
8
+ opencv-python-headless
9
+ pybind11
10
+ pyexr
11
+ pyquaternion
12
+ scipy
13
+ tqdm
huggingface_home/hub/version_diffusers_cache.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 1
requirements.txt ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ attrs==25.1.0
2
+ better-profanity==0.7.0
3
+ boto3==1.35.99
4
+ decord==0.6.0
5
+ diffusers==0.32.2
6
+ einops==0.8.1
7
+ huggingface-hub==0.29.2
8
+ hydra-core==1.3.2
9
+ imageio[pyav,ffmpeg]==2.37.0
10
+ iopath==0.1.10
11
+ ipdb==0.13.13
12
+ loguru==0.7.2
13
+ mediapy==1.2.2
14
+ megatron-core==0.10.0
15
+ nltk==3.9.1
16
+ numpy==1.26.4
17
+ nvidia-ml-py==12.535.133
18
+ omegaconf==2.3.0
19
+ opencv-python==4.10.0.84
20
+ pandas==2.2.3
21
+ peft==0.14.0
22
+ pillow==11.1.0
23
+ protobuf==4.25.3
24
+ pynvml==12.0.0
25
+ pyyaml==6.0.2
26
+ retinaface-py==0.0.2
27
+ safetensors==0.5.3
28
+ scikit-image==0.25.2
29
+ sentencepiece==0.2.0
30
+ setuptools==76.0.0
31
+ termcolor==2.5.0
32
+ torch==2.6.0
33
+ torchvision==0.21.0
34
+ tqdm==4.66.5
35
+ transformers==4.49.0
36
+ warp-lang==1.7.2