Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ build
*.*proj
*.*advi*
config/
raisr/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ SET(CMAKE_REQUIRED_FLAGS "-march=native")
check_cxx_source_runs("
#include <immintrin.h>
int main(int argc, char** argv) {
_Float16 data[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
_Float16 output[16];
_Float16 data[32] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
_Float16 output[32];
__m512h a = _mm512_loadu_ph(data); // avx512fp16
__m512h b = _mm512_loadu_ph(data);
__mmask32 mask = _mm512_cmp_ph_mask(a, b, _CMP_EQ_OQ); // avx512fp16
Expand Down
22 changes: 12 additions & 10 deletions How to build.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ To build this project you will need:
- Linux based OS
- For CPU tested and validated on Ubuntu 18.04 LTS, Ubuntu 22.04 and CentOS 7.9
- For GPU tested and validated on Intel® Data Center GPU Flex 170 with Ubuntu 22.04 LTS(5.15 LTS kernel)
- [Docker](https://www.docker.com/)
- [Docker](https://www.docker.com/)
- Intel Xeon hardware which supports Intel AVX512 (Skylake generation or later)
- Compiler (clang++, g++, icc), and enabling AVX512-FP16 on Sapphire Rapiads needs:
- clang++ version 14.0.0 or later
- g++ version 12.1.0 with binutils 2.38 or later
- icc version 2021.2 or later
- Cmake version 3.14 or later
- Cmake version 3.14 or later
- Intel® Integrated Performance Primitives (Intel® IPP) (Stand-Alone Version is the minimum requirement)
- zlib1g-dev, pkg-config (The pkg-config is used to find x264.pc/x265.pc in specific pkgconfig path.)

We provide 3 ways to build the Intel VSR with FFmpeg environment:
- build docker images with dockerfiles(only for CPU).
- build docker images with dockerfiles(both CPU and GPU).
- build via [scripts](https://github.com/OpenVisualCloud/Video-Super-Resolution-Library/tree/master/scripts)(only for CPU).
- build manually(both CPU and GPU).

# Build Docker Images.

We provide 3 Dockerfile for Intel Xeon platforms: Ubuntu18.04, Ubuntu22.04 and CentOS7.9. You can refer to below steps to build docker images.
We provide 3 Dockerfile for Intel Xeon platforms: Ubuntu18.04, Ubuntu22.04 and CentOS7.9, and 1 Dockerfile with Ubuntu22.04 for Intel Flex GPU. You can refer to below steps to build docker images.
## Setup docker proxy as follows if you are behind a firewall:
```
sudo mkdir -p /etc/systemd/system/docker.service.d
Expand All @@ -32,13 +32,15 @@ sudo systemctl restart docker
## build docker image via docker_build.sh
The usage of the script is as follows
```
./docker_build.sh <OS> <OS_VERSION>
./docker_build.sh <PLATFORM> <OS> <OS_VERSION>

./docker_build.sh ubuntu 22.04 #for building Ubuntu22.04
./docker_build.sh ubuntu 18.04 #for building Ubuntu18.04
./docker_build.sh centos 7.9 #for building CentOS7.9
./docker_build.sh xeon ubuntu 22.04 #for building Xeon platform with Ubuntu22.04
./docker_build.sh xeon ubuntu 18.04 #for building Xeon platform with Ubuntu18.04
./docker_build.sh xeon centos 7.9 #for building Xeon platform with CentOS7.9
./docker_build.sh flex ubuntu 22.04 #for building Flex platform with Ubuntu22.04
```
If the image is built successfully, you can find a docker image named `raisr:ubuntu22.04` or `raisr:ubuntu18.04` or `raisr:centos7.9` with command `docker images`
If the image is built successfully, you can find a docker image named `raisr-xeon:ubuntu22.04` or `raisr-xeon:ubuntu18.04` or `raisr-xeon:centos7.9` or `raisr-flex:ubuntu22.04` with command `docker images`
Please note it needs to add `--privileged --device /dev/dri` option to access GPU hardware in docker container during run raisr-flex docker container.

# Build via [scripts](https://github.com/OpenVisualCloud/Video-Super-Resolution-Library/tree/master/scripts)
If the user would prefer not to use Docker, you can follow the steps below to setup enviroment: \
Expand Down Expand Up @@ -66,7 +68,7 @@ The x264/x265 libraries can be installed via apt on Ubuntu OS or built and insta

### Build and install x264/x265 from source code(Option-2)

#### Build and install x264
#### Build and install x264

`git clone https://github.com/mirror/x264 -b stable --depth 1` \
`cd x264` \
Expand Down
18 changes: 2 additions & 16 deletions Library/Raisr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static bool machine_supports_feature(MachineVendorType vendor, ASMType type)
bool ret = false;
unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;

if (vendor == INTEL ) {
if (vendor == INTEL || vendor == AMD ) {
__get_cpuid_count(0x7, 0x0, &eax, &ebx, &ecx, &edx);

if (type == AVX512_FP16) {
Expand All @@ -98,20 +98,6 @@ static bool machine_supports_feature(MachineVendorType vendor, ASMType type)
}
}
}
else if (vendor == AMD)
{
__get_cpuid_count(0x7, 0x0, &eax, &ebx, &ecx, &edx);
if (type == AVX512_FP16) {
ret = false;
} else if (type == AVX512) {
ret = false;
} else if (type == AVX2) {
if ( (ebx >> 5) & 0x1)
{
ret = true;
}
}
}
return ret;
}

Expand Down Expand Up @@ -898,7 +884,7 @@ __m256i inline modulo_imm( __m256i a, int b) {
void inline write_pixeltype(int c, __m256i gPatchMargin_epi32, __m256i partone, int* out) {
__m256i b = _mm256_sub_epi32( _mm256_add_epi32(_mm256_set1_epi32(c), _mm256_setr_epi32(0,1,2,3,4,5,6,7)), gPatchMargin_epi32);
__m256i pixelType_epi32 = _mm256_add_epi32( partone, modulo_imm(b, gRatio) );
_mm256_storeu_epi32(out, pixelType_epi32);
_mm256_storeu_si256((__m256i *)(out), pixelType_epi32);
}

RNLERRORTYPE processSegment(VideoDataType *srcY, VideoDataType *final_outY, BlendingMode blendingMode, int threadIdx)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Enhanced RAISR is provided as an FFmpeg plugin inside of a Docker container(Dock

- Feb 2024 : AWS and Intel announced collaboration to release Intel Library for VSR on AWS Cloud at the Mile High Video 2024 conference, technical details available at https://dl.acm.org/doi/10.1145/3638036.3640290

We have enhanced the public RAISR algorithm to achieve better visual quality and beyond real-time performance for 2x and 1.5x upscaling on Intel® Xeon® platforms and Intel® GPUs. The Intel Library for VSR is provided as an FFmpeg plugin inside of a Docker container to help ease testing and deployment burdens. This project is developed using C++ and takes advantage of Intel® Advanced Vector Extension 512 (Intel® AVX-512) where available and newly added Intel® AVX-512FP16 support on Intel® Xeon® 4th Generation (Sapphire Rapids) and added OpenCL support on Intel® GPUs.

## How to build
Please see "How to build.md" to build via scripts or manually.
Expand Down
10 changes: 8 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/sh
#!/bin/bash

# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2024-2025 Intel Corporation

set -ex -o pipefail

# Helpful when copying and pasting functions and debuging.
if printf '%s' "$0" | grep -q '\.sh'; then
IN_SCRIPT=true
Expand Down Expand Up @@ -33,7 +39,7 @@ build() (

if [ -f Makefile ]; then
# make -j
make install -j
make install -j
fi

cd ..
Expand Down
166 changes: 0 additions & 166 deletions docker/Dockerfile.centos7.9

This file was deleted.

Loading
Loading