Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Hip on NVIDIA gpu #3310

Closed
Smit703 opened this issue Aug 20, 2023 · 6 comments
Closed

Running Hip on NVIDIA gpu #3310

Smit703 opened this issue Aug 20, 2023 · 6 comments

Comments

@Smit703
Copy link

Smit703 commented Aug 20, 2023

Following the guide https://docs.amd.com/projects/HIP/en/docs-5.3.0/how_to_guides/install.html, I have installed HIP on NVIDIA V100 GPU
/opt/rocm/bin/hipconfig --full - This command gives :
HIP version : 5.5.30202-23639ff0

== hipconfig
HIP_PATH : /opt/rocm-5.5.3
ROCM_PATH : /opt/rocm
HIP_COMPILER : nvcc
HIP_PLATFORM : nvidia
HIP_RUNTIME : cuda
CPP_CONFIG : -D__HIP_PLATFORM_NVCC__= -D__HIP_PLATFORM_NVIDIA__= -I/opt/rocm-5.5.3/include -I/usr/local/cuda/include

== nvcc
CUDA_PATH : /usr/local/cuda
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jul_11_02:20:44_PDT_2023
Cuda compilation tools, release 12.2, V12.2.128
Build cuda_12.2.r12.2/compiler.33053471_0

But I cannot run HIP code using either hipcc or nvcc. What can be the problem?

hip/hip_runtime.h: No such file or directory -> Error while running NVCC
Command 'hipcc' not found, -> Error while running hipcc

@cjatin
Copy link
Contributor

cjatin commented Aug 21, 2023

can you confirm if hipcc is being installed in /opt/rocm/bin.

@Smit703
Copy link
Author

Smit703 commented Aug 22, 2023

Yes @cjatin , I can see hipcc in /opt/rocm/bin

@cjatin
Copy link
Contributor

cjatin commented Aug 22, 2023

in that case can try by adding hipcc path to your env $PATH.

Something like export PATH=$PATH:/opt/rocm/bin
Also set export HIP_PLATFORM=nvidia
and then run hipcc.

@Smit703
Copy link
Author

Smit703 commented Aug 23, 2023

Yep it worked. Thanks @cjatin

@Smit703 Smit703 closed this as completed Aug 23, 2023
@galenyu
Copy link

galenyu commented Apr 27, 2024

@Smit703 Hi Smit! I am a beginner in HIP. I recently received a code for HIP and I want to run it on NVIDIA GPU. But it is difficult to find relevant tutorials or examples. Do you know how to port HIP to CUDA for compilation and use ?

Any suggestion will be appreciated!

@jamesxu2
Copy link

Hi @galenyu , you do not need to port HIP code to CUDA, you can compile HIP code directly with NVCC by setting the HIP_PLATFORM=nvidia. You can see the discussion on this issue for more information: #3582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants