Skip to content

Commit 5e54dd2

Browse files
committed
[Doc] Add documentation for Docker images
1 parent 892b707 commit 5e54dd2

File tree

4 files changed

+92
-2
lines changed

4 files changed

+92
-2
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ sycl/ReleaseNotes.md @pvchupin @tfzhu
2626
sycl/doc/ @pvchupin @bader
2727
sycl/doc/extensions/ @intel/dpcpp-specification-reviewers
2828
sycl/doc/SPIRV @AlexeySotkin @bashbaug @mbelicki
29+
sycl/doc/dev @bader @vladimirlaz
2930

3031
# Sub-groups
3132
sycl/include/CL/sycl/detail/spirv.hpp @Pennycook @AlexeySachkov

sycl/doc/GetStartedGuide.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ and a wide range of compute accelerators such as GPU and FPGA.
4646
* Windows: `Visual Studio` version 15.7 preview 4 or later -
4747
[Download](https://visualstudio.microsoft.com/downloads/)
4848

49+
Alternatively you can use Docker image, that has everything you need
50+
pre-installed:
51+
52+
```
53+
docker run --name sycl_build -it --entrypoint=/bin/bash -v /local/workspace/dir/:/src ghcr.io/intel/llvm/ubuntu2004_base
54+
```
55+
56+
This command will start a terminal session, from which you can proceed with the
57+
instructions below. See [Docker BKMs](dev/DockerBKMs.md) for more info on Docker
58+
commands.
59+
4960
### Create DPC++ workspace
5061

5162
Throughout this document `DPCPP_HOME` denotes the path to the local directory

sycl/doc/dev/DockerBKMs.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Docker Containers BKMs
2+
3+
## Docker vs Podman
4+
5+
Docker and Podman are very similar tools, that allow you to manage and run
6+
container images. Unlike Docker, Podman runs without a daemon, allows you to run
7+
containers without root permissions, but does not let you build a container from
8+
source. The command line syntax is mostly identical for Docker and Podman.
9+
Choose whatever is available on your system.
10+
11+
## SYCL Containers overview
12+
13+
The following containers are publicly available for DPC++ compiler development:
14+
15+
- `ghcr.io/intel/llvm/ubuntu2004_base`: contains basic environment setup for
16+
building DPC++ compiler from source.
17+
- `ghcr.io/intel/llvm/ubuntu2004_intel_drivers`: contains everything from base
18+
container + pre-installed Intel drivers. This image provides two main tags:
19+
`latest`, that uses latest available drivers, and `stable`, that uses
20+
recommended drivers.
21+
- `ghcr.io/intel/llvm/ubuntu2004_nightly`: contains latest successfully built
22+
nightly build of DPC++ compiler, as well as pre-installed Intel drivers.
23+
24+
## Building a Docker Container from scratch
25+
26+
Docker containers can be build with the following command:
27+
28+
```
29+
docker build -f path/to/devops/containers/file.Dockerfile path/to/devops/
30+
```
31+
32+
The `ubuntu2004_preinstalled.Dockerfile` script expects `llvm_sycl.tar.gz` file
33+
to be present in `devops/` directory.
34+
35+
Containers other than base provide several configurable arguments, most commonly
36+
used are`base_image` and `base_tag`, that specify base Docker image and its tag.
37+
You can set additional arguments with `--build-arg ARG=value` argument.
38+
39+
## Running Docker container interactively
40+
41+
The main application of Docker is containerizing services. But it also allows
42+
you to run containers interactively, so that you can use it as you would use a
43+
terminal or SSH session. The following command allows you to do that:
44+
45+
```
46+
docker run --name <friendly_name> -it --entrypoint /bin/bash <image_name>[:<tag>]
47+
```
48+
49+
This command will download an image, if it does not exist locally. If you've
50+
downloaded an image previously, and you want to update it, use
51+
`docker pull <image_name>` command.
52+
53+
## Passthrough an Intel GPU to container
54+
55+
Add `--device=/dev/dri` argument to `run` command to passthrough you Intel GPU.
56+
57+
## Passthrough a directory to container
58+
59+
Use `-v path/on/host:path/in/container` argument for `run` command to
60+
passthrough a host directory or a file.
61+
62+
## Managing downloaded Docker image
63+
64+
List local images:
65+
```
66+
docker image ls
67+
```
68+
69+
Remove local image:
70+
```
71+
docker image rm <image_name_or_id>
72+
```

sycl/doc/index.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Data Parallel C++ Documentation
22
===============================
33

44
Using oneAPI DPC++ for Application Development
5-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
----------------------------------------------
66

77
.. toctree::
88
:maxdepth: 1
@@ -18,7 +18,7 @@ Using oneAPI DPC++ for Application Development
1818
EnvironmentVariables
1919

2020
Developing oneAPI DPC++ Compiler
21-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
--------------------------------
2222

2323
.. toctree::
2424
:maxdepth: 1
@@ -41,3 +41,9 @@ Developing oneAPI DPC++ Compiler
4141
SYCLInstrumentationUsingXPTI
4242
ITTAnnotations
4343

44+
Development BKMs
45+
~~~~~~~~~~~~~~~~
46+
47+
.. toctree::
48+
:maxdepth: 1
49+
dev/DockerBKMs

0 commit comments

Comments
 (0)