Do docker container support cuda

89 views
Skip to first unread message

殷承江

unread,
Jun 19, 2021, 2:38:24 PM6/19/21
to deal.II User Group
Hi all,

My team and I got two nvidia GPUs recently so we think we might use them for program acceleration. We use the dealii container as our dev env and to keep its strength, we use nvidia-docker2 to provide a runtime cuda support within containers.

The command nvidia-smi shows the detection of GPUs while compiling for step-64 as a test, we occur the errors below:

dealii@d2409a2b5069:~/step-64$ cmake .
CMake Error at CMakeLists.txt:41 (MESSAGE):


  Error! This tutorial requires a deal.II library that was configured with
  the following options:

      DEAL_II_WITH_MPI = ON
      DEAL_II_WITH_P4EST = ON
      DEAL_II_WITH_CUDA = ON

  However, the deal.II library found at /usr/local was configured with these
  options

      DEAL_II_WITH_MPI = ON
      DEAL_II_WITH_P4EST = ON
      DEAL_II_WITH_CUDA = OFF

  which conflict with the requirements.


-- Configuring incomplete, errors occurred!

which indicates the original dealii library didn't enable CUDA supported flag.

So is there a possible way to enable the flag without rebuild and install the whole library or does the dealii team has any plans to release an extra version based on nvidia/cuda image?

It is also possible to run cuda toolkit directly without installing it within the container for singularity (sorry I didn't find better articles) and nvidia itself, which is worth trying yet not fully matured.

In all, do we have better and simpler solutions for GPU supported programming with dealii?  Any comments are welcome!

Regards,
Chengjiang Yin

Bruno Turcksin

unread,
Jun 21, 2021, 8:41:44 AM6/21/21
to deal.II User Group
Chengjiang,

On Saturday, June 19, 2021 at 2:38:24 PM UTC-4 richard...@gmail.com wrote:

So is there a possible way to enable the flag without rebuild and install the whole library or does the dealii team has any plans to release an extra version based on nvidia/cuda image?
To enable cuda you need to reconfigure and rebuild deal.II. I can create a new image with CUDA enabled but you need to tell me which packages you need. The current docker images are based on a ppa, so I will need to create a new image from scratch.
 

It is also possible to run cuda toolkit directly without installing it within the container for singularity (sorry I didn't find better articles) and nvidia itself, which is worth trying yet not fully matured.
I haven't tried singularity in a while but it always _almost_ works but then it's a pain to make it work like it should.


In all, do we have better and simpler solutions for GPU supported programming with dealii?  Any comments are welcome!
I do all my development in Docker but you could also use spack https://github.com/dealii/dealii/wiki/deal.II-in-Spack which is great when it works.

Best,

Bruno
 

殷承江

unread,
Jun 21, 2021, 2:32:02 PM6/21/21
to dea...@googlegroups.com
Hi Bruno,

Thanks for the reply. It would be great if you could do me the favor. Since I'm still trying to master the library, not sure if extra parallel computation library is needed besides hdf5 and boost for output and toolkits.

To my knowledge, dealii image is built from source based on the official ubuntu image with a ppa repo including all dependent libraries, so it should be easy to replace the base image to cuda, say nvidia/cuda:11.3.1-devel-ubuntu20.04, which already have cuda support within. Wonder if it is feasible to migrate the master image to cuda base so both GPU and CPU parallel could be integrated to one container. The only con is that the image may be a bit too large.

Spack is very promising for the cluster production environment and I've already trying to set it up on the HPC. Though I still prefer to docker while doing test and dev considering its convenience. Updates would be posted here if any one of them works.

Regards,
Chengjiang Yin

Bruno Turcksin <bruno.t...@gmail.com> 于2021年6月21日周一 下午8:41写道:
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/WQDCw4FJ_kE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/0dfde45d-a3d3-4864-a365-cade171953b6n%40googlegroups.com.

Bruno Turcksin

unread,
Jun 29, 2021, 8:58:36 AM6/29/21
to dea...@googlegroups.com
Chengjiang,

Sorry for the delay. I have created a new image that you can pull
using docker pull rombur/dealii:9.3-cuda I have installed everything
in /opt and you can get the path to each package using
PACKAGE_NAME_DIR. Let me know if that works for you. If it does, I'll
try to create something more "official".

Best,

Bruno
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAGk2TyuSEg_i3iR-Pi8HztLZ_vHEp7O2o%2BTBzGenKPr5D_AZVA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages