Skip to content

Commit

Permalink
CMakeLists - GPU Arch Updates (#232)
Browse files Browse the repository at this point in the history
* CMakeLists - GPU Arch Updates

* Update README.md
  • Loading branch information
kiritigowda authored Nov 7, 2024
1 parent e972788 commit 571cca1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 23 deletions.
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,33 +106,38 @@ rocAL can be currently used to perform the following operations either with rand
```shell
pip3 install wheel
```

* [FFMPEG](https://www.ffmpeg.org) - Optional for source install, but required for package install
```shell
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
```

* [PyBind11](https://github.com/pybind/pybind11)
* [OpenCV](https://docs.opencv.org/4.6.0/index.html) - Optional for source install, but required for package install
```shell
sudo apt install libopencv-dev
```

* [PyBind11](https://github.com/pybind/pybind11) - Manual install
* Source: `https://github.com/pybind/pybind11`
* Tag: [v2.11.1](https://github.com/pybind/pybind11/releases/tag/v2.11.1)

* [Turbo JPEG](https://libjpeg-turbo.org/)
* [Turbo JPEG](https://libjpeg-turbo.org/) - Manual install
* Source: `https://github.com/libjpeg-turbo/libjpeg-turbo.git`
* Tag: [3.0.2](https://github.com/libjpeg-turbo/libjpeg-turbo/releases/tag/3.0.2)

* [RapidJSON](https://github.com/Tencent/rapidjson)
* [RapidJSON](https://github.com/Tencent/rapidjson) - Manual install
* Source: `https://github.com/Tencent/rapidjson.git`
* Tag: `master`

* **Optional**: FFMPEG
```shell
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
```

* **Optional**: OpenCV
```shell
sudo apt install libopencv-dev
```

> [!IMPORTANT]
> * Compiler features required
> * OpenMP
> * C++17
> ```shell
> sudo apt install libstdc++-12-dev
> * OpenMP
> ```shell
> sudo apt install libomp-dev
> ```
>[!NOTE]
> * All package installs are shown with the `apt` package manager. Use the appropriate package manager for your operating system.
Expand Down
28 changes: 19 additions & 9 deletions rocAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,30 @@ if(GPU_SUPPORT AND "${BACKEND}" STREQUAL "HIP")
endif()
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH} ${ROCM_PATH}/hip)
# Set supported GPU Targets
set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102")
set(DEFAULT_GPU_TARGETS "gfx908;gfx90a;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102")
if (BUILD_WITH_AMD_ADVANCE)
set(DEFAULT_AMDGPU_TARGETS ${DEFAULT_AMDGPU_TARGETS} "gfx1200;gfx1201")
set(DEFAULT_GPU_TARGETS ${DEFAULT_GPU_TARGETS} "gfx1200;gfx1201")
endif()

# Set AMDGPU_TARGETS
if(DEFINED ENV{AMDGPU_TARGETS})
set(AMDGPU_TARGETS $ENV{AMDGPU_TARGETS} CACHE STRING "List of specific machine types for library to target")
elseif(AMDGPU_TARGETS)
message("-- ${White}${PROJECT_NAME} -- AMDGPU_TARGETS set with -D option${ColourReset}")
# Set AMD GPU_TARGETS
if((AMDGPU_TARGETS OR DEFINED ENV{AMDGPU_TARGETS}) AND (NOT GPU_TARGETS))
message("-- ${Red}${PROJECT_NAME} DEPRECATION -- AMDGPU_TARGETS use is deprecated. Use GPU_TARGETS${ColourReset}")
if(DEFINED ENV{AMDGPU_TARGETS})
set(GPU_TARGETS $ENV{AMDGPU_TARGETS} CACHE STRING "List of specific machine types for library to target")
else()
set(GPU_TARGETS ${AMDGPU_TARGETS})
endif()
endif()

if(DEFINED ENV{GPU_ARCHS})
set(GPU_TARGETS $ENV{GPU_ARCHS} CACHE STRING "List of specific machine types for library to target")
elseif(GPU_TARGETS)
message("-- ${White}${PROJECT_NAME} -- GPU_TARGETS set with -D option${ColourReset}")
else()
set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")
set(GPU_TARGETS "${DEFAULT_GPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")
endif()
message("-- ${White}${PROJECT_NAME} -- AMDGPU_TARGETS: ${AMDGPU_TARGETS}${ColourReset}")
message("-- ${White}${PROJECT_NAME} -- AMD GPU_TARGETS: ${GPU_TARGETS}${ColourReset}")

find_package(HIP QUIET)
if(HIP_FOUND)
SET(BUILD_ROCAL true)
Expand Down

0 comments on commit 571cca1

Please sign in to comment.