Development with Docker and CUDA

Hi. I am developing code for my research and I’d like to make it run in a machine in which I don’t have permission to install Julia. I am not developing any “app”, I just want to be able to run my code, do my tests, expand and improve on the things that are still missing, and at the end generate numerical results to put in an article.

I have been thinking of using Docker, but I’m a newbie in both Julia and Docker, so I’d like some advice on how to go about this and what is considered good practice in this case.

Should I clone my project’s repository inside the container? Or should I let the container communicate with the host? Should I create the image with the packages listed in the .toml files? How would you go about this?

I’ll also need to parallelize things in CUDA. I don’t know if this makes things more complicated or if it’s the same as running parallelized code at host.

My knowledge of Docker is very faulty, and it seems that a lot of the tutorials on the web are for a different type of use than mine. I appreciate any help you guys can offer, as I feel quite lost here.

juliaup installs in your home folder, without requiring additional permissions.

CUDA.jl similarly installs the CUDA toolkit in user-writable locations. You do still need the NVIDIA driver to be installed by a system administrator, though.

1 Like

By the way, @maleadt do you have any docker file template? GitHub - JuliaGPU/julia-ngc doesn’t seem to be updated with the latest version of Julia & CUDA.jl

I do not have an up to date template, although it’s probably not too much work to update the ngc one for your needs.

I updated the dependency and it seems to still work fine.

@hilario You may give it a try julia-ngc versions · findmyway · GitHub

I also made a PR Update to Julia@v1.11 & CUDA.jl@v5.5.2 by findmyway · Pull Request #82 · JuliaGPU/julia-ngc · GitHub

I’d strongly recommend you to start with the juliaup approach @maleadt mentioned earlier. Things are much more complicated than you thought if you are new to both Docker (with GPU) and Julia.

Hi, thank you both @maleadt @findmyway for the help. I’m gonna try the approach you recommended!