How to setup tensorflow with gpu support with docker

Viewed 250

I'm on Ubuntu 20.04.2, I've installed the Nvidida drivers and docker aswell as Cuda 11.0 I believe. I've pulled various docker images from the Internet but I don't know how to open jupyterlab on a docker image that supports gpu use for tensorflow. What I achieved was either to start jupyterlab through a docker image, but when I'm in tensorflow doesn't recognize my gpu (gtx 1080):

(sudo docker run --rm -p 8888:8888 -p 4040:4040 -e JUPYTER_ENABLE_LAB=yes -v ~:/home/jovyan/work jupyter/all-spark-notebook)

Or start a gpu tensorflow docker image, in which I'm confined to the terminal (I don't know how I would open a jupyterlab instance here):

(sudo docker run -it --gpus all -v $(pwd):/workspace/ tensorflow/tensorflow:nightly-gpu bash) [My terminal with tensorflow docker image][1] When I put in the command for the nvidia docker image I get this: [nvidia docker image command][2] (sudo docker run --runtime nvidia nvidia/cuda:10.1-base-ubuntu18.04 nvidia-smi)

The weird thing is, yesterday I was able to somehow pull it off with the first command (jupyter notebook command), but it's not recognizing my gpu today. I've also tried installing everything without docker, but I'm getting library dependency problems when installing them like it says can happen on the tensorflow website. Should I give it another try or stick with docker? Thanks in advance [1]: https://i.stack.imgur.com/Sdazz.png [2]: https://i.stack.imgur.com/640nm.png

0 Answers
Related