|
| 1 | +# cuCollections Dev Containers |
| 2 | + |
| 3 | +This directory contains Dev Container configurations for cuCollections development with different compiler and CUDA combinations. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | +- [Visual Studio Code](https://code.visualstudio.com/) |
| 9 | +- [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) |
| 10 | +- [Docker](https://docs.docker.com/engine/install/) |
| 11 | +- [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) (for GPU support) |
| 12 | + |
| 13 | +## Available Configurations |
| 14 | + |
| 15 | +### 🔥 Clang 16 + CUDA 12.8 (Recommended for modern C++) |
| 16 | +```bash |
| 17 | +.devcontainer/launch.sh -c 12.8 -H llvm16 |
| 18 | +``` |
| 19 | +- **Container**: `rapidsai/devcontainers:25.08-cpp-llvm16-cuda12.8-ubuntu22.04` |
| 20 | +- **Features**: ClangD IntelliSense, modern C++17/20 support, better diagnostics |
| 21 | +- **Use Case**: Development with latest Clang features and standards |
| 22 | + |
| 23 | +### 🛠️ GCC 13 + CUDA 12.8 (Default) |
| 24 | +```bash |
| 25 | +.devcontainer/launch.sh -c 12.8 -H gcc13 |
| 26 | +# or just |
| 27 | +.devcontainer/launch.sh |
| 28 | +``` |
| 29 | +- **Container**: `rapidsai/devcontainers:25.08-cpp-gcc13-cuda12.8-ubuntu22.04` |
| 30 | +- **Features**: Stable GCC compiler, broad compatibility |
| 31 | +- **Use Case**: Standard development, CI compatibility testing |
| 32 | + |
| 33 | +## Launch Methods |
| 34 | + |
| 35 | +### 1. 🚀 VSCode Integration (Recommended) |
| 36 | +Launch VSCode with the devcontainer: |
| 37 | +```bash |
| 38 | +# Clang 16 development |
| 39 | +.devcontainer/launch.sh -c 12.8 -H llvm16 |
| 40 | + |
| 41 | +# GCC 13 development (default) |
| 42 | +.devcontainer/launch.sh -c 12.8 -H gcc13 |
| 43 | +``` |
| 44 | + |
| 45 | +This will: |
| 46 | +- Open VSCode with the selected devcontainer |
| 47 | +- Mount your workspace with persistent storage |
| 48 | +- Configure IntelliSense and debugging |
| 49 | +- Set up build tools and extensions |
| 50 | + |
| 51 | +### 2. 🐳 Direct Docker (Advanced) |
| 52 | +Launch container directly without VSCode: |
| 53 | +```bash |
| 54 | +# Clang 16 in terminal |
| 55 | +.devcontainer/launch.sh -c 12.8 -H llvm16 -d |
| 56 | + |
| 57 | +# With GPU support |
| 58 | +.devcontainer/launch.sh -c 12.8 -H llvm16 -d --gpus all |
| 59 | +``` |
| 60 | + |
| 61 | +## Development Workflow |
| 62 | + |
| 63 | +### Building with Clang 16 |
| 64 | +```bash |
| 65 | +# Inside the devcontainer |
| 66 | +./ci/build.sh --cxx clang++ --std 17 --arch 70 |
| 67 | + |
| 68 | +# Or using environment variables (already set in Clang container) |
| 69 | +cmake -B build -S . -DCMAKE_CXX_COMPILER=clang++ |
| 70 | +cmake --build build -j$(nproc) |
| 71 | +``` |
| 72 | + |
| 73 | +### Running Tests |
| 74 | +```bash |
| 75 | +# Run all tests |
| 76 | +./ci/test.sh --tests --cxx clang++ |
| 77 | + |
| 78 | +# Run specific test |
| 79 | +cd build && ctest -R static_map_test |
| 80 | +``` |
| 81 | + |
| 82 | +## VS Code Features |
| 83 | + |
| 84 | +### Clang 16 Container Includes: |
| 85 | +- **ClangD**: Advanced C++ language server with: |
| 86 | + - Real-time error detection |
| 87 | + - Code completion |
| 88 | + - Go-to-definition |
| 89 | + - Refactoring tools |
| 90 | +- **Clang-Format**: Automatic code formatting |
| 91 | +- **NVIDIA Nsight**: GPU debugging and profiling |
| 92 | +- **CMake Tools**: Build system integration |
| 93 | + |
| 94 | +### Available Extensions: |
| 95 | +- `llvm-vs-code-extensions.vscode-clangd` |
| 96 | +- `seaube.clangformat` |
| 97 | +- `nvidia.nsight-vscode-edition` |
| 98 | +- `ms-vscode.cmake-tools` |
| 99 | + |
| 100 | +## Persistent Storage |
| 101 | + |
| 102 | +The devcontainers use Docker volumes for persistent storage: |
| 103 | +- **Build artifacts**: Preserved across container restarts |
| 104 | +- **Cache**: Shared compilation cache for faster builds |
| 105 | +- **Configuration**: VS Code settings and extensions |
| 106 | + |
| 107 | +## Environment Variables |
| 108 | + |
| 109 | +### Clang 16 Container |
| 110 | +```bash |
| 111 | +CUCO_CUDA_VERSION=12.8 |
| 112 | +CUCO_HOST_COMPILER=llvm |
| 113 | +CUCO_HOST_COMPILER_VERSION=16 |
| 114 | +CXX=clang++ |
| 115 | +CUDAHOSTCXX=clang++ |
| 116 | +``` |
| 117 | + |
| 118 | +### GCC 13 Container |
| 119 | +```bash |
| 120 | +CUCO_CUDA_VERSION=12.8 |
| 121 | +CUCO_HOST_COMPILER=gcc |
| 122 | +CUCO_HOST_COMPILER_VERSION=13 |
| 123 | +CXX=g++ |
| 124 | +CUDAHOSTCXX=g++ |
| 125 | +``` |
| 126 | + |
| 127 | +## Troubleshooting |
| 128 | + |
| 129 | +### Container Issues |
| 130 | +```bash |
| 131 | +# List available configurations |
| 132 | +find .devcontainer -name "devcontainer.json" -type f |
| 133 | + |
| 134 | +# Check Docker images |
| 135 | +docker images | grep rapidsai |
| 136 | + |
| 137 | +# Clean up containers |
| 138 | +docker container prune |
| 139 | +``` |
| 140 | + |
| 141 | +### VS Code Issues |
| 142 | +1. **Container not starting**: Check Docker daemon is running |
| 143 | +2. **Extensions not loading**: Rebuild container (`Ctrl+Shift+P` → "Rebuild Container") |
| 144 | +3. **IntelliSense not working**: Ensure `compile_commands.json` exists in build directory |
| 145 | + |
| 146 | +### Build Issues |
| 147 | +```bash |
| 148 | +# Clean build |
| 149 | +rm -rf build && ./ci/build.sh --cxx clang++ |
| 150 | + |
| 151 | +# Check compiler version |
| 152 | +clang++ --version |
| 153 | +nvcc --version |
| 154 | +``` |
| 155 | + |
| 156 | +## Comparison with CCCL |
| 157 | + |
| 158 | +cuCollections devcontainers are inspired by CCCL's approach but simplified: |
| 159 | + |
| 160 | +| Feature | CCCL | cuCollections | |
| 161 | +|---------|------|---------------| |
| 162 | +| **Compiler Support** | GCC 7-13, Clang 14-19 | GCC 13, Clang 16 | |
| 163 | +| **CUDA Versions** | 12.0, 12.9 | 12.8 | |
| 164 | +| **Launch Script** | Full feature set | Simplified, focused | |
| 165 | +| **Container Variants** | 25+ configurations | 2 main configurations | |
| 166 | + |
| 167 | +## Contributing |
| 168 | + |
| 169 | +When adding new devcontainer configurations: |
| 170 | +1. Follow the naming pattern: `cuda{VERSION}-{COMPILER}{VERSION}` |
| 171 | +2. Base configuration on existing containers |
| 172 | +3. Update this README with the new configuration |
| 173 | +4. Test the configuration works with `launch.sh` |
| 174 | + |
| 175 | +## Examples |
| 176 | + |
| 177 | +### Start Clang 16 Development Session |
| 178 | +```bash |
| 179 | +# Launch VSCode with Clang 16 |
| 180 | +.devcontainer/launch.sh -c 12.8 -H llvm16 |
| 181 | + |
| 182 | +# Build and test |
| 183 | +./ci/build.sh --cxx clang++ --std 17 --arch 70 |
| 184 | +./ci/test.sh --tests --cxx clang++ |
| 185 | +``` |
| 186 | + |
| 187 | +### Quick Testing with Docker |
| 188 | +```bash |
| 189 | +# Test build in container directly |
| 190 | +.devcontainer/launch.sh -c 12.8 -H llvm16 -d --gpus all |
| 191 | + |
| 192 | +# Inside container |
| 193 | +./ci/build.sh --cxx clang++ && ./ci/test.sh --tests --cxx clang++ |
| 194 | +``` |
0 commit comments