Skip to content

Commit 4786083

Browse files
committed
feat: Add .devcontainer.json
Includes a `.devcontainer.json` in the project root to allow users to start a development container in supported supported tools. Updated README.md to include how to make customizations. In vscode at least, the presesne of both `.devcontainer.json` and `.devcontainer/devcontainer.json` brings up a selection menu to choose which to use.
1 parent d9578ae commit 4786083

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

.devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"image" : "ghcr.io/rust-gpu/rust-cuda-ubuntu24-cuda12:latest",
3+
// Uncoment the following lines to use a Dockerfile instead of a prebuilt image.
4+
// "build": {
5+
// "dockerfile": "${localWorkspaceFolder}/container/ubuntu24-cuda12/Dockerfile",
6+
// "context": "${localWorkspaceFolder}"
7+
// },
8+
"containerEnv": {
9+
"NVIDIA_DRIVER_CAPABILITIES": "all"
10+
},
11+
"runArgs": ["--runtime=nvidia", "--gpus", "all"],
12+
"customizations": {
13+
"vscode": {
14+
"extensions": ["rust-lang.rust-analyzer"]
15+
}
16+
},
17+
"features": {
18+
"ghcr.io/devcontainers/features/git:1": {}
19+
}
20+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ book
22
/target
33
Cargo.lock
44
**/.vscode
5+
.devcontainer

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h1>The Rust CUDA Project</h1>
33

44
<p>
5-
<strong>An ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in
5+
<strong>An ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in
66
<a href="https://www.rust-lang.org/">Rust</a></strong>
77
</p>
88

@@ -13,7 +13,7 @@
1313
<span> | </span>
1414
<a href="guide/src/features.md">Features</a>
1515
</h3>
16-
<strong>⚠️ The project is still in early development, expect bugs, safety issues, and things that don't work ⚠️</strong>
16+
<strong>⚠️ The project is still in early development, expect bugs, safety issues, and things that don't work ⚠️</strong>
1717
</div>
1818

1919
<br/>
@@ -94,13 +94,15 @@ cargo build
9494

9595
## Use Rust-CUDA in Container Environments
9696

97+
The distribution related Dockerfile are located in `container` folder.
98+
Taking ubuntu 24.04 as an example, run the following command in repository root:
9799
```bash
98-
# The distribution related Dockerfile are located in `container` folder.
99-
# Taking ubuntu 24.04 as an example, run the following command in repository root:
100100
docker build -f ./container/ubuntu24/Dockerfile -t rust-cuda-ubuntu24 .
101101
docker run --rm --runtime=nvidia --gpus all -it rust-cuda-ubuntu24
102102
```
103103

104+
A sample `.devcontainer.json` file is also included, configured for Ubuntu 24.02. Copy this to `.devcontainer/devcontainer.json` to make additonal customizations.
105+
104106
## License
105107

106108
Licensed under either of

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
channel = "nightly-2025-03-02"
3-
components = ["clippy", "llvm-tools-preview", "rust-src", "rustc-dev", "rustfmt"]
3+
components = ["clippy", "llvm-tools-preview", "rust-src", "rustc-dev", "rustfmt", "rust-analyzer"]

0 commit comments

Comments
 (0)