Try this process.
1. First, add the ROCm repository to your system. For Ubuntu, you can use these commands:
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
2. Update your package list:
sudo apt update
3. Install the HIP runtime and compiler for CUDA:
sudo apt install hip-runtime-nvidia hip-dev
4. Set up environment variables. Add these lines to your `~/.bashrc` file:
export HIP_PLATFORM=nvidia
export PATH=$PATH:/opt/rocm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
Then run `source ~/.bashrc` to apply the changes.
5. Verify the installation:
hipconfig --full
6. Now try compiling your code again:
hipcc vector_add.cpp -o vector_add
No comments:
Post a Comment