# ANN: Docker image for CUDA packages

**URL:** https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792
**Category:** GPU
**Tags:** cudanative, cuda
**Created:** [September 8, 2017, 10:16pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792 "2017-09-08T22:16:08Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [September 8, 2017, 10:16pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/1 "2017-09-08T22:16:08Z")

</div>

Hi all,

Many JuliaGPU packages are pretty hard to install, so I’ve been working a little on a Docker image which comes with some CUDA packages preinstalled: [maleadt/juliagpu](https://github.com/JuliaGPU/docker), requiring [nvidia-docker](https://github.com/NVIDIA/nvidia-docker/wiki/Installation):

```julia
$ docker pull maleadt/juliagpu
$ nvidia-docker run -it maleadt/juliagpu

```

The image currently comes with CUDAnative.jl and CuArrays.jl preinstalled. Pulling the image requires a single initialization step, after which the image is fully usable, but the image just prompts you to do that (more details on the README). The image is rebuilt weekly, and only gets pushed if all packages pass tests, so there’s some quality guarantee which you don’t necessarily get by just installing the same commands.

I’ll probably keep this image working until packages like CUDAnative are easy to install, but if there’s more interest we might maintain it longer. It is already hooked up to the JuliaGPU CI. If you want to add other packages, just make a PR 🙂

---

<div class="post-metadata">

### Author: ![datnamer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datnamer/32/3471_2.png) [@datnamer](https://discourse.julialang.org/u/datnamer)
#### Post date: [February 25, 2018, 5:37am UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/2 "2018-02-25T05:37:53Z")

</div>

Hi @maleadt

Is this still working and up to date? Can Install it and run flux on AWS?

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [February 26, 2018, 8:58am UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/3 "2018-02-26T08:58:07Z")

</div>

> [@datnamer](#):
>
> Is this still working and up to date? Can Install it and run flux on AWS?

I’ve been running into an issue with Docker and the NVIDIA driver, so CI has been failing lately. I’ll look into it.

EDIT: the container has been updated

```plaintext
   _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?help" for help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\ __'_|_|_|\__'_| |  
|__/ | x86_64-linux-gnu

julia> Pkg.status()
3 required packages:
 - CUDAnative 0.6.0
 - CuArrays 0.4.0
 - GPUArrays 0.2.2
8 additional packages:
 - Adapt 0.2.0
 - CUDAapi 0.4.0
 - CUDAdrv 0.7.7
 - Compat 0.55.0
 - LLVM 0.5.1
 - NNlib 0.2.3
 - Requires 0.4.3
 - StaticArrays 0.6.6

```

It does not include Flux, since that package doesn’t depend on CuArrays, but you can just install it in the container. Might want to re-commit the container after installing and precompiling Flux though (check `gethostname` for the current container name).

---

<div class="post-metadata">

### Author: ![datnamer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datnamer/32/3471_2.png) [@datnamer](https://discourse.julialang.org/u/datnamer)
#### Post date: [February 26, 2018, 1:53pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/4 "2018-02-26T13:53:18Z")

</div>

Thanks. Yea I saw the build was failing and wanted to check in.

Is there a specific AWS AMI that would be best to use?

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [February 26, 2018, 2:03pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/5 "2018-02-26T14:03:36Z")

</div>

> [@datnamer](#):
>
> Is there a specific AWS AMI that would be best to use?

No idea. Maybe @tk3369 can give some details on [his experiment](https://discourse.julialang.org/t/flux-ready-for-a-beginner-deep-learning-project/9262/8).

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [February 26, 2018, 5:35pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/6 "2018-02-26T17:35:17Z")

</div>

I used this amazon image `ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-efd0428f)`

I didn’t write down all the steps but I do remember that I had to install several packages e.g. nvidia drivers. I might have even installed the latest version off the web but then later realized that was unnecessary and had a conflict with an existing one. Also, allocate at least 30GiB disk (or more depending on your problem size) for the instance. I did that a couple of times and ended up spending more time fixing that.

Once you get over the installation hurdle, it became a bit smoother - at least the simple examples worked. I didn’t go further than that, however.

---

<div class="post-metadata">

### Author: ![datnamer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datnamer/32/3471_2.png) [@datnamer](https://discourse.julialang.org/u/datnamer)
#### Post date: [February 26, 2018, 6:50pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/7 "2018-02-26T18:50:45Z")

</div>

Thank you.

The nvidia drivers were installed using docker? How long did the whole process take aprox take?

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [February 26, 2018, 8:11pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/8 "2018-02-26T20:11:16Z")

</div>

No, the drivers were installed with `apt-get`. It took me 3-4 hours messing with several different images to get it right.

---

<div class="post-metadata">

### Author: ![datnamer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datnamer/32/3471_2.png) [@datnamer](https://discourse.julialang.org/u/datnamer)
#### Post date: [February 26, 2018, 8:57pm UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/9 "2018-02-26T20:57:15Z")

</div>

Very helpful information, thanks.

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [February 27, 2018, 11:19am UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/10 "2018-02-27T11:19:30Z")

</div>

The image now also includes Knet (with GPU support).

Upon opening a REPL, there’s now also a hint on how to commit the current state, making it possible to install/precompile packages and save that state:

```nohighlight
If you want changes to persist (eg. after installing a package), run:
$ docker commit 1cfbc878f4f8 local/juliagpu
and use the local/juliagpu container instead.

```

A new version will be tagged [soon](http://ci.maleadt.net:8010/#/builders/41/builds/92).

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [March 18, 2018, 9:27am UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792/11 "2018-03-18T09:27:38Z")

</div>

I’ve changed the way this container works, using volumes to store data persistently instead of making users tag their own `local/juliagpu` container. This should make it much easier to keep state, update the container, etc.

I’ve also added a `/data` volume for importing data from the host system (see the README).
