|
| 1 | +# EESSI Guide |
| 2 | + |
| 3 | +## How to load EESSI |
| 4 | +Loading an EESSI environment module: |
| 5 | +```[bash] |
| 6 | +source /cvmfs/software.eessi.io/versions/2023.06/init/lmod/bash |
| 7 | +``` |
| 8 | +Activating EESSI environment: |
| 9 | +```[bash] |
| 10 | +source /cvmfs/software.eessi.io/versions/2023.06/init/bash |
| 11 | +``` |
| 12 | + |
| 13 | +## GPU Support with EESI |
| 14 | +To enable GPU support you need a site-specific build that has `cuda` enabled. For guide to do this please refer to `docs/image-build`. This is |
| 15 | +because CUDA-drivers are host specific and EESSI can not ship NVIDIA drivers due to licensing + kernel specific constraints. This means that the |
| 16 | +host must provide the drivers in a known location (`host_injections`). |
| 17 | + |
| 18 | +### Using GPUs |
| 19 | +All CUDA-enabled software in EESSI expects CUDA drivers in a specific `host_injections` subdirectory.<br> |
| 20 | +```[bash] |
| 21 | +ls -l /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/software/CUDA/12.1.1/bin/nvcc |
| 22 | +``` |
| 23 | +The output of this should show a symlink to the EESSI `host_injections` dir like so: |
| 24 | +```[bash] |
| 25 | +lrwxrwxrwx 1 cvmfs cvmfs 109 May 6 2024 /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/software/CUDA/12.1.1/bin/nvcc |
| 26 | +-> /cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/amd/zen3/software/CUDA/12.1.1/bin/nvcc |
| 27 | +``` |
| 28 | +To expose the Nvidia GPU drivers. |
| 29 | +```[bash] |
| 30 | +/cvmfs/software.eessi.io/versions/2023.06/scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh |
| 31 | +``` |
| 32 | + |
| 33 | +### Buidling with GPUs |
| 34 | + |
| 35 | +Checking `nvcc --version` and `which nvcc` to see if `CUDA` compiler is found.<br> |
| 36 | +<br> |
| 37 | +If `nvcc` not found run:<br> |
| 38 | +```[bash] |
| 39 | +export PATH=/usr/local/cuda-13.0/bin:$PATH |
| 40 | +``` |
| 41 | +(with your specific cuda version)<br> |
| 42 | +`which nvcc` should now show path to compiler.<br> |
| 43 | +<br> |
| 44 | +Running `which gcc` will give path `.../2023.06/compat...`<br> |
| 45 | +Loading EESSI module (It is important to load a `gcc` that is compatible with the host's CUDA version.):<br> |
| 46 | +```[bash] |
| 47 | +module load GCC/12.3.0 |
| 48 | +``` |
| 49 | +Now running `which gcc` will give path `.../2023.06/software...`<br> |
| 50 | +<br> |
| 51 | +Now you can run `cmake` and `make` to compile `CUDA` using EESSI's `gcc`.<br> |
| 52 | + |
| 53 | +#### Test setup: Compile deviceQuery from CUDA-Samples |
| 54 | +To test that your EESSI set up can compile `CUDA`, try compiling deviceQuery from CUDA-Samples with the following steps:<br> |
| 55 | +```[bash] |
| 56 | +git clone https://github.com/NVIDIA/cuda-samples.git |
| 57 | +cd cuda-samples/Samples/1_Utilities/deviceQuery |
| 58 | +mkdir -p build |
| 59 | +cd build |
| 60 | +cmake .. |
| 61 | +make |
| 62 | +./deviceQuery |
| 63 | +``` |
0 commit comments