Commit Graph

58 Commits

Author SHA1 Message Date
Brecht Van Lommel
60bec183cb Refactor: Cycles: Replace foreach() by range based for loops
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:05 +01:00
Brecht Van Lommel
d0c2e68e5f Refactor: Cycles: Automated clang-tidy fixups in Cycles
* Use .empty() and .data()
* Use nullptr instead of 0
* No else after return
* Simple class member initialization
* Add override for virtual methods
* Include C++ instead of C headers
* Remove some unused includes
* Use default constructors
* Always use braces
* Consistent names in definition and declaration
* Change typedef to using

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:55 +01:00
Xavier Hallade
2cfe69c07d Cycles: Fix error handling of BVH transfer to device
Previously, in case of a failure during BVH transfer, when running out
of memory for example, we could get an error such as "BVH failed to
migrate to the GPU due to Embree library error (no error)", because
embree error status was actually reset before being queried.
This commit fixes its propagation.

Pull Request: https://projects.blender.org/blender/blender/pulls/129022
2024-10-15 10:31:30 +02:00
Xavier Hallade
a1182e07b1 Build: upgrade Intel Graphics Compiler and ocloc on Linux
IGC 1.0.17384, ocloc 24.31.30508, which:
- add support for Battlemage and Lunar Lake GPUs
- recover from recent performance regression on Linux
- allow to drop older work-around
  (9d5164d472) and need for a patched
  version on Windows
- ocloc now needs "dg2,mtl" naming for fat binaries.

opencl-clang patches don't get applied anymore by igc build scripts
when llvm is not a git repository, hence I could also drop we can drop
current patch disabling patching.

I've only slightly pushed min-driver-version updates after carefull
testing, instead of jumping to the same version as ocloc as we use to.

Pull Request: https://projects.blender.org/blender/blender/pulls/127251
2024-09-12 09:11:56 +02:00
Xavier Hallade
56db2d393d Cycles: oneAPI: use ocloc 101.5972 on Windows
This new version of the graphics compiler solves a performance
regression on Arc, adds support for Battlemage and Lunar Lake GPUs, and
allows to drop older patch to build fat binaries with broad
compatibility.
This latter change requires using -device dg2,mtl naming instead of
passing architecture ids.

Pull Request: https://projects.blender.org/blender/blender/pulls/127371
2024-09-11 17:34:13 +02:00
Nikita Sirgienko
94c9898f41 Fix #124811: Cycles: oneAPI: no hair strands in viewport with Embree
oneAPI kernels preloading logic was letting un-needed kernels to be
compiled without features, which would then miss when these kernels
were needed later.

Pull Request: https://projects.blender.org/blender/blender/pulls/127114
2024-09-04 11:08:00 +02:00
Nikita Sirgienko
74c09b2e63 Cycles: oneAPI: Fix undefined behavior when embree fails initializing
Embree device pointer can end up being nullptr even when Embree on GPU is
expected to be used.  Previous implementation overlooked this possibility,
leading to a completely silent fallback to the non-Hardware ray-tracing path,
this commit fixes it.  We've noticed this as now Embree relies on a driver
component: https://github.com/intel/level-zero-raytracing-support that can
potentially be missing from a system.

Pull Request: https://projects.blender.org/blender/blender/pulls/124085
2024-07-03 14:13:01 +02:00
Xavier Hallade
4477641467 Cycles: oneAPI: Fix driver version check for future Intel GPU drivers
SYCL runtime currently relies on an internal driver behavior that will
break the driver version string returned by SYCL if it changes:
https://github.com/oneapi-src/unified-runtime/issues/1777
This will be fixed at SYCL runtime level but until we use a new enough
one, we need to add additional verifications to avoid blocking execution
on a driver that will change this internal behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/124084
2024-07-03 14:12:16 +02:00
Sergey Sharybin
b803d7fabb Fix: Command line Cycles render crash on multi-CUDA device
Since #118841 there are more cases where Cycles would check for the
graphics interop support. This could lead to a crash when graphics
interop functions are called without having active graphics context.

This change makes it so there is no graphics interop calls when doing
headless render. In order to achieve this the device creation is now
aware of the headless mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/122844
2024-06-07 17:53:44 +02:00
Nikita Sirgienko
8ee8d01711 Cycles: oneAPI: Fix Out-Of-Memory errors on some integrated GPUs 2024-05-29 21:57:13 +02:00
Campbell Barton
c5a27f011e Cleanup: spelling in comments 2024-05-29 12:49:07 +10:00
Nikita Sirgienko
759bb6c768 Cycles: oneAPI: Enable host memory migration
This enables scenes with all textures not fitting in GPU
memory to finally render. For scenes that are fitting,
no functional change or performance change is expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/122385
2024-05-28 19:04:19 +02:00
Attila Áfra
26c93c8359 Cycles: Enable OIDN 2.3 lazy device module loading
This enables the new lazy module loading behavior introduced in OIDN 2.3,
without breaking compatibility with older versions of OIDN (using separate
code paths).

Also, the detection of OIDN support for devices is now much cleaner, and
devices do not need to be matched by PCI address or device name anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/121362
2024-05-07 14:07:39 +02:00
Xavier Hallade
cbc7962a73 Cycles: Tune kernel sizes for oneAPI device
This brings a 1-3% performance improvement depending on the scenes, on
the Arc A770.
2024-04-04 16:04:13 +02:00
Xavier Hallade
98343c0c17 Build: Upgrade Intel Graphics Compiler to 1.0.15468 on Linux
This corresponds the latest stable LTS release:
https://dgpu-docs.intel.com/releases/LTS_803.29_20240131.html

Graphics compiler upgrades require increasing the mininum required
driver (compute-runtime) version to the corresponding one to guarantee
compatibility, which is XX.XX.27642.38 in this release, so we bump this
requirement accordingly.

Fixes #118713

Pull Request: https://projects.blender.org/blender/blender/pulls/118814
2024-02-28 18:24:30 +01:00
Xavier Hallade
18a20f373f Cycles: increase min Intel GPU driver version on Windows
With drivers 101.4972 to 101.5085, some Arc and Meteor Lake devices
ignore the prebuilt GPU binaries and since the addition of Meteor Lake
binaries, fail caching newly generated ones on Windows.
This got fixed in drivers 101.5186 so it's preferable to require these
new drivers to be used.
2024-01-31 12:49:30 +01:00
Stefan Werner
8a6f7640d6 Cycles: Make OIDN on GPU use the existing SYCL queue
There's already a queue from the Cycles rendering device, so let OIDN use the same instead of creating a new one.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115650
2023-12-07 14:16:21 +01:00
Brecht Van Lommel
e06561a27a Build: replace Blender specific DEBUG by standard NDEBUG
NDEBUG is part of the C standard and disables asserts. Only this will
now be used to decide if asserts are enabled.

DEBUG was a Blender specific define, that has now been removed.

_DEBUG is a Visual Studio define for builds in Debug configuration.
Blender defines this for all platforms. This is still used in a few
places in the draw code, and in external libraries Bullet and Mantaflow.

Pull Request: https://projects.blender.org/blender/blender/pulls/115774
2023-12-06 16:05:14 +01:00
Xavier Hallade
e317831a82 Cycles: oneAPI: adjust reported device capabilities
It notably adds driver version as it can be helpful when triaging
end-user issues.
2023-11-09 21:46:27 +01:00
Xavier Hallade
1161455084 Build: upgrade Intel Graphics Compiler on Linux
In order to speedup compilation, we upgrade IGC to 1.0.14828.26 along
with ocloc and the associated dependencies.
We also bump min-driver version accordingly to 26918.

Ref !114341
2023-11-02 22:27:38 +11:00
Xavier Hallade
ef80392721 Cycles: oneAPI: update windows ocloc to 101.4723
The first public Windows driver version with a higher number is
101.4824, so we bump the min-required driver version on Windows to this
one to ensure compatibility.
2023-10-11 14:47:48 +02:00
Nikita Sirgienko
56ff55ed09 Cycles: oneAPI: Resolve an compilation error in assert 2023-09-04 15:41:05 +02:00
Xavier Hallade
6a301cf07f Cycles: oneAPI: increase windows min driver requirement to 101.4644
101.4644 has been released 2023-08-15 and fixes the Windows specific
issue #109282.
2023-08-31 10:22:51 +02:00
Bastien Montagne
7c4f5b7dc6 Temp 'Fix' broken compilation from abab47a805.
Proper actual fix is obviously needed, but at least now Blender builds
again with oneAPI enabled...
2023-08-23 10:39:21 +02:00
Campbell Barton
f66fa32ada Cleanup: spelling in comments 2023-08-23 13:30:55 +10:00
Nikita Sirgienko
abab47a805 Cycles: oneAPI: Refactoring of local size choice logic 2023-08-22 19:04:16 +02:00
Xavier Hallade
1489c5a57b Merge branch 'blender-v3.6-release' 2023-06-23 13:12:58 +02:00
Xavier Hallade
6437c0c948 Cycles: oneAPI: avoid crashes from old drivers
During recent testing, the oldest 101.4032 (windows) and <25812 (linux)
drivers led to crashes during JIT compilation, so we bump the
requirement to newer 101.4313 and 25812.14 drivers that do incorporate
the required fixes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109281
2023-06-23 13:12:21 +02:00
Campbell Barton
c12994612b License headers: use SPDX-FileCopyrightText in intern/cycles 2023-06-14 16:53:23 +10:00
Xavier Hallade
23de320878 Cycles: fix multi-device rendering with oneAPI and Hardware Raytracing
Only Embree CPU BVH was built in the multi-device case. However, one
Embree GPU BVH is needed per GPU, so we now reuse the same logic as in
the other backends.

Pull Request: https://projects.blender.org/blender/blender/pulls/107992
2023-05-22 15:26:58 +02:00
Campbell Barton
bf36a61e62 Cleanup: spelling in comments & some corrections 2023-05-20 21:17:09 +10:00
Nikita Sirgienko
bafd82c9c1 Cycles: oneAPI: use local memory for faster shader sorting
Co-authored-by: Stefan Werner <stefan.werner@intel.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/107994
2023-05-17 11:07:57 +02:00
Xavier Hallade
5c57b9aa79 Cleanup: avoid warning on unused argument in cycles_device 2023-05-15 07:35:03 +02:00
Xavier Hallade
5ec2495550 Cycles: oneAPI: enable Hardware Raytracing for Raytrace/MNEE kernels
We do so if Embree 4.1+ is present.
2023-05-12 14:17:50 +02:00
Nikita Sirgienko
1dcc8e6ffa Fix #107356: Cycles: improve oneAPI error handling 2023-05-03 12:06:08 +02:00
Campbell Barton
6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
Nikita Sirgienko
0d9fa73b42 Cycles: oneAPI: Fix motion blur rendering for Embree GPU execution
CPU non-unified shared memory was used for shared geometry buffers.
For the Embree GPU case, we now create new geometry buffers on GPU instead.
2023-04-20 21:20:33 +02:00
Nikita Sirgienko
7ce10ebbbf Cycles: oneAPI: Remove excess quotes in a capabilities output 2023-04-20 11:09:16 +02:00
Campbell Barton
eb2867de90 Cleanup: spelling in comments 2023-04-19 08:02:41 +10:00
Xavier Hallade
4382a0b350 Cleanup: avoid warnings from gcc in oneAPI device compilation
When building using GCC and with Embree without GPU support, there were
a few unused variables and a non-defined macro.
2023-04-18 22:40:40 +02:00
Xavier Hallade
70892e82ac Cycles: oneAPI: use specialization constant to compile with/without Embree on GPU 2023-04-18 22:09:42 +02:00
Xavier Hallade
9821a2d397 Cycles: pass kernel features to get_bvh_layout_mask
This allows to selectively disable Hardware Raytracing in oneAPI
backend, depending on features used.
2023-04-18 22:09:42 +02:00
Nikita Sirgienko
3f8c995109 Cycles: add hardware raytracing support to oneAPI device
Updated Embree 4 library with GPU support is required for it to be
compiled - compatiblity with Embree 3 and Embree 4 without GPU support
is maintained.
Enabling hardware raytracing is an opt-in user setting for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/106266
2023-04-18 22:09:42 +02:00
Campbell Barton
266d8de687 Cleanup: spelling in comments 2023-02-03 12:41:01 +11:00
Xavier Hallade
8afcecdf1f Cycles: update Intel Graphics compiler to 101.4032 on Windows
A noticeable (>5%) performance regression in oneAPI backend came with
a501a2dbff. Updating to latest graphics
compiler from driver 101.4032 fixes it.

I've tested it with current min-supported drivers and it runs well but
since compatibility of graphics compiler with older drivers isn't
guaranteed, I'm also bumping the min-supported driver versions.

If end-users consider latest drivers too fresh to switch to (version
isn't released as stable on Linux as of today but should be before
Blender 3.5 release), CYCLES_ONEAPI_ALL_DEVICES=1 env variable can be
used.

Intel Graphics Compiler on Linux will be updated in a later commit
so we can then close D16984.

Reviewed By: sergey, LazyDodo
2023-01-23 19:36:34 +01:00
Nikita Sirgienko
858fffc2df Cycles: oneAPI: add support for SYCL host task
This functionality is related only to debugging of SYCL implementation
via single-threaded CPU execution and is disabled by default.
Host device has been deprecated in SYCL 2020 spec and we removed it
in 305b92e05f.
Since this is still very useful for debugging, we're restoring a
similar functionality here through SYCL 2020 Host Task.
2023-01-03 20:47:24 +01:00
Nikita Sirgienko
412642865d Cleanup: Resolve a warning for the ambiguity on the parenthesis in oneAPI code
No functional changes.
2022-11-24 18:05:02 +01:00
Xavier Hallade
454dd3f7f0 Cycles: fix up logic in oneAPI devices filtering
CYCLES_ONEAPI_ALL_DEVICES environment variable wasn't working as
intended after 305b92e05f.
2022-10-27 23:09:14 +02:00
Xavier Hallade
0cfac5b043 Cycles: oneAPI: migrate from deprecated APIs, require libSYCL 6.0+
sycl::info::device::ext_intel_* descriptors are deprecated,
replaced with sycl::ext::intel::info::device:: that are available from
6.0+, for which we now check version in CMake.
2022-10-21 15:36:49 +02:00
Xavier Hallade
305b92e05f Cycles: oneAPI: remove use of SYCL host device
Host device is deprecated in SYCL 2020 spec, cpu device or standard C++
should be used instead.
2022-10-21 15:36:48 +02:00