2024-06-18 11:30:32 +08:00
|
|
|
FROM ubuntu:24.04
|
2022-01-03 06:47:16 +08:00
|
|
|
|
2020-01-18 02:22:00 +08:00
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
|
2020-10-30 07:51:09 +08:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2022-01-03 06:47:16 +08:00
|
|
|
RUN apt-get update && \
|
2024-01-26 08:49:38 +08:00
|
|
|
apt-get install -y --no-install-recommends sudo tzdata locales ssh pulseaudio xvfb x11-xserver-utils gnome-screenshot && \
|
2022-01-03 06:47:16 +08:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2020-01-18 02:22:00 +08:00
|
|
|
|
|
|
|
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
|
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LANGUAGE en_US:en
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
|
2023-08-31 04:48:44 +08:00
|
|
|
COPY tools/install_ubuntu_dependencies.sh /tmp/tools/
|
2024-08-28 10:22:09 +08:00
|
|
|
RUN /tmp/tools/install_ubuntu_dependencies.sh && \
|
2024-05-21 08:35:33 +08:00
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* && \
|
2024-06-18 11:30:32 +08:00
|
|
|
cd /usr/lib/gcc/arm-none-eabi/* && \
|
2024-05-21 08:35:33 +08:00
|
|
|
rm -rf arm/ thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
|
2023-08-31 04:48:44 +08:00
|
|
|
|
2024-02-07 09:11:00 +08:00
|
|
|
# Add OpenCL
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
apt-utils \
|
|
|
|
alien \
|
|
|
|
unzip \
|
|
|
|
tar \
|
|
|
|
curl \
|
|
|
|
xz-utils \
|
|
|
|
dbus \
|
|
|
|
gcc-arm-none-eabi \
|
|
|
|
tmux \
|
|
|
|
vim \
|
|
|
|
libx11-6 \
|
2024-06-18 11:30:32 +08:00
|
|
|
wget \
|
2024-02-07 09:11:00 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2024-06-18 11:30:32 +08:00
|
|
|
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 && \
|
2024-02-07 09:11:00 +08:00
|
|
|
mkdir -p /etc/OpenCL/vendors && \
|
2024-06-18 11:30:32 +08:00
|
|
|
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 && \
|
2024-02-07 09:11:00 +08:00
|
|
|
cd / && \
|
|
|
|
rm -rf /tmp/opencl-driver-intel
|
|
|
|
|
|
|
|
ENV NVIDIA_VISIBLE_DEVICES all
|
|
|
|
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
|
|
|
|
ENV QTWEBENGINE_DISABLE_SANDBOX 1
|
|
|
|
|
|
|
|
RUN dbus-uuidgen > /etc/machine-id
|
|
|
|
|
2023-09-26 01:36:54 +08:00
|
|
|
ARG USER=batman
|
2024-06-18 11:30:32 +08:00
|
|
|
ARG USER_UID=1001
|
2023-09-26 01:36:54 +08:00
|
|
|
RUN useradd -m -s /bin/bash -u $USER_UID $USER
|
2023-10-06 06:53:07 +08:00
|
|
|
RUN usermod -aG sudo $USER
|
|
|
|
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
2023-09-26 01:36:54 +08:00
|
|
|
USER $USER
|
|
|
|
|
2024-06-28 08:04:05 +08:00
|
|
|
COPY --chown=$USER pyproject.toml uv.lock /tmp/
|
2023-09-26 01:36:54 +08:00
|
|
|
COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/
|
2023-08-31 04:48:44 +08:00
|
|
|
|
2024-06-28 08:04:05 +08:00
|
|
|
ENV VIRTUAL_ENV=/home/$USER/.venv
|
2024-06-20 00:55:23 +08:00
|
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
2024-06-28 08:04:05 +08:00
|
|
|
RUN cd /tmp && \
|
2023-08-31 04:48:44 +08:00
|
|
|
tools/install_python_dependencies.sh && \
|
2024-06-28 08:04:05 +08:00
|
|
|
mkdir -p $VIRTUAL_ENV && \
|
|
|
|
cp -r /tmp/.venv/* $VIRTUAL_ENV && \
|
2022-01-11 03:43:18 +08:00
|
|
|
rm -rf /tmp/* && \
|
2024-06-20 00:55:23 +08:00
|
|
|
rm -rf /home/$USER/.cache
|
2022-04-20 20:23:27 +08:00
|
|
|
|
2023-09-26 01:36:54 +08:00
|
|
|
USER root
|
2024-05-21 08:35:33 +08:00
|
|
|
RUN sudo git config --global --add safe.directory /tmp/openpilot
|