Skip to content

Commit e86fcb3

Browse files
authored
Update min OS to Ubuntu 20.04 (#6902)
* Update min OS to Ubuntu 20.04 * Switch latest Ubuntu from noble to jammy: No CUDNN docker image for noble. * Update CUDA version selection, add support for Hopper * Remove CPU rendering support for Ubuntu 18.04 (old mesa SW) * Autodetect CUDA version to install the correct PyTorch in CI * CUDA latest 11.8 to support PyTorch 2.0 Fix CUDAARCHS in Windows CI, since no GPU present. ARM Linux: Fix for "cannot allocate memory in TLS blc * Fix for CUDA ARCH case with no GPU * new docker version fix * remove docker docs for Ubutu 18.04
1 parent 8f5d3b4 commit e86fcb3

19 files changed

Lines changed: 156 additions & 368 deletions

.github/workflows/ubuntu-cuda.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
include:
57-
- CI_CONFIG: 2-bionic
58-
- CI_CONFIG: 3-ml-shared-bionic
59-
- CI_CONFIG: 4-shared-bionic
60-
- CI_CONFIG: 5-ml-focal
57+
- CI_CONFIG: 2-focal
58+
- CI_CONFIG: 3-ml-shared-focal
59+
- CI_CONFIG: 4-shared-focal
60+
- CI_CONFIG: 5-ml-jammy
6161
env:
6262
# Export everything from matrix to be easily used.
6363
# Docker tag and ccache names must be consistent with docker_build.sh
6464
CI_CONFIG : ${{ matrix.CI_CONFIG }}
65-
BUILD_PACKAGE : ${{ contains(fromJson('["3-ml-shared-bionic", "4-shared-bionic"]'), matrix.CI_CONFIG) }}
65+
BUILD_PACKAGE : ${{ contains(fromJson('["3-ml-shared-focal", "4-shared-focal"]'), matrix.CI_CONFIG) }}
6666
GCE_INSTANCE_PREFIX: open3d-ci-${{ matrix.CI_CONFIG }}
6767
DOCKER_TAG : open3d-ci:${{ matrix.CI_CONFIG }}
6868
CCACHE_TAR_NAME : open3d-ci-${{ matrix.CI_CONFIG }}

.github/workflows/ubuntu-wheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
env:
4747
DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }}
4848
PYTHON_VERSION: ${{ matrix.python_version }}
49-
CCACHE_TAR_NAME: open3d-ubuntu-1804-cuda-ci-ccache
49+
CCACHE_TAR_NAME: open3d-ubuntu-2004-cuda-ci-ccache
5050
OPEN3D_CPU_RENDERING: true
5151
steps:
5252
- name: Checkout source code

.github/workflows/vtk_packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
contents: write
1313
# TODO: Convert to docker
14-
runs-on: ubuntu-18.04
14+
runs-on: ubuntu-20.04
1515
steps:
1616
- name: Checkout source code
1717
uses: actions/checkout@v4

.github/workflows/webrtc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
os: [ubuntu-18.04, macos-11]
33+
os: [ubuntu-20.04, macos-12]
3434
GLIBCXX_USE_CXX11_ABI: [0, 1]
3535
exclude:
36-
- os: macos-11
36+
- os: macos-12
3737
GLIBCXX_USE_CXX11_ABI: 0
3838
env:
3939
GLIBCXX_USE_CXX11_ABI: ${{ matrix.GLIBCXX_USE_CXX11_ABI }}
@@ -48,7 +48,7 @@ jobs:
4848
python-version: 3.8
4949

5050
- name: Install dependencies
51-
if: ${{ matrix.os == 'ubuntu-18.04' }}
51+
if: ${{ matrix.os == 'ubuntu-20.04' }}
5252
run: |
5353
source 3rdparty/webrtc/webrtc_build.sh
5454
install_dependencies_ubuntu

3rdparty/curl/curl.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ else()
6565
# Optimize for Ubuntu x86. Curl can take a long time to configure.
6666
#
6767
# To generate pre-compiled curl:
68-
# 1. Use Ubuntu 18.04 (eg. in docker), not 20.04+.
68+
# 1. Use oldest supported Ubuntu (eg. in docker), not the latest.
6969
# 2. -DBUILD_CURL_FROM_SOURCE=ON, build Open3D: make ext_curl
7070
# 3. cd build/curl
7171
# 4. tar -czvf curl_7.88.0_linux_x86_64.tar.gz include lib

3rdparty/find_dependencies.cmake

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,24 +1405,6 @@ else()
14051405
endif()
14061406
list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_SYSTEM Open3D::3rdparty_opengl)
14071407

1408-
# CPU Rendering
1409-
if(BUILD_GUI AND UNIX AND NOT APPLE)
1410-
include(FetchContent)
1411-
FetchContent_Declare(
1412-
download_mesa_libgl
1413-
PREFIX mesa
1414-
URL https://github.com/isl-org/open3d_downloads/releases/download/mesa-libgl/mesa_libGL_22.1.4.tar.bz2
1415-
URL_HASH SHA256=5732bfb70e8fcc747018820bc8fd31cd1867ebae5aa09baf65482b42c134d45a
1416-
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mesa"
1417-
)
1418-
FetchContent_MakeAvailable(download_mesa_libgl)
1419-
1420-
set(MESA_CPU_GL_LIBRARY "${download_mesa_libgl_SOURCE_DIR}/libGL.so.1.2.0" "${download_mesa_libgl_SOURCE_DIR}/libEGL.so.1.0.0"
1421-
"${download_mesa_libgl_SOURCE_DIR}/libgallium_dri.so" "${download_mesa_libgl_SOURCE_DIR}/kms_swrast_dri.so"
1422-
"${download_mesa_libgl_SOURCE_DIR}/swrast_dri.so")
1423-
message(STATUS "MESA_CPU_GL_LIBRARY: ${MESA_CPU_GL_LIBRARY}")
1424-
endif()
1425-
14261408
# RPC interface
14271409
# zeromq
14281410
if(USE_SYSTEM_ZEROMQ)

3rdparty/mesa/build-mesa-cpu.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.

3rdparty/webrtc/Dockerfile.webrtc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# - docker run --rm --entrypoint cat open3d-webrtc:abi1 \
1414
# webrtc_60e6748_cxx-abi-1.tar.gz > webrtc_60e6748_cxx-abi-1.tar.gz
1515

16-
FROM ubuntu:18.04
16+
FROM ubuntu:20.04
1717

1818
ARG SUDO=command
1919
COPY 3rdparty/webrtc 3rdparty/webrtc

CMakeLists.txt

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
cmake_minimum_required(VERSION 3.22)
2-
# If you're using Ubuntu 18.04, we suggest you install the latest CMake from the
1+
cmake_minimum_required(VERSION 3.24)
2+
# If you're using Ubuntu 20.04, we suggest you install the latest CMake from the
33
# official repository https://apt.kitware.com/.
4+
# CMake 3.24+ is required for CUDA native arch selection
45
# CMake 3.22+ is required by Assimp v5.4.2
56
# CMake 3.20+ is required to detect IntelLLVM compiler for SYCL
67

@@ -401,17 +402,44 @@ cmake_language(EVAL CODE "cmake_language(DEFER CALL open3d_patch_findthreads_mod
401402

402403
# Build CUDA module by default if CUDA is available
403404
if(BUILD_CUDA_MODULE)
404-
include(Open3DMakeCudaArchitectures)
405-
open3d_make_cuda_architectures(CUDA_ARCHS)
406-
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCHS})
407-
408-
message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
405+
if(BUILD_COMMON_CUDA_ARCHS)
406+
if (CMAKE_CUDA_ARCHITECTURES)
407+
message(STATUS "Building with user-provided architectures: ${CMAKE_CUDA_ARCHITECTURES}")
408+
else()
409+
# Build with all supported architectures for previous 2 generations and
410+
# M0 (minor=0) architectures for previous generations (including
411+
# deprecated). Note that cubin for M0 runs on GPUs with architecture Mx.
412+
# This is a tradeoff between binary size / build time and runtime on
413+
# older architectures. See:
414+
# https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#building-for-maximum-compatibility
415+
# https://docs.nvidia.com/cuda/ampere-compatibility-guide/index.html#application-compatibility-on-ampere
416+
# https://en.wikipedia.org/wiki/CUDA#GPUs_supported
417+
find_package(CUDAToolkit REQUIRED)
418+
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.8")
419+
set(CMAKE_CUDA_ARCHITECTURES 75-real 80-real 86-real 89-real 90) # Turing, Ampere, Ada Lovelace, Hopper
420+
elseif(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.1")
421+
set(CMAKE_CUDA_ARCHITECTURES 70-real 75-real 80-real 86) # Volta, Turing, Ampere
422+
elseif(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.0")
423+
set(CMAKE_CUDA_ARCHITECTURES 60-real 70-real 72-real 75-real 80) # Pascal, Volta, Turing, Ampere
424+
else()
425+
set(CMAKE_CUDA_ARCHITECTURES 30-real 50-real 60-real 70-real 75) # Kepler, Maxwell, Pascal, Turing
426+
endif()
427+
message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
428+
endif()
429+
else()
430+
execute_process(COMMAND nvidia-smi RESULT_VARIABLE NVIDIA_CHECK OUTPUT_QUIET)
431+
if (NVIDIA_CHECK EQUAL 0)
432+
message(STATUS "Building with native CUDA architecture.")
433+
set(CMAKE_CUDA_ARCHITECTURES native)
434+
else()
435+
message(WARNING "No CUDA GPU detected. Building with CMake default CUDA architecture.")
436+
endif()
437+
endif()
409438
enable_language(CUDA)
410-
411439
if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "10.1")
412440
message(FATAL_ERROR "CUDA 10.0 and older are not supported. Please upgrade to CUDA 10.1 or newer.")
413441
endif()
414-
endif ()
442+
endif()
415443

416444
# ISPC language emulation support
417445
include(Open3DISPC)
@@ -488,6 +516,12 @@ macro(add_source_group module_name)
488516
source_group("Source Files\\Material" FILES ${MODULE_MATERIAL_FILES})
489517
endmacro()
490518

519+
if (LINUX_AARCH64)
520+
# Fix for ImportError: ... /pybind.cpython-310-aarch64-linux-gnu.so: cannot allocate memory in static TLS block
521+
# https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1889851
522+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftls-model=global-dynamic")
523+
endif()
524+
491525
# Include convenience functions
492526
include(Open3DLink3rdpartyLibraries)
493527
include(Open3DSetGlobalProperties)

cmake/Open3DMakeCudaArchitectures.cmake

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)