Skip to content

Commit

Permalink
Improve CI (vosen#39)
Browse files Browse the repository at this point in the history
* Use official GPU driver packages for building on Linux
* Start building on Windows
* Start uploading artifacts
  • Loading branch information
vosen authored Feb 21, 2021
1 parent 36514bd commit 4ed9ef8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,48 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

build_lin:
name: Build and publish (Linux)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
- name: Install GPU drivers
run: |
sudo apt-get install -y gpg-agent wget
wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | sudo apt-key add -
sudo apt-add-repository 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main'
sudo apt-get update
sudo apt-get install intel-opencl-icd intel-level-zero-gpu level-zero intel-media-va-driver-non-free libmfx1 libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev ocl-icd-opencl-dev
- name: Build
run: cargo build --workspace --verbose --release
- name: Rename to libcuda.so
run: |
mv target/release/libnvcuda.so target/release/libcuda.so
ln -s libcuda.so target/release/libcuda.so.1
- uses: actions/upload-artifact@v2
with:
name: Linux
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install intel compute runtime
run: |
mkdir neo
cd neo
wget https://github.com/intel/compute-runtime/releases/download/20.51.18762/intel-gmmlib_20.3.2_amd64.deb
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.5884/intel-igc-core_1.0.5884_amd64.deb
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.5884/intel-igc-opencl_1.0.5884_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/20.51.18762/intel-opencl_20.51.18762_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/20.51.18762/intel-ocloc_20.51.18762_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/20.51.18762/intel-level-zero-gpu_1.0.18762_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/20.51.18762/ww51.sum
sha256sum -c ww51.sum
wget https://github.com/oneapi-src/level-zero/releases/download/v1.0.22/level-zero-devel_1.0.22+u18.04_amd64.deb
wget https://github.com/oneapi-src/level-zero/releases/download/v1.0.22/level-zero_1.0.22+u18.04_amd64.deb
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.5884/intel-igc-opencl-devel_1.0.5884_amd64.deb
sudo dpkg -i *.deb
sudo apt update
sudo apt install ocl-icd-opencl-dev
target/release/libcuda.so
target/release/libcuda.so.1
build_win:
name: Build and publish (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build
run: cargo build --workspace --verbose
run: cargo build --workspace --verbose --release
- uses: actions/upload-artifact@v2
with:
name: Windows
path: |
target/release/nvcuda.dll
target/release/zluda_with.exe
target/release/zluda_dump.dll
# TODO(take-cheeze): Support testing
# - name: Run tests
# run: cargo test --verbose
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Run your application like this:
```

### Linux
A very recent version of [compute-runtime](https://github.com/intel/compute-runtime) and [Level Zero loader](https://github.com/oneapi-src/level-zero/releases) is required. At the time of the writing 20.45.18403 is the oldest recommended version.
You should install most recent run-time driver packages as outlined here: https://dgpu-docs.intel.com/installation-guides/index.html.
Run your application like this:
```
LD_LIBRARY_PATH=<ZLUDA_DIRECTORY> <APPLICATION> <APPLICATIONS_ARGUMENTS>
Expand All @@ -72,7 +72,8 @@ cargo build --release
```
in the main directory of the project.
### Linux
If you are building on Linux you must also symlink (or rename) the ZLUDA output library:
You should install most recent run-time an developer driver packages as outlined here: https://dgpu-docs.intel.com/installation-guides/index.html. Additionally, you should have `ocl-icd-opencl-dev` (or equivalent) installed.
If you are building on Linux you must also symlink (or rename) the ZLUDA output binaries after ZLUDA build finishes:
```
ln -s libnvcuda.so target/release/libcuda.so
ln -s libcuda.so target/release/libcuda.so.1
Expand Down

0 comments on commit 4ed9ef8

Please sign in to comment.