Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# syntax=docker/dockerfile:1

FROM rocm/dev-ubuntu-24.04:6.4 AS base

FROM base AS devcontainer
FROM rocm/dev-ubuntu-24.04:7.1

ARG USERNAME=vscode
ARG USER_UID=1001
Expand All @@ -14,8 +12,7 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

RUN apt-get update \
&& apt-get install -y git python3-dev python-is-python3 python3-venv \
&& pip install --break-system-packages pre-commit black ruff
&& apt-get install -y git python3-dev python-is-python3 python3-venv pre-commit black

USER $USERNAME

Expand Down
30 changes: 27 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,34 @@
"build": {
"dockerfile": "Dockerfile"
},

"runArgs": [ "--device=/dev/kfd", "--device=/dev/dri", "--group-add=video", "--network=host", "--ipc=host" ],
// sometimes the render group id on the host does not match the container.
// To fix that get the group id with: `cat /etc/group | grep render` and replace render with the gid.
// Alternatively you can also access the GPU using the root user / sudo.
"runArgs": [ "--device=/dev/kfd", "--device=/dev/dri", "--group-add=video", "--group-add=render", "--network=host", "--ipc=host" ],
"capAdd": ["SYS_PTRACE"],
"securityOpt": ["seccomp=unconfined"],
"containerUser": "vscode",
"mounts": [
"source=${localWorkspaceFolderBasename}-venv,target=${containerWorkspaceFolder}/.venv,type=volume"
],

"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"ms-python.debugpy",
"ms-python.vscode-python-envs",
"llvm-vs-code-extensions.vscode-mlir"
],
"settings": {
"python.terminal.activateEnvInCurrentTerminal": true,
"python.defaultInterpreterPath": ".venv/bin/python"
}
}
},

"postCreateCommand": "pre-commit install && pre-commit install --hook-type commit-msg"
"postCreateCommand": "sudo chown vscode .venv && pre-commit install && pre-commit install --hook-type commit-msg && python -m venv .venv --prompt wave && . ${containerWorkspaceFolder}/.venv/bin/activate && pip install --upgrade pip && pip install -r requirements-iree-pinned.txt && pip install -r pytorch-rocm-requirements.txt && pip install -r requirements.txt -e ."
}