1
- .. _docker :
2
1
.. include :: ./../ext_links.txt
3
2
4
3
Docker Support
5
4
==============
6
5
7
- Numba dpex now delivers docker support.
8
- Dockerfile is capable of building numba-dpex as well as direct dependencies for it:
9
- dpctl and dpnp.
10
- There are several prebuilt images available: for trying numba_dpex and
11
- for building numba-dpex.
6
+ Numba dpex now delivers docker support. Dockerfile is capable of building
7
+ numba-dpex as well as direct dependencies for it: dpctl and dpnp. There are
8
+ several prebuilt images available: for trying numba_dpex and for building
9
+ numba-dpex.
12
10
13
11
Building
14
12
--------
15
13
16
- Numba dpex ships with multistage Dockerfile, which means there are
17
- different `targets <https://docs.docker.com/build/building/multi-stage/#stop-at-a-specific-build-stage >`_ available for build. The most useful ones:
14
+ Numba dpex ships with multistage Dockerfile, which means there are different
15
+ `targets
16
+ <https://docs.docker.com/build/building/multi-stage/#stop-at-a-specific-build-stage> `_
17
+ available for build. The most useful ones:
18
18
19
- - runtime
20
- - runtime-gpu
21
- - numba-dpex-builder-runtime
22
- - numba-dpex-builder-runtime-gpu
19
+ - `` runtime ``
20
+ - `` runtime-gpu ``
21
+ - `` numba-dpex-builder-runtime ``
22
+ - `` numba-dpex-builder-runtime-gpu ``
23
23
24
24
To build docker image
25
25
@@ -36,28 +36,30 @@ To run docker image
36
36
37
37
.. note ::
38
38
39
- If you are building docker image with gpu support it will calls github api to get
40
- latest versions of intel gpu drivers. You may face Github API call limits. To avoid
41
- this, you can pass your github credentials to increase this limit. You can do it
42
- by providing
43
- ` build args <https://docs.docker.com/engine/reference/commandline/build/#build-arg >`_
44
- ``GITHUB_USER `` and ``GITHUB_PASSWORD ``. You can use
45
- ` access token <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token> `
39
+ If you are building docker image with gpu support it will calls github api
40
+ to get latest versions of intel gpu drivers. You may face Github API call
41
+ limits. To avoid this, you can pass your github credentials to increase this
42
+ limit. You can do it by providing ` build args
43
+ <https://docs.docker.com/engine/reference/commandline/build/#build-arg> `_
44
+ ``GITHUB_USER `` and ``GITHUB_PASSWORD ``. You can use ` access token
45
+ <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token> `_
46
46
instead of the password:
47
47
48
48
.. note ::
49
49
50
- In case you are building docker image behind firewall and your internet access
51
- requires proxy, you can provide proxy
52
- `build args <https://docs.docker.com/engine/reference/commandline/build/#build-arg >`_
53
- ``http_proxy `` and ``https_proxy ``. Please note, that these args must be lowercase.
50
+ In case you are building docker image behind firewall and your internet
51
+ access requires proxy, you can provide proxy `build args
52
+ <https://docs.docker.com/engine/reference/commandline/build/#build-arg> `_
53
+ ``http_proxy `` and ``https_proxy ``. Please note, that these args must be
54
+ lowercase.
54
55
55
- Dockerfile supports different python versions. To select the one you want, simply set
56
- ``PYTHON_VERSION `` build arg. By default docker image is based on official python image
57
- based on slim debian, so the requested python version must be from the available python
58
- docker images. In case you want to build on images on custom image you have to pass
59
- ``BASE_IMAGE `` environment variable. Be aware that Dockerfile is based on debian so any
60
- base image should be debian based, like debian or ubuntu.
56
+ Dockerfile supports different python versions. To select the one you want,
57
+ simply set ``PYTHON_VERSION `` build arg. By default docker image is based on
58
+ official python image based on slim debian, so the requested python version must
59
+ be from the available python docker images. In case you want to build on images
60
+ on custom image you have to pass ``BASE_IMAGE `` environment variable. Be aware
61
+ that Dockerfile is based on debian so any base image should be debian based,
62
+ like debian or ubuntu.
61
63
62
64
Build arguments that could be useful:
63
65
@@ -90,8 +92,8 @@ Refer to Dockerfile to see all available
90
92
Running prebuilt images
91
93
-----------------------
92
94
93
- An easy way you can try ``numba_dpex `` is by using prebuilt images.
94
- There are several prebuilt images available:
95
+ An easy way you can try ``numba_dpex `` is by using prebuilt images. There are
96
+ several prebuilt images available:
95
97
96
98
- ``runtime `` package that provides runtime experience
97
99
.. code-block :: text
@@ -103,7 +105,8 @@ There are several prebuilt images available:
103
105
104
106
ghcr.io/intelpython/numba-dpex/builder:<numba_dpex_version>-py<python_version>[-gpu]
105
107
106
- - you can also see ``stages `` package, but it is used mostly for building stages.
108
+ - you can also see ``stages `` package, but it is used mostly for building
109
+ stages.
107
110
You can use them to build your own docker that is built on top of one of them.
108
111
109
112
To try out numba dpex simply run:
126
129
127
130
.. note ::
128
131
129
- If you want to enable GPU you need to pass it within container and use ``*-gpu `` tag.
132
+ If you want to enable GPU you need to pass it within container and use
133
+ ``*-gpu `` tag.
130
134
131
135
For passing GPU into container on linux use arguments ``--device=/dev/dri ``.
132
- However if you are using WSL you need to pass
133
- `` --device=/dev/dxg -v /usr/lib/wsl:/usr/lib/wsl `` instead.
136
+ However if you are using WSL you need to pass `` --device=/dev/dxg -v
137
+ /usr/lib/wsl:/usr/lib/wsl `` instead.
134
138
135
- So, for example, if you want to run numba dpex container with GPU support on WSL:
139
+ So, for example, if you want to run numba dpex container with GPU support on
140
+ WSL:
136
141
137
142
.. code-block :: bash
138
143
0 commit comments