Files
pytorch/.devcontainer/Dockerfile
Wouter Devriendt 1f4f4a61c2 Devcontainer: Replace conda with apt-based setup (#152881)
## Summary
- Replaced miniconda base image with base Ubuntu 22.04 image
- Installed Python and required dependencies using apt
- Replaced conda-based CUDA installation with apt-based version
- Updated paths in install-dev-tools.sh to reflect the new non-conda environment
- Removed conda-specific files and added requirements.txt for Python dependencies

## Test plan
Test by building and running the devcontainer in VS Code with both CPU and CUDA configurations
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152881
Approved by: https://github.com/atalman
2025-05-06 19:23:58 +00:00

53 lines
1.4 KiB
Docker

FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04
# Tools needed for development
RUN apt-get -y update && \
apt-get install -y \
build-essential \
cmake \
ninja-build \
git \
python3 \
python3-pip \
python3-dev \
python3-venv \
libopenblas-dev
# Tools needed for llvm
RUN apt-get install -y \
lsb-release \
wget \
software-properties-common \
gnupg
# Create Python virtual environment
# RUN python3 -m venv /opt/venv
# ENV PATH="/opt/venv/bin:$PATH"
RUN pip3 install --upgrade pip
# Install CLANG if version is specified
ARG CLANG_VERSION
RUN if [ -n "$CLANG_VERSION" ]; then \
wget https://apt.llvm.org/llvm.sh; \
chmod +x llvm.sh; \
./llvm.sh "${CLANG_VERSION}"; \
echo 'export CC=clang' >> ~/.bashrc; \
echo 'export CXX=clang++' >> ~/.bashrc; \
apt install -y clang libomp-dev; \
fi
# Install CUDA if version is specified
ARG CUDA_VERSION
RUN if [ -n "$CUDA_VERSION" ]; then \
CUDA_REPO_VERSION=$(echo ${CUDA_VERSION} | sed 's/\./\-/g'); \
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb && \
dpkg -i cuda-keyring_1.0-1_all.deb && \
apt-get install -y cuda-toolkit-${CUDA_VERSION}; \
fi
# Set PATH for CUDA
ENV PATH="/usr/local/cuda/bin:${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
ENV PIP_BREAK_SYSTEM_PACKAGES=1