From b29a9727e5b985e7a3f9134064dfd75222b08f79 Mon Sep 17 00:00:00 2001
From: David Chamont <chamont@in2p3.fr>
Date: Thu, 20 Jun 2024 16:26:32 +0200
Subject: [PATCH] General setup ready, but not specialized for MUST.

---
 README.md                                     | 56 ++++++++++++++++---
 UnderWork/{ => AdaptiveCpp}/CMakeLists.txt    |  0
 UnderWork/{ => AdaptiveCpp}/README.md         |  0
 .../PierreRecipes/.gitlab-ci.yml              |  0
 .../docker}/alpine_light/Dockerfile           |  0
 .../docker}/code_server/Dockerfile            |  0
 .../docker}/micromamba_vscode/Dockerfile      |  0
 .../scripts}/scriptCreateImage.sh             |  0
 {scripts => bin}/qclean.bash                  |  0
 9 files changed, 49 insertions(+), 7 deletions(-)
 rename UnderWork/{ => AdaptiveCpp}/CMakeLists.txt (100%)
 rename UnderWork/{ => AdaptiveCpp}/README.md (100%)
 rename .gitlab-ci.yml => UnderWork/PierreRecipes/.gitlab-ci.yml (100%)
 rename {docker => UnderWork/PierreRecipes/docker}/alpine_light/Dockerfile (100%)
 rename {docker => UnderWork/PierreRecipes/docker}/code_server/Dockerfile (100%)
 rename {docker => UnderWork/PierreRecipes/docker}/micromamba_vscode/Dockerfile (100%)
 rename {scripts => UnderWork/PierreRecipes/scripts}/scriptCreateImage.sh (100%)
 rename {scripts => bin}/qclean.bash (100%)

diff --git a/README.md b/README.md
index 08cbc47..7316a3e 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Because the default compilation options on Code Reckons only generate the code f
 
 Provided you have asked for an account ahead of time, on the [Intel Tiber Developer Cloud for oneAPI](https://devcloud.intel.com/oneapi/home/), and made the Intel recommended local ssh installation, that is how you may run the tests with `qsub`:
 
-```
+```sh
 ssh devcloud
 git clone https://gitlab.in2p3.fr/CodeursIntensifs/grayscott/GrayScottSyclSetup.git
 
@@ -51,7 +51,7 @@ One can check the status of current jobs with `qstat`, and remove them with `qde
 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.
+- 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:
 
@@ -61,7 +61,34 @@ docker pull ${IMG}
 docker run --gpus all --device=/dev/dri --network host -it --rm -v ${PWD}:/work -w /work ${IMG}
 ```
 
-Check that the installation is OK with `sycl-ls`, and `nvidia-smi` if you have a CUDA card.
+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
+docker run --gpus all --device=/dev/dri --network host -it --rm -v ${PWD}:/work -w /work ${IMG}
+cd CheckOneApiCpu
+./sycl-ls.bash
+./cmake.bash
+./make.bash
+./run.bash
+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}
+cd CheckOneApiCuda
+nvidia-smi
+./sycl-ls.bash
+./cmake.bash
+./make.bash
+./run.bash
+exit
+```
 
 ## Intel oneAPI Base Toolkit bare-metal installation
 
@@ -76,20 +103,35 @@ For example:
 
 Check that the installation seems OK with `sycl-ls`.
 
-Note: when trying the recipe above, `sycl-ls` does not show the Intel iGPU. I wonder why.
+Note: when trying myself the recipe above, `sycl-ls` does not show the Intel iGPU. I wonder why.
 
 ### Cuda
 
-...
+One way to proceed, for example for Ubuntu :
 
-Check with `nvidia-smi` that your NVidia card is seen.
+```sh
+# Repo preparation:  Driver Version: 555.42.02    CUDA Version: 12.5 
+wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
+mv -f cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
+wget https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda-repo-ubuntu2204-12-5-local_12.5.0-555.42.02-1_amd64.deb
+dpkg -i cuda-repo-ubuntu2204-12-5-local_12.5.0-555.42.02-1_amd64.deb
+cp /var/cuda-repo-ubuntu2204-12-5-local/cuda-*-keyring.gpg /usr/share/keyrings/
+
+# Installations apt-get
+apt-get update
+apt-get install -y cuda-toolkit-12-5
+rm -rf /var/lib/apt/lists/*
+
+# Check your card
+nvidia-smi
+```
 
 ### Codeplay plugin for NVidia
 
 Get the installer from `https://developer.codeplay.com/products/oneapi/nvidia/download`,
 and run it with `sh ...`.
 
-Then check with `sycl-ls` that your NVidia card is seen.
+Then check with `sycl-ls` that your NVidia card is now seen by SYCL.
 
 
 
diff --git a/UnderWork/CMakeLists.txt b/UnderWork/AdaptiveCpp/CMakeLists.txt
similarity index 100%
rename from UnderWork/CMakeLists.txt
rename to UnderWork/AdaptiveCpp/CMakeLists.txt
diff --git a/UnderWork/README.md b/UnderWork/AdaptiveCpp/README.md
similarity index 100%
rename from UnderWork/README.md
rename to UnderWork/AdaptiveCpp/README.md
diff --git a/.gitlab-ci.yml b/UnderWork/PierreRecipes/.gitlab-ci.yml
similarity index 100%
rename from .gitlab-ci.yml
rename to UnderWork/PierreRecipes/.gitlab-ci.yml
diff --git a/docker/alpine_light/Dockerfile b/UnderWork/PierreRecipes/docker/alpine_light/Dockerfile
similarity index 100%
rename from docker/alpine_light/Dockerfile
rename to UnderWork/PierreRecipes/docker/alpine_light/Dockerfile
diff --git a/docker/code_server/Dockerfile b/UnderWork/PierreRecipes/docker/code_server/Dockerfile
similarity index 100%
rename from docker/code_server/Dockerfile
rename to UnderWork/PierreRecipes/docker/code_server/Dockerfile
diff --git a/docker/micromamba_vscode/Dockerfile b/UnderWork/PierreRecipes/docker/micromamba_vscode/Dockerfile
similarity index 100%
rename from docker/micromamba_vscode/Dockerfile
rename to UnderWork/PierreRecipes/docker/micromamba_vscode/Dockerfile
diff --git a/scripts/scriptCreateImage.sh b/UnderWork/PierreRecipes/scripts/scriptCreateImage.sh
similarity index 100%
rename from scripts/scriptCreateImage.sh
rename to UnderWork/PierreRecipes/scripts/scriptCreateImage.sh
diff --git a/scripts/qclean.bash b/bin/qclean.bash
similarity index 100%
rename from scripts/qclean.bash
rename to bin/qclean.bash
-- 
GitLab