diff --git a/docs.it4i/software/nvidia-hip.md b/docs.it4i/software/nvidia-hip.md index 5c1f76ac1ec2399fea1f6d5dc7fabcfcbb1e4744..a27083add0756729e5b34d4be09f37ac41c67448 100644 --- a/docs.it4i/software/nvidia-hip.md +++ b/docs.it4i/software/nvidia-hip.md @@ -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