Sign inSign up

d1egoprog/tensorflow-gpu-jupyter

By d1egoprog

•Updated 7 months ago

Dockerized TensorFlow with GPU support python library with Jupyter environments enabled ready

Image
0

2.2K

d1egoprog/tensorflow-gpu-jupyter repository overview

⁠TensorFlow GPU - Jupyter Lab/Notebook - Dockerized Alternative

This repository exposes and tracks a customized Docker Image for the TensorFlow package with GPU support and the Jupyter Lab or Notebook environments coexisting and ready to use. This custom build intends to be used on personal or small research teams or projects.

A ready-to-use image⁠ from Docker Hub is provided, along with the deploy instructions⁠ and the possibility of downloading and customizing the image through the Dockerfile using simple build instructions⁠. The assembled version uses the TensorFlow version 2.7 and 1.15 library version; however, it is possible to modify the base image in the FROM variable via the Dockerfile.

⁠Pre-requisites

In addition to the mandatory docker installation⁠, complying with the deployment prerequisites is necessary to activate the NVIDIA Driver successfully and obtain the output from the nvidia-smi command; if your environment is ready, you can skip the pre-requisites part.

Small guides are provided to set up the environment on a Ubuntu⁠ environment. This image was tested on these configurations:

Operative SystemGraphic Card Model
Ubuntu 20.04GeForce GTX 1060 6GB
Ubuntu 20.04GeForce GTX 1070 8GB
Ubuntu 20.04GeForce RTX 3060 Laptop GPU
Ubuntu 22.04GeForce RTX 3060 Laptop GPU

If your graphic card is different is recommended to check which version of CUDA Drivers⁠ is compatible with your system.

DISCLAIMER: this is not an official documentation guide.

⁠Deploy Alternatives

Two options for deploying the prebuilt docker image are provided: the docker-compose tool and the docker command from the CLI utility.

⁠Deploy using Docker CLI

Directly run the docker command like the following example. e.g., changing two variables.

docker run -v tfgpu_jupyter_data:/home/jupyter/data -v tfgpu_jupyter_ipynb:/home/jupyter/notebooks -p 8888:8888 -name sandbox_tfgpu_jupyter --gpus all d1egoprog/tensorflow-gpu-jupyter:2.7-lab
⁠Deploy using docker-compose

Download the prepared deploy.yml file from the repository via wget and execute the command using the utility or copy the content manually from this repository.

wget https://raw.githubusercontent.com/d1egoprog/tensorflow-gpu-jupyter-docker/main/deploy.yml
docker-compose -p sandbox -f deploy.yml up -d

The option -p creates a new stack called sandbox, just for these instructions.

⁠Testing the Installation

To check the functionality, you can open a web browser window to your docker-engine IP and the chosen service, e.g., PORT=8888; if you run this on your machine should be on localhost:8888/lab⁠. After that, the Jupyter Lab landing page should deploy if the deployment went correctly, asking for the session token. To obtain the token, just query the system log by using the command:

docker logs sandbox_tfgpu_jupyter

An output similar to this one should appear:

To access the server, open this file in a browser:
    file:///home/jupyter/.local/share/jupyter/runtime/jpserver-1-open.html
Or copy and paste one of these URLs:
    http://3538c43d20f3:8888/lab?token=<TOKEN>
 or http://127.0.0.1:8888/lab?token=<TOKEN>

Take the value of the token variable from the URL, in this example, and paste it into the token textbox displayed in the browser.

Happy hacking!! 🖖🖖.

⁠Troublehshooting

If you have any questions in deployment or build and any error is found, please open an issue. And contributing is always welcome. The Github repository URL⁠.

Tag summary

Content type

Image

Digest

sha256:d21ff043a…

Size

3.4 GB

Last updated

7 months ago

docker pull d1egoprog/tensorflow-gpu-jupyter