p03-amd01 server has hyperthreading enabled therefore htop shows 128 cores.
p03-amd01 server has hyperthreading **enabled** therefore htop shows 128 cores.<br>
p03-amd02 server has hyperthreading **disabled** therefore htop shows 64 cores.
p03-amd02 server has hyperthreading dissabled therefore htop shows 64 cores.
## Using AMD MI100 GPUs
## Using AMD MI100 GPUs
The AMD GPUs can be programmed using the [ROCm open-source platform](https://docs.amd.com/).
The AMD GPUs can be programmed using the [ROCm open-source platform](https://docs.amd.com/).
ROCm and related libraries are installed directly in the system. You can find it here:
ROCm and related libraries are installed directly in the system.
You can find it here:
```console
```console
/opt/rocm/
/opt/rocm/
...
@@ -51,7 +52,9 @@ The actual version can be found here:
...
@@ -51,7 +52,9 @@ The actual version can be found here:
The first way how to program AMD GPUs is to use HIP.
The first way how to program AMD GPUs is to use HIP.
The basic vector addition code in HIP looks like this. This a full code and you can copy and paste it into a file. For this example we use `vector_add.hip.cpp`.
The basic vector addition code in HIP looks like this.
This a full code and you can copy and paste it into a file.
For this example we use `vector_add.hip.cpp`.
```console
```console
#include <cstdio>
#include <cstdio>
...
@@ -126,7 +129,8 @@ int main()
...
@@ -126,7 +129,8 @@ int main()
}
}
```
```
To compile the code we use `hipcc` compiler. The compiler information can be found like this:
The basic code in HIP that uses hipBlas looks like this. This a full code and you can copy and paste it into a file. For this example we use `hipblas.hip.cpp`.
The basic code in HIP that uses hipBlas looks like this.
This a full code and you can copy and paste it into a file.
The basic code in HIP that uses hipSolver looks like this. This a full code and you can copy and paste it into a file. For this example we use `hipsolver.hip.cpp`.
The basic code in HIP that uses hipSolver looks like this.
This a full code and you can copy and paste it into a file.
The ROCm™ installation includes an LLVM-based implementation that fully supports the OpenMP 4.5 standard and a subset of the OpenMP 5.0 standard. Fortran, C/C++ compilers, and corresponding runtime libraries are included.
The ROCm™ installation includes an LLVM-based implementation that fully supports the OpenMP 4.5 standard
and a subset of the OpenMP 5.0 standard.
Fortran, C/C++ compilers, and corresponding runtime libraries are included.
The OpenMP toolchain is automatically installed as part of the standard ROCm installation and is available under `/opt/rocm/llvm`. The sub-directories are:
The OpenMP toolchain is automatically installed as part of the standard ROCm installation
and is available under `/opt/rocm/llvm`. The sub-directories are:
-`bin` : Compilers (flang and clang) and other binaries.
-`bin` : Compilers (flang and clang) and other binaries.
-`examples` : The usage section below shows how to compile and run these programs.
-`examples` : The usage section below shows how to compile and run these programs.
...
@@ -466,7 +477,9 @@ More information can be found in the [AMD OpenMP Support Guide](https://docs.amd
...
@@ -466,7 +477,9 @@ More information can be found in the [AMD OpenMP Support Guide](https://docs.amd
## Compilation of OpenMP Code
## Compilation of OpenMP Code
Basic example that uses OpenMP offload is here. Again, code is comlete and can be copy and pasted into file. Here we use `vadd.cpp`.
Basic example that uses OpenMP offload is here.
Again, code is complete and can be copied and pasted into a file.
Here we use `vadd.cpp`.
```console
```console
#include <cstdio>
#include <cstdio>
...
@@ -535,8 +548,11 @@ These options are required for target offload from an OpenMP program:
...
@@ -535,8 +548,11 @@ These options are required for target offload from an OpenMP program:
-`-fopenmp-targets=amdgcn-amd-amdhsa`
-`-fopenmp-targets=amdgcn-amd-amdhsa`
-`-Xopenmp-target=amdgcn-amd-amdhsa`
-`-Xopenmp-target=amdgcn-amd-amdhsa`
This flag specifies the GPU architecture of targeted GPU. You need to chage this when moving for instance to LUMI with MI250X GPU. The MI100 GPUs presented in CS have code `gfx908`:
This flag specifies the GPU architecture of targeted GPU.
You need to chage this when moving for instance to LUMI with MI250X GPU.
The MI100 GPUs presented in CS have code `gfx908`:
-`-march=gfx908`
-`-march=gfx908`
Note: You also have to include the `O0`, `O2`, `O3` or `O3` flag. Without this flag the execution of the compiled code fails.
Note: You also have to include the `O0`, `O2`, `O3` or `O3` flag.
Without this flag the execution of the compiled code fails.