Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 24.04 #32624

Merged
merged 40 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
91ddd3c
noble build
maxime-desroches Jun 4, 2024
30338db
Merge branch 'master' into ubuntu_noble
maxime-desroches Jun 4, 2024
0d772bf
workflow
maxime-desroches Jun 4, 2024
7436009
merge
maxime-desroches Jun 4, 2024
b669860
symlink
maxime-desroches Jun 4, 2024
2c49f23
map only for noble
maxime-desroches Jun 4, 2024
ffcb6ee
sym
maxime-desroches Jun 4, 2024
6d767bc
add qt to cppcheck
maxime-desroches Jun 4, 2024
7a303d5
cppcheck noreturn in non void funct
maxime-desroches Jun 5, 2024
6c7f983
get kaitai header
maxime-desroches Jun 5, 2024
4f2c60e
kaitai header
maxime-desroches Jun 5, 2024
457fb47
syntax
maxime-desroches Jun 5, 2024
19f8f2d
try new pyopencl
maxime-desroches Jun 5, 2024
be1c837
try this version
maxime-desroches Jun 5, 2024
987b0dc
install lsb-core manually
maxime-desroches Jun 5, 2024
9f117a7
support old 20.04 lsb-core
maxime-desroches Jun 5, 2024
2353e6d
try arm
maxime-desroches Jun 5, 2024
47b6886
try latest pyopencl
maxime-desroches Jun 5, 2024
be6f215
revert
maxime-desroches Jun 5, 2024
a00a8c0
use pocl icd
maxime-desroches Jun 5, 2024
dc90051
no lock
maxime-desroches Jun 5, 2024
e0560e5
Merge branch 'master' into ubuntu_noble
maxime-desroches Jun 5, 2024
bd2b0ea
no arm pyopencl
maxime-desroches Jun 6, 2024
928c0ff
merge master
maxime-desroches Jun 12, 2024
f23a80a
new intel opencl runtime
maxime-desroches Jun 12, 2024
bca8a34
pin filelock
maxime-desroches Jun 12, 2024
a61e8a9
undo
maxime-desroches Jun 12, 2024
68c896f
glsl version
maxime-desroches Jun 14, 2024
f035085
merge master
maxime-desroches Jun 14, 2024
d7b5e2c
new version
maxime-desroches Jun 15, 2024
38a1e36
build test
maxime-desroches Jun 17, 2024
20f498c
remove test
maxime-desroches Jun 17, 2024
1ac4b2a
new metadrive
maxime-desroches Jun 17, 2024
9ed71a7
Merge branch 'master' into ubuntu_noble
maxime-desroches Jun 17, 2024
bbc0bae
remove glsl restrictions
maxime-desroches Jun 17, 2024
8e4b203
<optional>
maxime-desroches Jun 17, 2024
5921278
Merge branch 'master' into ubuntu_noble
maxime-desroches Jun 17, 2024
709154d
Update .github/workflows/tools_tests.yaml
maxime-desroches Jun 17, 2024
1fab853
cache
maxime-desroches Jun 17, 2024
8322906
new cache
maxime-desroches Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ghcr.io/commaai/openpilot-base:latest

RUN apt update && apt install -y vim net-tools usbutils htop ripgrep tmux wget mesa-utils xvfb libxtst6 libxv1 libglu1-mesa libegl1-mesa gdb bash-completion
RUN apt update && apt install -y vim net-tools usbutils htop ripgrep tmux wget mesa-utils xvfb libxtst6 libxv1 libglu1-mesa gdb bash-completion
RUN pip install ipython jupyter jupyterlab

RUN cd /tmp && \
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
curl -L -o virtualgl.deb "https://downloads.sourceforge.net/project/virtualgl/3.1/virtualgl_3.1_$ARCH.deb" && \
curl -L -o virtualgl.deb "https://github.com/VirtualGL/virtualgl/releases/download/3.1.1/virtualgl_3.1.1_$ARCH.deb" && \
dpkg -i virtualgl.deb

RUN usermod -aG video batman
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/setup-with-retry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Time to sleep between retries'
required: false
default: 30
build_docker:
description: 'Whether or not to build the docker image'
required: false
default: 'true'

runs:
using: "composite"
Expand All @@ -18,6 +22,7 @@ runs:
continue-on-error: true
with:
docker_hub_pat: ${{ inputs.docker_hub_pat }}
build_docker: ${{ inputs.build_docker }}
is_retried: true
- if: steps.setup1.outcome == 'failure'
shell: bash
Expand All @@ -28,6 +33,7 @@ runs:
continue-on-error: true
with:
docker_hub_pat: ${{ inputs.docker_hub_pat }}
build_docker: ${{ inputs.build_docker }}
is_retried: true
- if: steps.setup2.outcome == 'failure'
shell: bash
Expand All @@ -37,4 +43,5 @@ runs:
uses: ./.github/workflows/setup
with:
docker_hub_pat: ${{ inputs.docker_hub_pat }}
build_docker: ${{ inputs.build_docker }}
is_retried: true
7 changes: 6 additions & 1 deletion .github/workflows/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly'
required: false
default: 'false'
build_docker:
description: 'Whether or not to build the docker image'
required: false
default: 'true'

runs:
using: "composite"
Expand Down Expand Up @@ -60,4 +64,5 @@ runs:
find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \;
# build our docker image
- shell: bash
run: eval ${{ env.BUILD }}
if: ${{ inputs.build_docker == 'true' }}
run: eval ${{ env.BUILD }}
20 changes: 16 additions & 4 deletions .github/workflows/tools_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ jobs:
source selfdrive/test/setup_vsound.sh && \
CI=1 pytest tools/sim/tests/test_metadrive_bridge.py"

test_python311:
name: test python3.11 support
runs-on: ubuntu-latest
timeout-minutes: 5
test_compatibility:
name: test 20.04 + 3.11
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Installing ubuntu dependencies
run: INSTALL_EXTRA_PACKAGES=no tools/install_ubuntu_dependencies.sh
- name: Installing python
Expand All @@ -57,6 +58,17 @@ jobs:
run: pip install poetry==1.7.0
- name: Installing python dependencies
run: poetry install --no-cache --no-root
- uses: ./.github/workflows/setup-with-retry
with:
build_docker: 'false'
- name: git LFS
run: git lfs pull
- name: Get scons cache
maxime-desroches marked this conversation as resolved.
Show resolved Hide resolved
run: |
mkdir -p /tmp/scons_cache/
cp -r $GITHUB_WORKSPACE/.ci_cache/scons_cache/. /tmp/scons_cache/
- name: Building openpilot
run: poetry run scons -u -j$(nproc)
maxime-desroches marked this conversation as resolved.
Show resolved Hide resolved

devcontainer:
name: devcontainer
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ repos:
- --quiet
- --force
- -j8
- --library=qt
- --include=third_party/kaitai/kaitaistream.h
- repo: https://github.com/cpplint/cpplint
rev: 1.6.1
hooks:
Expand Down
37 changes: 21 additions & 16 deletions Dockerfile.openpilot_base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

ENV PYTHONUNBUFFERED 1

Expand All @@ -15,7 +15,7 @@ ENV LC_ALL en_US.UTF-8
COPY tools/install_ubuntu_dependencies.sh /tmp/tools/
RUN INSTALL_EXTRA_PACKAGES=no /tmp/tools/install_ubuntu_dependencies.sh && \
rm -rf /var/lib/apt/lists/* /tmp/* && \
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
cd /usr/lib/gcc/arm-none-eabi/* && \
rm -rf arm/ thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp

# Add OpenCL
Expand All @@ -30,23 +30,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc-arm-none-eabi \
tmux \
vim \
lsb-core \
libx11-6 \
wget \
&& rm -rf /var/lib/apt/lists/*

ARG INTEL_DRIVER=l_opencl_p_18.1.0.015.tgz
ARG INTEL_DRIVER_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/15532
RUN mkdir -p /tmp/opencl-driver-intel

RUN cd /tmp/opencl-driver-intel && \
echo INTEL_DRIVER is $INTEL_DRIVER && \
curl -O $INTEL_DRIVER_URL/$INTEL_DRIVER && \
tar -xzf $INTEL_DRIVER && \
for i in $(basename $INTEL_DRIVER .tgz)/rpm/*.rpm; do alien --to-deb $i; done && \
dpkg -i *.deb && \
rm -rf $INTEL_DRIVER $(basename $INTEL_DRIVER .tgz) *.deb && \
RUN mkdir -p /tmp/opencl-driver-intel && \
cd /tmp/opencl-driver-intel && \
wget https://github.com/intel/llvm/releases/download/2024-WW14/oclcpuexp-2024.17.3.0.09_rel.tar.gz && \
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/oneapi-tbb-2021.12.0-lin.tgz && \
mkdir -p /opt/intel/oclcpuexp_2024.17.3.0.09_rel && \
cd /opt/intel/oclcpuexp_2024.17.3.0.09_rel && \
tar -zxvf /tmp/opencl-driver-intel/oclcpuexp-2024.17.3.0.09_rel.tar.gz && \
mkdir -p /etc/OpenCL/vendors && \
echo /opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin/libintelocl.so > /etc/OpenCL/vendors/intel.icd && \
echo /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64/libintelocl.so > /etc/OpenCL/vendors/intel_expcpu.icd && \
cd /opt/intel && \
tar -zxvf /tmp/opencl-driver-intel/oneapi-tbb-2021.12.0-lin.tgz && \
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbb.so /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbbmalloc.so /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbb.so.12 /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbbmalloc.so.2 /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \
mkdir -p /etc/ld.so.conf.d && \
echo /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 > /etc/ld.so.conf.d/libintelopenclexp.conf && \
ldconfig -f /etc/ld.so.conf.d/libintelopenclexp.conf && \
cd / && \
rm -rf /tmp/opencl-driver-intel

Expand All @@ -57,7 +62,7 @@ ENV QTWEBENGINE_DISABLE_SANDBOX 1
RUN dbus-uuidgen > /etc/machine-id

ARG USER=batman
ARG USER_UID=1000
ARG USER_UID=1001
RUN useradd -m -s /bin/bash -u $USER_UID $USER
RUN usermod -aG sudo $USER
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
Expand Down
2 changes: 2 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ SCons.Warnings.warningAsException(True)

TICI = os.path.isfile('/TICI')
AGNOS = TICI
UBUNTU_FOCAL = int(subprocess.check_output('[ -f /etc/os-release ] && . /etc/os-release && [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ] && echo 1 || echo 0', shell=True, encoding='utf-8').rstrip())
Export('UBUNTU_FOCAL')

Decider('MD5-timestamp')

Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ flaky = "*"
inputs = "*"
lru-dict = "*"
matplotlib = "*"
metadrive-simulator = { git = "https://github.com/commaai/metadrive.git", branch = "python3.12", markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies
metadrive-simulator = { git = "https://github.com/commaai/metadrive.git", branch = "anisotropic_off", markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should make a PR to expose this. ideally we don't have to maintain a fork long term

mpld3 = "*"
myst-parser = "*"
natsort = "*"
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/navd/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations')
Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations', 'UBUNTU_FOCAL')

map_env = qt_env.Clone()
libs = ['qt_widgets', 'qt_util', 'QMapLibre', common, messaging, visionipc, transformations,
'm', 'OpenCL', 'ssl', 'crypto', 'pthread', 'json11'] + map_env["LIBS"]
if arch == 'larch64':
libs.append(':libEGL_mesa.so.0')

if arch in ['larch64', 'aarch64', 'x86_64']:
if arch in ['larch64', 'aarch64', 'x86_64'] and not UBUNTU_FOCAL:
if arch == 'x86_64':
rpath = Dir(f"#third_party/maplibre-native-qt/{arch}/lib").srcnode().abspath
map_env["RPATH"] += [rpath, ]
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/ui/SConscript
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import json
Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations')
Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations', 'UBUNTU_FOCAL')

base_libs = [common, messaging, visionipc, transformations,
'm', 'OpenCL', 'ssl', 'crypto', 'pthread'] + qt_env["LIBS"]

if arch == 'larch64':
base_libs.append('EGL')

maps = arch in ['larch64', 'aarch64', 'x86_64']
maps = arch in ['larch64', 'aarch64', 'x86_64'] and not UBUNTU_FOCAL

if arch == "Darwin":
del base_libs[base_libs.index('OpenCL')]
Expand Down
8 changes: 4 additions & 4 deletions selfdrive/ui/qt/maps/map_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ std::pair<QString, QString> map_format_distance(float d, bool is_metric) {

d = std::max(d, 0.0f);
if (is_metric) {
return (d > 500) ? std::pair{round_distance(d / 1000), QObject::tr("km")}
: std::pair{QString::number(50 * std::nearbyint(d / 50)), QObject::tr("m")};
return (d > 500) ? std::pair(round_distance(d / 1000), QObject::tr("km"))
: std::pair(QString::number(50 * std::nearbyint(d / 50)), QObject::tr("m"));
} else {
float feet = d * METER_TO_FOOT;
return (feet > 500) ? std::pair{round_distance(d * METER_TO_MILE), QObject::tr("mi")}
: std::pair{QString::number(50 * std::nearbyint(d / 50)), QObject::tr("ft")};
return (feet > 500) ? std::pair(round_distance(d * METER_TO_MILE), QObject::tr("mi"))
: std::pair(QString::number(50 * std::nearbyint(d / 50)), QObject::tr("ft"));
}
}
Git LFS file not shown
6 changes: 3 additions & 3 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## System Requirements

openpilot is developed and tested on **Ubuntu 20.04**, which is the primary development target aside from the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).
openpilot is developed and tested on **Ubuntu 24.04**, which is the primary development target aside from the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).

Running natively on any other system is not recommended and will require modifications. On Windows you can use WSL, and on macOS or incompatible Linux systems, it is recommended to use the dev containers.

## Native setup on Ubuntu 20.04
## Native setup on Ubuntu 24.04

**1. Clone openpilot**

Expand Down Expand Up @@ -55,7 +55,7 @@ GUI apps like `ui` or `cabana` can also run inside the container by leveraging X

[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Ubuntu. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience.

Follow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to setup the WSL and install the `Ubuntu-20.04` distribution. Once your Ubuntu WSL environment is setup, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.
Follow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to setup the WSL and install the `Ubuntu-24.04` distribution. Once your Ubuntu WSL environment is setup, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.

**NOTE**: If you are running WSL and any GUIs are failing (segfaulting or other strange issues) even after following the steps above, you may need to enable software rendering with `LIBGL_ALWAYS_SOFTWARE=1`, e.g. `LIBGL_ALWAYS_SOFTWARE=1 selfdrive/ui/ui`.

Expand Down
2 changes: 1 addition & 1 deletion tools/profiling/snapdragon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ snapdragon profiler


* download from https://developer.qualcomm.com/software/snapdragon-profiler/tools-archive (need a qc developer account)
* choose v2021.5 (verified working with 20.04 dev environment)
* choose v2021.5 (verified working with 24.04 dev environment)
* unzip to selfdrive/debug/profiling/snapdragon/SnapdragonProfiler
* run ```./setup-profiler.sh```
* run ```./setup-agnos.sh```
Expand Down
2 changes: 1 addition & 1 deletion tools/webcam/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Run openpilot with webcam on PC

What's needed:
- Ubuntu 20.04
- Ubuntu 24.04
- GPU (recommended)
- Two USB webcams, at least 720p and 78 degrees FOV (e.g. Logitech C920/C615)
- [Car harness](https://comma.ai/shop/products/comma-car-harness) with black panda to connect to your car
Expand Down
Loading