Last active
November 16, 2021 14:51
-
-
Save thaddeusc1/c06e58a4287c9916838059e262d9a3aa to your computer and use it in GitHub Desktop.
ROCm Installation on Ubuntu 20.04 LTS Utilizing Upstream Kernel Drivers for GFX9-based AMD APUs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
| # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| [Unit] | |
| Description=A workaround to enable GPU memory access from userspace for AMD GFX9-based APUs. | |
| Documentation=https://github.com/RadeonOpenCompute/rocminfo/issues/40#issuecomment-777716393 | |
| [Service] | |
| Type=oneshot | |
| ExecStart=/usr/bin/mount -o remount,exec /dev | |
| [Install] | |
| WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
| # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| status_grep_no_lines_selected=1 | |
| curl https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/radeon-archive-keyring.gpg | |
| # AMD APUs with GFX9 GPUs have *limited* support within ROCm 4.x. | |
| # https://community.amd.com/t5/knowledge-base/amd-rocm-hardware-and-software-support-document/ta-p/489937 | |
| echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/radeon-archive-keyring.gpg] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list | |
| sudo apt update | |
| # OpenCL in ROCm 4.x does **not** detect GFX9-based APUs in Linux 5.14 | |
| sudo apt -y install linux-oem-20.04c | |
| sudo apt -y install rocm-libs | |
| echo 'SUBSYSTEM=="kfd", KERNEL=="kfd", TAG+="uaccess", GROUP="video"' | sudo tee /etc/udev/rules.d/70-kfd.rules | |
| groups | grep -q video | |
| if [ "$?" -eq "${status_grep_no_lines_selected}" ] | |
| then | |
| usermod -a -G video "${LOGNAME}" | |
| echo 'ADD_EXTRA_GROUPS=1' | sudo tee --append /etc/adduser.conf | |
| echo 'EXTRA_GROUPS=video' | sudo tee --append /etc/adduser.conf | |
| fi | |
| groups | grep -q render | |
| if [ "$?" -eq "${status_grep_no_lines_selected}" ] | |
| then | |
| usermod -a -G render "${LOGNAME}" | |
| echo 'EXTRA_GROUPS=render' | sudo tee --append /etc/adduser.conf | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment