Skip to content
Snippets Groups Projects
Commit 4f96ec3c authored by Jan Siwiec's avatar Jan Siwiec
Browse files

Update nvidia-hip.md

parent aaa80a7e
Branches
No related tags found
No related merge requests found
Pipeline #29505 failed
......@@ -4,7 +4,7 @@
ROCm HIP allows developers to convert [CUDA code][a] to portable C++. The same source code can be compiled to run on NVIDIA or AMD GPUs.
## This page documents the use of pre-built Singularity / apptainer image on karolina Accelerated nodes (acnXX)
This page documents the use of pre-built Singularity/apptainer image on Karolina Accelerated nodes (acn).
## Installed Versions of Singularity / apptainer
......@@ -21,21 +21,25 @@ module load apptainer/1.1.5
```
Run the container:
```console
singularity shell /home/vic0092/rocm/centos7-nvidia-rocm.sif
```
The above gives you Singularity / apptainer shell prompt:
```console
Singularity>
```
Verify that you have GPUs active and accessible on the given node:
```console
nvidia-smi
```
You should get output similar to:
```console
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.07 Driver Version: 515.65.07 CUDA Version: 11.7 |
......@@ -173,12 +177,14 @@ int main(int argc, char *argv[])
```
First convert the CUDA sample code into HIP code:
```console
cd /tmp
/opt/rocm/hip/bin/hipify-perl sample.cu > sample.cpp
```
This code can then be compiled using the following commands:
```console
cd /tmp
export HIP_PLATFORM=$( /opt/rocm/hip/bin/hipconfig --platform )
......@@ -187,6 +193,7 @@ $HIPCC sample.cpp -o sample
```
Running it, you should get the following output:
```console
Singularity> cd /tmp
Singularity> ./sample
......@@ -200,6 +207,4 @@ info: check result
PASSED!
```
That's all folks!
[a]: nvidia-cuda.md
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment