Skip to content

Commit 885a1fa

Browse files
committed
Updates
1 parent 14cf28e commit 885a1fa

File tree

4 files changed

+452
-84
lines changed

4 files changed

+452
-84
lines changed

.devcontainer/README.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
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+
```
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"shutdownAction": "stopContainer",
3+
"image": "rapidsai/devcontainers:25.08-cpp-llvm16-cuda12.8-ubuntu22.04",
4+
"hostRequirements": {
5+
"gpu": "optional"
6+
},
7+
"initializeCommand": [
8+
"/bin/bash",
9+
"-c",
10+
"mkdir -m 0755 -p ${localWorkspaceFolder}/.{aws,cache,config}; mkdir -m 0755 -p ${localWorkspaceFolder}/build; if test -z ${localEnv:WSLENV}; then docker volume create --driver local --opt type=none --opt device=${localWorkspaceFolder}/build --opt o=bind cuco-build; else docker volume create cuco-build; fi;"
11+
],
12+
"postAttachCommand": [
13+
"/bin/bash",
14+
"-c",
15+
"if [ ${CODESPACES:-false} = 'true' ]; then echo 'GitHub Codespaces detected'; fi"
16+
],
17+
"containerEnv": {
18+
"SCCACHE_REGION": "us-east-2",
19+
"SCCACHE_BUCKET": "rapids-sccache-devs",
20+
"AWS_ROLE_ARN": "arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs",
21+
"HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history",
22+
"DEVCONTAINER_NAME": "cuda12.8-llvm16",
23+
"CUCO_CUDA_VERSION": "12.8",
24+
"CUCO_HOST_COMPILER": "llvm",
25+
"CUCO_HOST_COMPILER_VERSION": "16",
26+
"CUCO_BUILD_INFIX": "cuda12.8-llvm16",
27+
"HOST_WORKSPACE": "${localWorkspaceFolder}",
28+
"CXX": "clang++",
29+
"CUDAHOSTCXX": "clang++"
30+
},
31+
"workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}",
32+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent",
33+
"mounts": [
34+
"source=${localWorkspaceFolder}/.aws,target=/home/coder/.aws,type=bind,consistency=consistent",
35+
"source=${localWorkspaceFolder}/.cache,target=/home/coder/.cache,type=bind,consistency=consistent",
36+
"source=${localWorkspaceFolder}/.config,target=/home/coder/.config,type=bind,consistency=consistent",
37+
"source=cuco-build,target=/home/coder/cuCollections/build"
38+
],
39+
"customizations": {
40+
"vscode": {
41+
"extensions": [
42+
"llvm-vs-code-extensions.vscode-clangd",
43+
"seaube.clangformat",
44+
"nvidia.nsight-vscode-edition",
45+
"ms-vscode.cmake-tools"
46+
],
47+
"settings": {
48+
"editor.defaultFormatter": "seaube.clangformat",
49+
"editor.formatOnSave": true,
50+
"clang-format.executable": "/usr/bin/clang-format",
51+
"clangd.arguments": [
52+
"--compile-commands-dir=${workspaceFolder}/build/latest",
53+
"--background-index",
54+
"--clang-tidy"
55+
],
56+
"cmake.generator": "Ninja",
57+
"cmake.defaultVariants": {
58+
"cmake.configureSettings": {
59+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
60+
}
61+
}
62+
}
63+
}
64+
},
65+
"name": "cuCollections - CUDA 12.8 Clang 16"
66+
}

0 commit comments

Comments
 (0)