Skip to content

Commit 9d4a887

Browse files
committed
fix: remove avx2 requirement for linux
1 parent 8a5bf9f commit 9d4a887

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ If all goes to plan, a folder called 'staging' has been created with everything
9696

9797
-DUSE_SYSTEM_CEF=OFF - (Linux only, default ON) use the version of CEF from your OS. This expects to be using builds from https://launchpad.net/~casparcg/+archive/ubuntu/ppa
9898

99-
-DENABLE_AVX2=ON (Linux only, default ON) Enable the AVX and AVX2 instruction sets (requires a CPU that supports it)
99+
-DENABLE_AVX2=ON (Linux only, default OFF) Enable the AVX and AVX2 instruction sets (requires a CPU that supports it)
100100

101101
-DDIAG_FONT_PATH - Specify an alternate path/font to use for the DIAG window. On linux, this will often want to be set to an absolute path of a font
102102

CHANGELOG.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
CasparCG 2.5.0 Stable
22
==========================================
33

4-
### Important
5-
6-
We recommend running CasparCG 2.5 on CPUs which support AVX2. Officially Chrome claims to require AVX2, and it is required for some of our in-progress HDR support.
7-
Intel CPUs based on Haswell or later support this, which were first released to consumers in 2013, or 2014 for servers.
8-
9-
Starting with CasparCG 2.6, this will become a requirement
10-
114
### Core
125
##### Improvements
136
* Initial support for HDR. This is limited to a subset of producers and consumers at this stage.

src/CMakeModules/Bootstrap_Linux.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set(ENABLE_HTML ON CACHE BOOL "Enable CEF and HTML producer")
1515
set(USE_STATIC_BOOST OFF CACHE BOOL "Use shared library version of Boost")
1616
set(USE_SYSTEM_CEF ON CACHE BOOL "Use the version of cef from your OS (only tested with Ubuntu)")
1717
set(CASPARCG_BINARY_NAME "casparcg" CACHE STRING "Custom name of the binary to build (this disables some install files)")
18-
set(ENABLE_AVX2 ON CACHE BOOL "Enable the AVX2 instruction set (requires a CPU that supports it)")
18+
set(ENABLE_AVX2 OFF CACHE BOOL "Enable the AVX2 instruction set (requires a CPU that supports it)")
1919

2020
# Determine build (target) platform
2121
SET (PLATFORM_FOLDER_NAME "linux")
@@ -137,11 +137,12 @@ IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x64|x86_64|amd64|e2k)")
137137
ADD_COMPILE_OPTIONS (-mavx)
138138
ADD_COMPILE_OPTIONS (-mavx2)
139139
ENDIF ()
140+
ELSE ()
141+
ADD_COMPILE_DEFINITIONS (USE_SIMDE) # Enable OpenMP support in simde
142+
ADD_COMPILE_DEFINITIONS (SIMDE_ENABLE_OPENMP) # Enable OpenMP support in simde
143+
ADD_COMPILE_OPTIONS (-fopenmp-simd) # Enable OpenMP SIMD support
140144
ENDIF ()
141145

142-
ADD_COMPILE_DEFINITIONS (USE_SIMDE) # Enable OpenMP support in simde
143-
ADD_COMPILE_DEFINITIONS (SIMDE_ENABLE_OPENMP) # Enable OpenMP support in simde
144-
ADD_COMPILE_OPTIONS (-fopenmp-simd) # Enable OpenMP SIMD support
145146
ADD_COMPILE_OPTIONS (-fnon-call-exceptions) # Allow signal handler to throw exception
146147

147148
ADD_COMPILE_OPTIONS (-Wno-deprecated-declarations -Wno-write-strings -Wno-multichar -Wno-cpp -Werror)

src/modules/decklink/consumer/config.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,16 @@ configuration parse_xml_config(const boost::property_tree::wptree& ptree,
121121
<< msg_info(L"The decklink consumer only supports rgba output on 8-bit channels"));
122122
}
123123

124+
if (config.pixel_format != configuration::pixel_format_t::rgba) {
124125
#ifdef WIN32
125-
if (!CHECK_INSTRUCTION_SUPPORT(__IA_SUPPORT_VECTOR256, 0) &&
126-
config.pixel_format != configuration::pixel_format_t::rgba) {
127-
CASPAR_THROW_EXCEPTION(user_error()
128-
<< msg_info(L"Your cpu does not support the features needed for yuv output"));
129-
}
126+
if (!CHECK_INSTRUCTION_SUPPORT(__IA_SUPPORT_VECTOR256, 0)) {
127+
#else
128+
if (!__builtin_cpu_supports("avx2")) {
130129
#endif
130+
CASPAR_THROW_EXCEPTION(user_error()
131+
<< msg_info(L"Your cpu does not support the features needed for yuv output"));
132+
}
133+
}
131134
}
132135

133136
config.primary = parse_output_config(ptree, format_repository);

src/modules/decklink/consumer/v210_strategies.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
#include "../StdAfx.h"
2323

24+
// Force this file to compile with avx2, as it has been crafted with intrinsics that require it.
25+
#pragma GCC target("avx2")
26+
2427
#ifdef USE_SIMDE
2528
#define SIMDE_ENABLE_NATIVE_ALIASES
2629
#include <simde/x86/avx2.h>

0 commit comments

Comments
 (0)