From 4f96ec3c5b86cb2c674139bd2694298bf4a1bba1 Mon Sep 17 00:00:00 2001 From: Jan Siwiec <jan.siwiec@vsb.cz> Date: Tue, 17 Jan 2023 07:16:42 +0100 Subject: [PATCH] Update nvidia-hip.md --- docs.it4i/software/nvidia-hip.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs.it4i/software/nvidia-hip.md b/docs.it4i/software/nvidia-hip.md index 5c1f76ac1..a27083add 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 -- GitLab