CMake: improve selection/filtering of archs of Intel GPU binaries #112669

Merged
Xavier Hallade merged 3 commits from xavierh/blender:cmake_ocloc_updates into main 2023-10-11 14:59:46 +02:00
Member

Here are a few commits to improve the cmake scripts so they don't break in case an unsupported target is listed.
The goal is to be able to add meteor lake iGPUs support gracefully.
Meteor Lake binaries are already building with current dependencies on linux, and missing an updated ocloc binary on Windows.
I've also renamed the CYCLES_ONEAPI_SPIR64_GEN_DEVICES cmake setting into CYCLES_ONEAPI_INTEL_BINARIES_ARCH so it better matches with what's used by the other backends.

Here are a few commits to improve the cmake scripts so they don't break in case an unsupported target is listed. The goal is to be able to add meteor lake iGPUs support gracefully. Meteor Lake binaries are already building with current dependencies on linux, and missing an updated ocloc binary on Windows. I've also renamed the CYCLES_ONEAPI_SPIR64_GEN_DEVICES cmake setting into CYCLES_ONEAPI_INTEL_BINARIES_ARCH so it better matches with what's used by the other backends.
Xavier Hallade added 2 commits 2023-09-21 14:11:00 +02:00
a4d6ea774e Cycles: oneAPI: rename target intel arch cmake setting
CYCLES_ONEAPI_SPIR64_GEN_DEVICES -> CYCLES_ONEAPI_INTEL_BINARIES_ARCH
so it's more aligned with the name for the other backends, such as
CYCLES_CUDA_BINARIES_ARCH.
17424107d6 Cycles: oneAPI: query graphics compiler for supported targets
In case a target isn't supported by the graphics compiler, it will be
filtered out from the target architectures to build for.
Xavier Hallade requested review from Brecht Van Lommel 2023-09-21 14:11:14 +02:00
Xavier Hallade requested review from Ray molenkamp 2023-09-21 14:11:15 +02:00
Xavier Hallade requested review from Sergey Sharybin 2023-09-21 14:11:23 +02:00
Xavier Hallade added the
Module
Render & Cycles
label 2023-09-21 14:11:30 +02:00
Xavier Hallade added this to the 4.0 milestone 2023-09-21 14:11:34 +02:00
Xavier Hallade added this to the Render & Cycles project 2023-09-21 14:11:39 +02:00
Ray molenkamp reviewed 2023-09-21 15:41:29 +02:00
CMakeLists.txt Outdated
@ -686,3 +686,2 @@
# https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html
# acm-g10 is the target for the first Intel Arc Alchemist GPUs.
set(CYCLES_ONEAPI_SPIR64_GEN_DEVICES "acm-g10" CACHE STRING "\
# 12.55.8=acm-g10 is compatible with all Arc Alchemist GPUs. 12.70.0 targets Meteor Lake iGPUs.
Member

Where do these magic numbers come from? I was expecting to find them on the page linked in the comment right above them, but that doesn't seem to be the case

Where do these magic numbers come from? I was expecting to find them on the page linked in the comment right above them, but that doesn't seem to be the case
Author
Member

the page linked is the most user friendly page to explain how to pick targets, using ocloc compile --help.
It doesn't say anything about the magic numbers (architecture versions), I'll ask that it gets improved.

I've retrieved the architecture version number using ocloc ids acm-g10 for Alchemist, and the Meteor Lake one is a bit more convoluted to get yet.. you get it from ocloc when compiling with ocloc for a given meteor lake device id, ie ocloc compile -device 0x7d40 -file test.c, it's also visible from 5569dac6d0/cmake/setup_platform_flags.cmake (L288)

That's maybe a lot of info, which options do you prefer:
a. no change here, I get the webpage improved
b. all the above explanation in the commit message
c. all the above explanation in a comment
d. something else?

the page linked is the most user friendly page to explain how to pick targets, using `ocloc compile --help`. It doesn't say anything about the magic numbers (architecture versions), I'll ask that it gets improved. I've retrieved the architecture version number using `ocloc ids acm-g10` for Alchemist, and the Meteor Lake one is a bit more convoluted to get yet.. you get it from ocloc when compiling with ocloc for a given meteor lake device id, ie `ocloc compile -device 0x7d40 -file test.c`, it's also visible from https://github.com/intel/compute-runtime/blob/5569dac6d0c80ec49b8dac118135ec9ec008cd4b/cmake/setup_platform_flags.cmake#L288 That's maybe a lot of info, which options do you prefer: a. no change here, I get the webpage improved b. all the above explanation in the commit message c. all the above explanation in a comment d. something else?
Author
Member

I went with c. in latest update.

I went with c. in latest update.
xavierh marked this conversation as resolved
Xavier Hallade force-pushed cmake_ocloc_updates from fd9e32e919 to ae390fd74e 2023-09-26 11:08:31 +02:00 Compare
Xavier Hallade force-pushed cmake_ocloc_updates from ae390fd74e to 1e3e21dccb 2023-09-26 11:15:32 +02:00 Compare
Xavier Hallade changed title from Cycles: improve cmake configuration for Intel GPU architectures selection to CMake: improve selection/filtering of archs of Intel GPU binaries 2023-09-26 19:12:27 +02:00
Brecht Van Lommel approved these changes 2023-10-05 20:05:29 +02:00
Brecht Van Lommel left a comment
Owner

The changes look fine to me.

This should not land before ocloc is upgraded.

The changes look fine to me. This should not land before ocloc is upgraded.
Author
Member

This should not land before ocloc is upgraded.

@brecht technically it can land now, with these changes, meteor lake target will be ignored on windows until an ocloc supporting it gets used. You prefer that it still waits for ocloc to be upgraded ?

> This should not land before ocloc is upgraded. @brecht technically it can land now, with these changes, meteor lake target will be ignored on windows until an ocloc supporting it gets used. You prefer that it still waits for ocloc to be upgraded ?

To be able to test that things work correctly on the buildbot before committing, we have to land the libs first. Because we do not have a mechanism to test lib updates there, only Git pull requests.

To be able to test that things work correctly on the buildbot before committing, we have to land the libs first. Because we do not have a mechanism to test lib updates there, only Git pull requests.
Xavier Hallade merged commit 82d86cbd8c into main 2023-10-11 14:59:46 +02:00
Xavier Hallade deleted branch cmake_ocloc_updates 2023-10-11 14:59:47 +02:00
Author
Member

Sergey has updated the libs, I'm triggering a daily package build now as AoT isn't used in patch builds.

Sergey has updated the libs, I'm triggering a daily package build now as AoT isn't used in patch builds.
Sign in to join this conversation.
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 Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#112669
No description provided.