Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel gpu #53

Merged
merged 48 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
54f6b48
oneAPI preparations
rschoene Apr 20, 2023
db0261e
added more OneAPI
rschoene Apr 20, 2023
b8c7706
removed mem stuff, set matrix size to 8192 on ONEAPI
rschoene Apr 20, 2023
0155bc0
removed debug stuff
rschoene Apr 20, 2023
2a1e2d1
added include
rschoene Apr 20, 2023
8c75b61
working version for OneAPI (tested with icx 2024.0)
rschoene Dec 12, 2023
3aebecb
added clang 10 not only to matrix
rschoene Dec 12, 2023
5adfe95
removed preparation for intel compiler
rschoene Dec 12, 2023
54470ed
some additions for OneAPI
rschoene Dec 13, 2023
11a83c1
added icx
rschoene Dec 13, 2023
772180e
added something to ignore in dependency folder
rschoene Dec 13, 2023
1b15680
another test for github actions
rschoene Dec 14, 2023
5a8c597
source different vars.sh
rschoene Dec 14, 2023
623c510
removed some make targets
rschoene Dec 14, 2023
627941c
removed macos and windows builds
rschoene Dec 14, 2023
81adf12
added mkl env vars
rschoene Dec 14, 2023
3650d43
different compiler for other things?
rschoene Dec 14, 2023
160211e
check other oneapi installation directories on runner
rschoene Dec 14, 2023
eedf50d
another test ...
rschoene Dec 14, 2023
33a731f
...
rschoene Dec 14, 2023
b2bde99
:/
rschoene Dec 14, 2023
3b43616
...
rschoene Dec 14, 2023
1cc601a
oneapi cmake.yml debugging
rschoene Dec 14, 2023
29d662a
yet another test
rschoene Dec 14, 2023
0e0efa6
...
rschoene Dec 14, 2023
32cb5eb
fix strip
rschoene Dec 14, 2023
64ae9d3
another attempt at fixing the action
rschoene Dec 14, 2023
0a7cf6b
more fix ...
rschoene Dec 14, 2023
8b8eeae
test to make it somewhat better
rschoene Dec 14, 2023
eb94e7c
...
rschoene Dec 14, 2023
ebac667
...
rschoene Dec 14, 2023
8d59b1c
re-add compilers to actions
rschoene Dec 14, 2023
6f5aad0
add OS and no ONE API to actions
rschoene Dec 14, 2023
fe21d5e
added CUDA devices, removed ubuntu 22.04, added more OneAPI versions
rschoene Dec 14, 2023
e9775fa
...
rschoene Dec 14, 2023
20c3b02
fix
rschoene Dec 14, 2023
faf1398
more debug
rschoene Dec 14, 2023
54e2d4a
added 2023.2.0
rschoene Dec 14, 2023
9507f8d
...
rschoene Dec 14, 2023
88c208f
windows, and stuff
rschoene Dec 14, 2023
8a167e5
readded compilers, CUDA
rschoene Dec 14, 2023
36f1a1f
changed macos version
rschoene Dec 15, 2023
11bbdc4
removed most checks (readd later, pushed macos 12)
rschoene Dec 15, 2023
cdd8d1d
test different macos
rschoene Dec 15, 2023
f4da389
readded compilers and stuff, since macos seems to work
rschoene Dec 15, 2023
59f5515
also add NVHPC, OneAPI2023 and MacOS 11 to tar.gz
rschoene Dec 15, 2023
c1048ba
notes on usage with OneAPI
rschoene Dec 15, 2023
e0e2de5
added NVHPC
rschoene Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 122 additions & 32 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,39 @@ jobs:
os: [ubuntu-20.04]
compiler: [g++-7, g++-8, g++-9, g++-10, clang++-8, clang++-9, clang++-10]
CUDA: ['0', '8.0', '11.0', 'NVHPC-22.5']
ONEAPI: ['0', '2023.2.0', '2024.0']

runs-on: ${{ matrix.os }}

env:
CUDA_ROOT: '/usr/local/cuda'

steps:
- name: Install g++-7
- name: Install g++-7 (if needed)
if: matrix.compiler == 'g++-7'
run: |
sudo apt install g++-7
- name: Install g++-8
- name: Install g++-8 (if needed)
if: matrix.compiler == 'g++-8'
run: |
sudo apt install g++-8
- name: Install clang++-8
- name: Install clang++-8 (if needed)
if: matrix.compiler == 'clang++-8'
run: |
sudo apt install clang-8
- name: Install clang++-9
- name: Install clang++-9 (if needed)
if: matrix.compiler == 'clang++-9'
run: |
sudo apt install clang-9
- name: Install clang++-10 (if needed)
if: matrix.compiler == 'clang++-10'
run: |
sudo apt install clang-10
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Install CUDA runtime
if: matrix.CUDA != '0'
- name: Install CUDA runtime (if needed)
if: matrix.CUDA != '0' && matrix.ONEAPI == 0
run: |
case ${{ matrix.CUDA }} in
8.0)
Expand All @@ -56,18 +61,25 @@ jobs:
tar xpzf nvhpc_2022_225_Linux_x86_64_cuda_11.7.tar.gz
sudo NVHPC_SILENT="true" NVHPC_INSTALL_DIR="$CUDA_ROOT" NVHPC_INSTALL_TYPE="single" ./nvhpc_2022_225_Linux_x86_64_cuda_11.7/install
esac
- name: Install OneAPI Base-Toolkit (if needed)
if: matrix.ONEAPI != '0' && matrix.CUDA == '0'
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-basekit-${{ matrix.ONEAPI }}
- name: Create build directory
run: |
mkdir build
- name: Run CMake configure
if: matrix.CUDA == '0'
- name: Run CMake configure (default)
if: matrix.CUDA == '0' && matrix.ONEAPI == '0'
env:
CXX: ${{ matrix.compiler }}
run: |
cd build
cmake ..
- name: Run CMake configure
if: matrix.CUDA != '0' && matrix.CUDA != 'NVHPC-22.5'
- name: Run CMake configure (CUDA)
if: matrix.CUDA != '0' && matrix.CUDA != 'NVHPC-22.5' && matrix.ONEAPI == '0'
env:
CXX: ${{ matrix.compiler }}
run: |
Expand All @@ -82,8 +94,8 @@ jobs:

cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_CUDA" -DCMAKE_EXE_LINKER_FLAGS="-L${CUDA_ROOT}/lib64/stubs/" ..
- name: Run CMake configure
if: matrix.CUDA == 'NVHPC-22.5'
- name: Run CMake configure (CUDA with NVHPC)
if: matrix.CUDA == 'NVHPC-22.5' && matrix.ONEAPI == '0'
env:
CXX: ${{ matrix.compiler }}
run: |
Expand All @@ -95,41 +107,76 @@ jobs:

cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_CUDA" -DCMAKE_EXE_LINKER_FLAGS=-L"$CUDA_ROOT/$NVARCH/22.5/cuda/11.7/lib64/stubs" -LA ..
- name: Build
- name: Run CMake configure (OneAPI 2023.2.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2023.2.0'
run: |
. /opt/intel/oneapi/setvars.sh
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_ONEAPI" ..
- name: Run CMake configure (OneAPI 2024.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2024.0'
run: |
. /opt/intel/oneapi/${{ matrix.ONEAPI }}/oneapi-vars.sh
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_ONEAPI" ..
- name: Build (default, CUDA)
if: matrix.ONEAPI =='0'
run: |
cd build
make -j2
- name: Strip binary
if: matrix.CUDA == '0'
- name: Build (OneAPI 2023.2.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2023.2.0'
run: |
. /opt/intel/oneapi/setvars.sh
cd build
make -j2
- name: Build (OneAPI 2024.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2024.0'
run: |
. /opt/intel/oneapi/${{ matrix.ONEAPI }}/oneapi-vars.sh
cd build
make -j2
- name: Strip binary (default)
if: matrix.CUDA == '0' && matrix.ONEAPI == '0'
run: |
cd build
strip src/FIRESTARTER
- name: Strip binary
if: matrix.CUDA != '0'
- name: Strip binary (CUDA)
if: matrix.CUDA != '0' && matrix.ONEAPI == '0'
run: |
cd build
strip src/FIRESTARTER_CUDA
- name: Test FIRESTARTER
if: matrix.CUDA == '0'
- name: Strip binary (OneAPI)
if: matrix.ONEAPI != '0' && matrix.CUDA == '0'
run: |
cd build
strip src/FIRESTARTER_ONEAPI
- name: Test FIRESTARTER (default)
if: matrix.CUDA == '0' && matrix.ONEAPI == '0'
run: ./build/src/FIRESTARTER -t 1
- uses: actions/upload-artifact@v2
if: matrix.compiler == 'clang++-10' && matrix.CUDA == '0'
if: matrix.compiler == 'clang++-10' && matrix.CUDA == '0' && matrix.ONEAPI == '0'
with:
name: FIRESTARTER-linux
path: build/src/FIRESTARTER
- uses: actions/upload-artifact@v2
if: matrix.compiler == 'clang++-10' && matrix.CUDA != '0'
if: matrix.compiler == 'clang++-10' && matrix.CUDA != '0' && matrix.ONEAPI == '0'
with:
name: FIRESTARTER_CUDA_${{ matrix.CUDA }}-linux
path: build/src/FIRESTARTER_CUDA
- uses: actions/upload-artifact@v2
if: matrix.compiler == 'clang++-10' && matrix.CUDA == '0' && matrix.ONEAPI != '0'
with:
name: FIRESTARTER_ONEAPI_${{ matrix.ONEAPI }}-linux
path: build/src/FIRESTARTER_ONEAPI
build-windows:
strategy:
fail-fast: false
matrix:
os: [windows-2019]
cfg:
- { CUDA: '0', MSVC: true }
- { CUDA: '0', MSVC: false }
- { CUDA: '0', ONEAPI: '0', MSVC: true }
- { CUDA: '0', ONEAPI: '0', MSVC: false }

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -202,7 +249,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15]
os: [macos-11, macos-12, macos-13]
#os: [macos-11.0, macos-10.15]

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -234,14 +281,14 @@ jobs:
cd build
./src/FIRESTARTER -t 1
- uses: actions/upload-artifact@v2
if: matrix.os == 'macos-10.15'
if: matrix.os == 'macos-12'
with:
name: FIRESTARTER-macOS_10.15
name: FIRESTARTER-macOS_12
path: build/src/FIRESTARTER
- uses: actions/upload-artifact@v2
if: matrix.os == 'macos-11.0'
if: matrix.os == 'macos-11'
with:
name: FIRESTARTER-macOS_11.0
name: FIRESTARTER-macOS_11
path: build/src/FIRESTARTER
create-download:
name: Create download for Website
Expand Down Expand Up @@ -292,6 +339,38 @@ jobs:
mv FIRESTARTER/FIRESTARTER_CUDA FIRESTARTER_CUDA_11.0
rm -rf FIRESTARTER
chmod +x FIRESTARTER_CUDA_11.0
# Linux CUDA HPC
- name: Retrieve FIRESTARTER_CUDA_NVHPC-22.5-linux
uses: actions/download-artifact@v2
with:
name: FIRESTARTER_CUDA_NVHPC-22.5-linux
path: FIRESTARTER
- name: Move binary to right directory
run: |
mv FIRESTARTER/FIRESTARTER_CUDA FIRESTARTER_CUDA_NVHPC-22.5
rm -rf FIRESTARTER
chmod +x FIRESTARTER_CUDA_NVHPC-22.5
# Linux OneAPI
- name: Retrieve FIRESTARTER_ONEAPI_2024.0-linux
uses: actions/download-artifact@v2
with:
name: FIRESTARTER_ONEAPI_2024.0-linux
path: FIRESTARTER
- name: Move binary to right directory
run: |
mv FIRESTARTER/FIRESTARTER_ONEAPI FIRESTARTER_ONEAPI_2024.0
rm -rf FIRESTARTER
chmod +x FIRESTARTER_ONEAPI_2024.0
- name: Retrieve FIRESTARTER_ONEAPI_2023.2.0-linux
uses: actions/download-artifact@v2
with:
name: FIRESTARTER_ONEAPI_2023.2.0-linux
path: FIRESTARTER
- name: Move binary to right directory
run: |
mv FIRESTARTER/FIRESTARTER_ONEAPI FIRESTARTER_ONEAPI_2023.2.0
rm -rf FIRESTARTER
chmod +x FIRESTARTER_ONEAPI_2023.2.0
# OSX 11.0
#- name: Retrieve FIRESTARTER-macOS_11.0
# uses: actions/download-artifact@v2
Expand All @@ -304,16 +383,26 @@ jobs:
# rm -rf FIRESTARTER
# chmod +x ../FIRESTARTER-macOS_11.0
# OSX 10.15
- name: Retrieve FIRESTARTER-macOS_10.15
- name: Retrieve FIRESTARTER-macOS_11
uses: actions/download-artifact@v2
with:
name: FIRESTARTER-macOS_11
path: FIRESTARTER
- name: Move binary to right directory
run: |
mv FIRESTARTER/FIRESTARTER FIRESTARTER-macOS_11
rm -rf FIRESTARTER
chmod +x FIRESTARTER-macOS_11
- name: Retrieve FIRESTARTER-macOS_12
uses: actions/download-artifact@v2
with:
name: FIRESTARTER-macOS_10.15
name: FIRESTARTER-macOS_12
path: FIRESTARTER
- name: Move binary to right directory
run: |
mv FIRESTARTER/FIRESTARTER FIRESTARTER-macOS_10.15
mv FIRESTARTER/FIRESTARTER FIRESTARTER-macOS_12
rm -rf FIRESTARTER
chmod +x FIRESTARTER-macOS_10.15
chmod +x FIRESTARTER-macOS_12
# Windows
- name: Retrieve FIRESTARTER-windows
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -342,3 +431,4 @@ jobs:
with:
name: FIRESTARTER.tar.gz
path: FIRESTARTER.tar.gz

8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
endif()

set(FIRESTARTER_BUILD_TYPE "FIRESTARTER" CACHE STRING "FIRESTARTER_BUILD_TYPE can be any of FIRESTARTER or FIRESTARTER_CUDA.")
set_property(CACHE FIRESTARTER_BUILD_TYPE PROPERTY STRINGS FIRESTARTER FIRESTARTER_CUDA)
set(FIRESTARTER_BUILD_TYPE "FIRESTARTER" CACHE STRING "FIRESTARTER_BUILD_TYPE can be any of FIRESTARTER, FIRESTARTER_CUDA, or FIRESTARTER_ONEAPI.")
set_property(CACHE FIRESTARTER_BUILD_TYPE PROPERTY STRINGS FIRESTARTER FIRESTARTER_CUDA FIRESTARTER_ONEAPI)
if (${FIRESTARTER_BUILD_TYPE} STREQUAL "FIRESTARTER")
option(FIRESTARTER_LINK_STATIC "Link FIRESTARTER as a static binary. Note, dlopen is not supported in static binaries. This option is not available on macOS or with CUDA enabled." ON)
option(FIRESTARTER_LINK_STATIC "Link FIRESTARTER as a static binary. Note, dlopen is not supported in static binaries. This option is not available on macOS or with CUDA or OneAPI enabled." ON)
endif()
if (${FIRESTARTER_BUILD_TYPE} STREQUAL "FIRESTARTER")
option(FIRESTARTER_BUILD_HWLOC "Build hwloc dependency." ON)
elseif(${FIRESTARTER_BUILD_TYPE} STREQUAL "FIRESTARTER_CUDA")
option(FIRESTARTER_BUILD_HWLOC "Build hwloc dependency." ON)
elseif(${FIRESTARTER_BUILD_TYPE} STREQUAL "FIRESTARTER_ONEAPI")
option(FIRESTARTER_BUILD_HWLOC "Build hwloc dependency." ON)
endif()
option(FIRESTARTER_THREAD_AFFINITY "Enable FIRESTARTER to set affinity to hardware threads." ON)

Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Build Status](https://github.com/tud-zih-energy/FIRESTARTER/workflows/Build/badge.svg?branch=master)
![Build Status](https://github.com/tud-zih-energy/FIRESTARTER/actions/workflows/cmake.yml/badge.svg?branch=intel_gpu)

# FIRESTARTER - A Processor Stress Test Utility

Expand Down Expand Up @@ -147,11 +147,13 @@ GCC (>=7) or Clang (>=9) is supported.

CMake option | Description
:---------------------------- | :----------------------------
`FIRESTARTER_BUILD_TYPE` | Can be any of `FIRESTARTER` or `FIRESTARTER_CUDA`. Default `FIRESTARTER`
`FIRESTARTER_LINK_STATIC` | Link FIRESTARTER as a static binary. Note, dlopen is not supported in static binaries. This option is not available on macOS or with CUDA enabled. Default `ON`
`FIRESTARTER_BUILD_TYPE` | Can be any of `FIRESTARTER`, `FIRESTARTER_CUDA`, or `FIRESTARTER_ONEAPI`,. Default `FIRESTARTER`
`FIRESTARTER_LINK_STATIC` | Link FIRESTARTER as a static binary. Note, dlopen is not supported in static binaries. This option is not available on macOS or with CUDA or OneAPI enabled. Default `ON`
`FIRESTARTER_BUILD_HWLOC` | Build hwloc dependency. Default `ON`
`FIRESTARTER_THREAD_AFFINITY` | Enable FIRESTARTER to set affinity to hardware threads. Default `ON`

When building `FIRESTARTER_ONEAPI` make sure that the Intel Math Kernel Library (MKL) and the complier `icx` can be found. These will be used to build `FIRESTARTER`, while dependencies will be build with `$CC` and `$CXX` respectively.

## Metrics

The Linux version of FIRESTARTER supports to collect metrics during runtime.
Expand Down Expand Up @@ -245,6 +247,13 @@ If `perf-ipc` is not available use `ipc-estimate`
FIRESTARTER -t 20 --optimize=NSGA2 --optimization-metric sysfs-powercap-rapl,ipc-estimate
```

## OneAPI
`FIRESTARTER_ONEAPI` needs to find certain libraries, which are installed with
the Intel OneAPI toolkits, since some of these libraries cannot be linked statically.
Make sure that they are installed and `$LD_LIBRARY_PATH` is set-up correctly.
Make also sure that you have the correct drivers for your GPU installed so that
OneAPI can apply work to it.

## Reference

A detailed description can be found in the following paper. Please cite this if
Expand Down
13 changes: 10 additions & 3 deletions include/firestarter/Firestarter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
#include <firestarter/Cuda/Cuda.hpp>
#endif

#ifdef FIRESTARTER_BUILD_ONEAPI
#include <firestarter/OneAPI/OneAPI.hpp>
#endif



#include <firestarter/Constants.hpp>

#if defined(linux) || defined(__linux__)
Expand Down Expand Up @@ -132,6 +138,10 @@ class Firestarter {
std::unique_ptr<cuda::Cuda> _cuda;
#endif

#ifdef FIRESTARTER_BUILD_ONEAPI
std::unique_ptr<oneapi::OneAPI> _oneapi;
#endif

#if defined(linux) || defined(__linux__)
inline static std::unique_ptr<optimizer::OptimizerWorker> _optimizer;
std::shared_ptr<measurement::MeasurementWorker> _measurementWorker;
Expand Down Expand Up @@ -163,9 +173,6 @@ class Firestarter {
void signalLoadWorkers(int comm);
static void loadThreadWorker(std::shared_ptr<LoadWorkerData> td);

// CudaWorker.cpp
static void *cudaWorker(void *cudaData);

#ifdef FIRESTARTER_DEBUG_FEATURES
// DumpRegisterWorker.cpp
static void dumpRegisterWorker(std::unique_ptr<DumpRegisterWorkerData> data);
Expand Down
Loading
Loading