diff --git a/.devcontainer/cuda-tf/devcontainer.json b/.devcontainer/cuda-tf/devcontainer.json new file mode 100644 index 0000000..21f229c --- /dev/null +++ b/.devcontainer/cuda-tf/devcontainer.json @@ -0,0 +1,70 @@ +{ + "name": "cuda-tf", + "image": "mcr.microsoft.com/devcontainers/python:3.11", + // "hostRequirements": { + // "gpu": "optional" + // }, + "runArgs": [ + "--gpus=all" + ], + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/usr/local/cuda/bin", + "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64", + "XLA_FLAGS": "--xla_gpu_cuda_data_dir=/usr/local/cuda" + }, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/python:1": {}, + // "ghcr.io/devcontainers/features/node:1": "none", + "ghcr.io/devcontainers/features/git:1": { + "version": "latest", + "ppa": true + }, + "ghcr.io/devcontainers/features/nvidia-cuda:1": { + "installCudnn": true, + "cudaVersion": "11.8", + "cudnnVersion": "8.6.0.163", + "installToolkit": true + }, + "ghcr.io/iterative/features/nvtop:1": {} + }, + "updateContentCommand": "bash .devcontainer/cuda-tf/setup.sh", + "postCreateCommand": [ + "nvidia-smi" + ], + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/cuda-tf/setup.sh b/.devcontainer/cuda-tf/setup.sh new file mode 100644 index 0000000..5d51adc --- /dev/null +++ b/.devcontainer/cuda-tf/setup.sh @@ -0,0 +1,5 @@ +# install Python packages in virtual environment +# python3.11 -m venv .venv-3.11 +# source .venv-3.11/bin/activate +python -m pip install --upgrade pip +pip install -e .[dev]