Creator: Add CPU check on startup #118054
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118054
Loading…
Reference in New Issue
No description provided.
Delete Branch "LazyDodo/blender:tmp_cpu_check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds an sse42 cpu check on startup for both linux and windows,
mac has been excluded, since afaik there are no intel based macs that do
not support SSE42.
The way this works is, we count on the OS to initialize the shared
libraries in the order they are linked (which currently holds true)
before calling the initialization code in the main executable. This
allows us to check the CPU before running any of the code in the main
executable that might not be supported by the current isa.
Changing those build flags is for a future PR, but for now and for
future reference: blender_cpu_check must be build without optimized CPU
flags so it'll be able to run on older CPUs.
some code has been duplicated from blenlib, there's really no way around
that since we cannot link blenlib as it may be build with optimized cpu
flags.
Windows currently gives a popup to inform the user, while linux reports
to the console, there may be better ways to communicate with linux users
with perhaps some generic GUI popup, but I'm unaware of these and will
leave this for the linux platform maintainer to polish.
Part of #116592
@ -0,0 +22,4 @@
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
//if (!BLI_cpu_support_sse41())
Needs to be updated after eaeaf8322cae
@blender-bot build
@blender-bot build
WIP: Add CPU check on startupto Add CPU check on startupadded @Farsthary as a reviewer, just to validate my assumptions about sse42 support on mac.
Blender minspec macOS version (Big Sur) supports Macs from year 2014-2015 and later. Apple used to have Intel CPUs without SSE4.2 support, but that was year 2009 and earlier. So this is pretty safe.
Correct, all currently supported intel macs have SSE 4.2 instruction set
@ -327,6 +327,30 @@ if(WITH_PYTHON_MODULE)
else()
add_executable(blender ${EXETYPE} ${SRC})
if(NOT APPLE)
This can be a CMake option, which has the advantage there is a single, obvious place to adjust the defaults, it also means we can limit this more easily exclude certain architectures, any further use can check
WITH_CPU_CHECK
directly.e.g.
That is much nicer, done!
@ -10,3 +10,3 @@
#include <cstring>
#ifdef WIN32
#if defined(WIN32)
This change seems unnecessary?
@ -0,0 +64,4 @@
}
#ifdef _MSC_VER
extern "C" __declspec(dllexport) void cpu_check_win()
Name
cpu_check_win32
to differentiate this from windowing, followsblender_launcher_win32.c
& naming elsewhere.@blender-bot build
Thanks for the patch, code looks good to me.
Add CPU check on startupto Creator: Add CPU check on startup