Skip to content
Snippets Groups Projects
intel-docker.md 1.97 KiB
Newer Older

# Running Intel oneAPI with docker

If you want to run within a container, a set of predefined images are usable:
- the [default oneAPI image](intel/oneapi-basekit) (4.26 GiB) which see your Intel CPU and iGPU.
- a ["smaller" oneAPI image](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/jfalcou:2024.1) (2.29 GiB) which only see your Intel CPU.
- a ["bigger" oneAPI image](gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/dchamont:2024.1) (5.29 GiB) which add the NVidia codeplay plugin, and therefore also see your NVidia card, if you have one.

We recommend you to start your container with the following command, which sets some useful options for Intel GPU (`--device=/dev/dri`) and|or NVidia card (`--gpus all`), and mount the current directory as `/work` in the container:

```sh
IMG=gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/dchamont:2024.1
docker pull ${IMG}
docker run --gpus all --device=/dev/dri --network host -it --rm -v ${PWD}:/work -w /work ${IMG}
```

First check that the installation is OK with `sycl-ls`, and `nvidia-smi` if you have a CUDA card.
Then you can go through the test program for CPU and|or CUDA:

```sh
# move to the top directory
cd GrayScottSyclSetup/

# check CPU nodes
IMG=gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/jfalcou:2024.1
CHAMONT David's avatar
CHAMONT David committed
docker run --network host -it --rm -v ${PWD}:/work -w /work ${IMG}
cd CheckOneApi
./intel.bash   # give the list of available devices
./intel.bash 1 # check the results of device 1
exit

# Check GPU nodes
IMG=gitlab-registry.in2p3.fr/codeursintensifs/grayscott/grayscottsyclsetup/dchamont:2024.1
docker run --gpus all --device=/dev/dri --network host -it --rm -v ${PWD}:/work -w /work ${IMG}
CHAMONT David's avatar
CHAMONT David committed
cd CheckOneApi
CHAMONT David's avatar
CHAMONT David committed
./cuda.bash   # give the list of available devices
./cuda.bash 4 # give the list of available devices
CHAMONT David's avatar
CHAMONT David committed

Have a look at `intel.bash` to see the various compile and run steps, and optionally adapt it to your own needs.