From a22843806805c80b03e1174c156d7e46c34725a9 Mon Sep 17 00:00:00 2001 From: Caleb Callaway Date: Fri, 27 Dec 2024 16:44:21 -0800 Subject: [PATCH 1/2] Ubuntu 24.04 environment docs --- docs/env/ubuntu/24.04.md | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs/env/ubuntu/24.04.md diff --git a/docs/env/ubuntu/24.04.md b/docs/env/ubuntu/24.04.md new file mode 100644 index 0000000..c1a7ba7 --- /dev/null +++ b/docs/env/ubuntu/24.04.md @@ -0,0 +1,82 @@ +# Ubuntu 24.04 Setup Instructions + +## Verify Hardware Support + +Most modern GPUs support OpenCL. For integrated graphics devices (iGPUs), use `lscpu` to get the processor SKU. Detailed information for Intel SKUs is available from [ark.intel.com](ark.intel.com). Detailed information for AMD processors is available from [AMD's product page](https://www.amd.com/en/products/specifications/processors). + +## Build Dependencies + +OCL Headers: + +```bash +sudo apt install opencl-c-headers opencl-clhpp-headers +``` + +The OpenCL API has its own set of header files; the above command installs both C and C++ headers files. The C header can be found in ``; the C++ header is in ``. + +OCL ICD Loader: + +```bash +sudo apt install ocl-icd-opencl-dev +``` + +OpenCL applications generally link against an OpenCL Installable Compute Device (ICD) loader instead of a specific OpenCL implementation; see [https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc](https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc) for more information about this system. + +## Runtime Dependencies + +OpenCL requires a compute runtime to manage the interaction between the OpenCL API and the GPU. + +### OCL ICD Loader + +```bash +sudo apt install ocl-icd-libopencl1 +``` + +OpenCL applications generally link against an OpenCL Installable Compute Device (ICD) loader instead of a specific OpenCL implementation; see [https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc](https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc) for more information about this system. + +### AMD Compute Runtime + +AMD supports OpenCL through their ROCm platform. Installation instructions are [here](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu). + +### Intel Compute Runtime + +Intel's OpenCL support is provided through the NEO compute runtime. Download packages from the project's [GitHub releases page](https://github.com/intel/compute-runtime/releases). + +### Nvidia Compute Runtime + +Nvidia provides OpenCL support through their proprietary driver, available from the [graphics-drivers PPA](https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa). + +```bash +sudo add-apt-repository ppa:graphics-drivers/ppa +sudo apt update +sudo apt install nvidia-graphics-drivers- +``` + +### Configure Permissions + +```bash +sudo usermod -a -G video $USER +sudo usermod -a -G render $USER +``` + +Users running OpenCL applications on a GPU require additional permissions granted by the groups above. + +## Verification + +The `clinfo` utility can be used to verify the environment has been properly configured. + +```bash +$ sudo apt install clinfo +$ clinfo + +``` + +## Troubleshooting + +If `clinfo` indicates there are 0 supported platforms: + +1. Verify your host has OpenCL-capable hardware attached +2. Verify clinfo is running as a user with appropriate group membership +3. Verify new group membership has been applied (this may require logout or reboot) +4. Verify the correct compute runtime is installed +5. Check the kernel log (`sudo dmesg`) for related errors From 397dd0fcfaf35131ef20b02340d0efa24feede32 Mon Sep 17 00:00:00 2001 From: Caleb Callaway Date: Sat, 28 Dec 2024 15:56:53 -0800 Subject: [PATCH 2/2] Fix Ubuntu 24.04 docs error --- docs/env/ubuntu/24.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/env/ubuntu/24.04.md b/docs/env/ubuntu/24.04.md index c1a7ba7..e8ad888 100644 --- a/docs/env/ubuntu/24.04.md +++ b/docs/env/ubuntu/24.04.md @@ -12,7 +12,7 @@ OCL Headers: sudo apt install opencl-c-headers opencl-clhpp-headers ``` -The OpenCL API has its own set of header files; the above command installs both C and C++ headers files. The C header can be found in ``; the C++ header is in ``. +The OpenCL API has its own set of header files; the above command installs both C and C++ headers files. The C header can be found in ``; the C++ header is in ``. OCL ICD Loader: