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

cmake build rework #93

Merged
merged 6 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
96 changes: 3 additions & 93 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
REPO_NAME: vk_video_samples

jobs:
vk_video_decoder-linux:
vk_video_samples-linux:
strategy:
matrix:
platform: [linux-x86_64, linux-x86]
Expand Down Expand Up @@ -56,103 +56,14 @@ jobs:
- name: Build
shell: bash
run: |
cd vk_video_decoder
bash ./update_external_sources.sh
mkdir BUILD
cd BUILD
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j

vk_video_encoder-linux:
strategy:
matrix:
platform: [linux-x86_64, linux-x86]
runs-on: ubuntu-22.04

env:
TERM: dumb

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set environment variables
run: |
echo "DESTDIR=$REPO_NAME-release" >> $GITHUB_ENV

- name: Set i386 environment variables
if: matrix.platform == 'linux-x86'
run: |
echo "CC=cc -m32" >> $GITHUB_ENV
echo "CXX=c++ -m32" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig/" >> $GITHUB_ENV

- name: Install dependencies
run: |
sudo apt update
sudo apt install --assume-yes --no-install-recommends valgrind python3-pip ninja-build
sudo apt install cmake
sudo apt install libx11-dev libwayland-dev

- name: Install i386 dependencies
if: matrix.platform == 'linux-x86'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install gcc-multilib g++-multilib libc6-dbg:i386
# hack to avoid that zlib x64 gets picked up
sudo apt remove --assume-yes zlib1g-dev

- name: Build
shell: bash
run: |
bash ./vk_video_decoder/update_external_sources.sh
cd vk_video_encoder
mkdir BUILD
cd BUILD
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j

vk_video_decoder-win:
strategy:
matrix:
platform: [windows-x64, windows-x86]
runs-on: windows-latest

steps:
- name: Set up X86 MSVC environment
if: matrix.platform == 'windows-x86'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: "x86"
- name: Checkout code
uses: actions/checkout@v3

- name: Set environment variables
run: echo "DESTDIR=$Env:REPO_NAME-release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append

- name: Install dependencies
run: |
choco install --yes zip

- name: Install python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install cmake
run: choco install cmake

- name: Build
run: |
./vk_video_decoder/update_external_sources.bat
cd vk_video_decoder
mkdir BUILD
cd BUILD
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j

vk_video_encoder-win:
vk_video_samples-win:
strategy:
matrix:
platform: [windows-x64, windows-x86]
Expand Down Expand Up @@ -184,8 +95,7 @@ jobs:

- name: Build
run: |
./vk_video_decoder/update_external_sources.bat
cd vk_video_encoder
./update_external_sources.bat
mkdir BUILD
cd BUILD
cmake -DCMAKE_BUILD_TYPE=Debug ..
Expand Down
36 changes: 34 additions & 2 deletions vk_video_encoder/BUILD.md → BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file in this repository for mo

$ git clone $VULKAN_VIDEO_GIT_REPO

APP_INSTALLED_LOC=$(pwd)/"vk_video_samples/vk_video_decoder"
APP_INSTALLED_LOC=$(PWD)/"vk_video_samples/vk_video_encoder"

## Building On Windows
Expand Down Expand Up @@ -71,7 +72,7 @@ Windows 10 or Windows 11 with the following software packages:
### Windows Build - Microsoft Visual Studio

1. Open a Developer Command Prompt for VS201x
2. Change directory to `<APP_INSTALLED_LOC>` -- the vk_video_encoder root of the cloned git repository
2. Change directory to `<APP_INSTALLED_LOC>` -- the root of the cloned git repository
3. Run `update_external_sources.bat` -- this will download and build external components
4. Create a `build` directory, change into that directory, and run cmake and build as follows:

Expand Down Expand Up @@ -122,7 +123,7 @@ It should be straightforward to adapt this repository to other Linux distributio

5. Run cmake to configure the build:

# Encoder build configuration (please select Debug or Release build type):
# Decoder/Encoder build configuration (please select Debug or Release build type):
For example, for Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug ..

Expand All @@ -140,6 +141,36 @@ It is recommended to build the repository components with support for these disp
If it is necessary to build these modules without support for one of the display servers, the appropriate CMake option of the form `BUILD_WSI_xxx_SUPPORT` can be set to `OFF`.
See the top-level CMakeLists.txt file for more info.

### Linux Decoder Tests

Before you begin, check if your driver has Vulkan Video extensions enabled:

$ vulkaninfo | grep VK_KHR_video

The output should be:
VK_KHR_video_decode_queue : extension revision 1
VK_KHR_video_encode_queue : extension revision 1
VK_KHR_video_queue : extension revision 1

To run the Vulkan Video Decode sample from the build dir (for Windows change to build\install\Debug\bin\ or build\install\Release\bin\):

$ ./demos/vk-video-dec-test -i '<Video content file with h.264 or h.265 format>'
# -- Optional parameter is the max number of frames to be displayed with --c N.
# For example if the max frames required are 100, then:
$ ./demos/vk-video-dec-test -i /data/nvidia-l4t/video-samples/Palm_Trees_4Videvo.mov --c 100
# One can find some sample videos in h.264 and h.265 formats here:
# http://jell.yfish.us/

You can select which WSI subsystem is used to build the demos using a CMake option
called DEMOS_WSI_SELECTION.
Supported options are XCB (default), XLIB, WAYLAND, and MIR.
Note that you must build using the corresponding BUILD_WSI_*_SUPPORT enabled at the
base repository level (all SUPPORT options are ON by default).
For instance, creating a build that will use Xlib to build the demos,
your CMake command line might look like:

cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DDEMOS_WSI_SELECTION=XLIB

### Linux Encoder Tests

Before you begin, check if your driver has Vulkan Video extensions enabled:
Expand Down Expand Up @@ -204,3 +235,4 @@ files to be used as project files for QtCreator

Note that installing the WDK breaks the MSVC vcvarsall.bat build scripts provided by MSVC,
requiring that the LIB, INCLUDE, and PATHenv variables be set to the WDK paths by some other means

Loading