p03-amd01 server has hyperthreading enabled therefore htop shows 128 cores.
p03-amd02 server has hyperthreading dissabled therefore htop shows 64 cores.
p03-amd01 server has hyperthreading **enabled** therefore htop shows 128 cores.
p03-amd02 server has hyperthreading **disabled** 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 (see: https://docs.amd.com/ for more information.)
The AMD GPUs can be programmed using the ROCm open-source platform
(for more information, see [https://docs.amd.com/][1].)
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:
```
```
/opt/rocm/
/opt/rocm/
```
```
The actual version can be found here:
The actual version can be found here:
```
```
[user@p03-amd02.cs]$ cat /opt/rocm/.info/version
[user@p03-amd02.cs]$ cat /opt/rocm/.info/version
...
@@ -46,9 +53,11 @@ The actual version can be found here:
...
@@ -46,9 +53,11 @@ The actual version can be found here:
## Basic HIP code
## Basic HIP code
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`.
```
```
#include <cstdio>
#include <cstdio>
...
@@ -123,44 +132,46 @@ int main()
...
@@ -123,44 +132,46 @@ int main()
}
}
```
```
To compile the code we use `hipcc` compiler. The compiler information can be found like this:
To compile the code, we use `hipcc` compiler.
The compiler information can be found like this:
````
```
[user@p03-amd02.cs ~]$ hipcc --version
[user@p03-amd02.cs ~]$ hipcc --version
HIP version: 5.5.30202-eaf00c0b
HIP version: 5.5.30202-eaf00c0b
AMD clang version 16.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-5.5.1 23194 69ef12a7c3cc5b0ccf820bc007bd87e8b3ac3037)
AMD clang version 16.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-5.5.1 23194 69ef12a7c3cc5b0ccf820bc007bd87e8b3ac3037)
The basic code in HIP that uses hipBlas looks like this.
### Using hipBlas library
This is 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. For this example we use `hipblas.hip.cpp` .
```
```
#include <cstdio>
#include <cstdio>
...
@@ -304,14 +315,17 @@ int main()
...
@@ -304,14 +315,17 @@ int main()
}
}
```
```
The code compilation can be done as follows:
The code compilation can be done as follows:
```
```
hipcc hipblas.hip.cpp -o hipblas.x -lhipblas
hipcc hipblas.hip.cpp -o hipblas.x -lhipblas
```
```
### Using hipSolver library
### Using hipSolver Library
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.