rtcNewDevice(3)
rtcNewDevice(3) π
okay bestie, we're in the Embree Ray Tracing Kernels 4 manual and this is the page about rtcNewDevice(3) β the lil function that spawns a whole device for you. it's giving main character energy, fr fr. π
β¨ NAME β¨
rtcNewDevice β creates a new device π¦
β¨ SYNOPSIS β¨
#include <embree4/rtcore.h>
RTCDevice rtcNewDevice(const char* config);
β¨ DESCRIPTION β¨
so this function literally creates a brand new device for you to use for CPU ray tracing, and hands you back a handle to it. that's it, that's the vibe. β¨
the device object is reference counted, and it starts life with an initial reference count of 1. when you're done with it you can let it go using the rtcReleaseDevice API call. π«Ά
here's the tea tho: the device object is basically a class factory for every other object type. every single object you create from the device (scenes, geometries, etc.) holds its own reference to that device β so bestie, the device will not be destroyed unless all those objects get destroyed first. it's holding on for dear life π
and likeβ¦ objects are only compatible if they belong to the same device. you can't make a geometry in one device and attach it to a scene that was created with a different device. no cross-device situationships allowed, periodt. π
you can also pass a configuration string (the config argument) to the device construction. that config string can be NULL if you just want the default configuration. easy.
the config options that are supported π
threads=[int]β specifies how many build threads to use. a value of0enables all detected hardware threads. by default, all hardware threads are used. βuser_threads=[int]β sets the number of user threads that are allowed to join and participate in a scene commit usingrtcJoinCommitScene. the tasking system will only usethreads-user_threadsmany worker threads, so if your app wants to solely use its own threads to commit scenes, just setthreadsequal touser_threads. heads up: this option only has effect with the Intel(R) Threading Building Blocks (TBB) tasking system.set_affinity=[0/1]β when enabled, build threads get affinitized to hardware threads. this one is disabled by default on standard CPUs, and enabled by default on Xeon Phi Processors. πstart_threads=[0/1]β when enabled, the build threads get started upfront. lowkey useful for benchmarking so you can exclude thread creation time from your numbers. this option is disabled by default.isa=[sse2,sse4.2,avx,avx2,avx512]β use the specified ISA. by default the ISA is selected automatically. π€max_isa=[sse2,sse4.2,avx,avx2,avx512]β configures the automated ISA selection to use maximally the specified ISA.hugepages=[0/1]β enables or disables usage of huge pages. under Linux huge pages are used by default, but under Windows and macOS they're disabled by default. πenable_selockmemoryprivilege=[0/1]β when set to1, this enables theSeLockMemoryPrivilegeprivilege, which is required to use huge pages on Windows. this option only has an effect under Windows and is ignored on other platforms. see Section [Huge Page Support] for more details.verbose=[0,1,2,3]β sets the verbosity of the output. when set to0, no output is printed by Embree; when set to a higher level, more output is printed. by default Embree does not print anything on the console. (silent queen π)frequency_level=[simd128,simd256,simd512]β specifies the frequency level the application wants to run on, which can be either:- a)
simd128β to run at highest frequency - b)
simd256β to run at AVX2-heavy frequency level - c)
simd512β to run at heavy AVX512 frequency level. when some frequency level is specified, Embree will avoid doing optimizations that may reduce the frequency level below the level specified. e.g. if your app does not use AVX instructions, setting βfrequency_level=simd128β will cause some CPUs to run at highest frequency, which may result in higher application performance if you do much shading. if your application heavily uses AVX code, you should best set the frequency level tosimd256. per default Embree tries to avoid reducing the frequency of the CPU by setting thesimd256level only when the CPU has no significant down clocking. πΈ
- a)
different configuration options should be separated by commas, e.g.:
rtcNewDevice("threads=1,isa=avx");
β¨ EXIT STATUS β¨
on success, it returns a handle of the created device. π
on failure, it returns NULL as the device and sets a per-thread error code that you can query using rtcGetDeviceError(NULL). π (so like, always check, bestie, no cap.)
β¨ SEE ALSO β¨
- [rtcRetainDevice]
- [rtcReleaseDevice]
- [rtcNewSYCLDevice]
okay that's the whole page, you ate it π
β¨ this was rtcNewDevice(3) from the Embree Ray Tracing Kernels 4 manpage β go forth and build your device, iykyk π¦ππ
π¦ where this page comes from
- alpine 3.24: embree-doc 4.4.1-r0 Β· Apache-2.0
- arch rolling: embree 4.4.1-1 Β· Apache-2.0
- fedora 43: embree 4.4.1-1.fc43 Β· Apache-2.0
- fedora 44: embree 4.4.1-1.fc44 Β· Apache-2.0
- nixpkgs unstable: embree 4.4.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms