-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into large-usm-alloc
- Loading branch information
Showing
181 changed files
with
22,601 additions
and
2,718 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**/*.md' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
BUILD_TYPE: RelWithDebInfo | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Check Tabs | ||
run: | | ||
if git grep -n $'\t' samples/*.cpp samples/*.h tutorials/*.cpp tutorials/*.h; then echo 'Please replace tabs with spaces in source files.'; false; fi | ||
- name: Check Whitespace | ||
run: | | ||
if git grep -n '[[:blank:]]$' samples/*.cpp samples/*.h tutorials/*.cpp tutorials/*.h; then echo 'Please remove trailing whitespace from source files.'; false; fi | ||
build: | ||
needs: check | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
ext: [YES, NO] | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get Ubuntu OpenGL Dependencies | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libglfw3-dev | ||
- name: Get OpenCL Headers | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: KhronosGroup/OpenCL-Headers | ||
path: external/OpenCL-Headers | ||
|
||
- name: Get OpenCL ICD Loader | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: KhronosGroup/OpenCL-ICD-Loader | ||
path: external/opencl-icd-loader | ||
|
||
- name: Get OpenCL Extension Loader | ||
if: matrix.ext == 'YES' | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: bashbaug/opencl-extension-loader | ||
path: external/opencl-extension-loader | ||
|
||
- name: Create Build Directory | ||
run: cmake -E make_directory ${{runner.workspace}}/build | ||
|
||
- name: Run CMake | ||
shell: bash | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake -DOpenCL_INCLUDE_DIRS=$GITHUB_WORKSPACE/external/OpenCL-Headers -DCMAKE_BUILD_TYPE=$BUILD_TYPE $GITHUB_WORKSPACE | ||
|
||
- name: Build | ||
working-directory: ${{runner.workspace}}/build | ||
shell: bash | ||
run: cmake --build . --parallel --config $BUILD_TYPE | ||
|
||
#- name: Test | ||
# working-directory: ${{runner.workspace}}/build | ||
# shell: bash | ||
# run: ctest -C $BUILD_TYPE |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Ubuntu 22.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 `<CL/cl.h>`; the C++ header is in `<CL/cl.hpp>`. | ||
|
||
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-<version> | ||
``` | ||
|
||
### 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 | ||
<platform information should show here> | ||
``` | ||
|
||
## 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 |
Oops, something went wrong.