Comments (4)
For NVIDIA GPUs, almost all of pbrt's rendering code (sampling, light source models, BSDF evaluation, etc.) runs on the GPU; it's almost entirely the same code as runs on the CPU. Then the CPU only does parsing the scene at the start, submitting work to the GPU, then reading back the final image and writing it to disk. So ideally all that could be done on Macs as well.
That said, it would be possible to send just the ray intersection work to the GPU. That would involve some communication overhead, though it might not be so bad on macs given unified memory. It wouldn't work well with the traditional CPU Integrator
s, since they are very much 'one ray at a time', while you'd want bigger batches of rays to send to the GPU. However, pbrt's WavefrontPathIntegrator
works on big batches of rays (and is the basis of the GPU port). However, it can also run on the CPU (give --wavefront
on the command line.) In wavefront/integrator.h
there's a WavefrontAggregate
interface and you can see in wavefront/aggregate.{h,cpp}
there is a CPUAggregate
.
So... you could implement a MetalAggregate
that took rays and did the intersection tests via Metal. In aggregate.cpp
you can see how CPUAggregate
wraps the functionality of the CPU BVH accelerator. It might not be a ton of work if you know Metal.
One issue is pipelining: the CPU would be idle while the GPU did intersection tests and vice versa. So that might limit the performance benefit. But it would be interesting to try!
from pbrt-v4.
Thanks a lot for the clues. I'll take a look at it when I get the machine (I'll write a small Metal-based raytracer first, so that I can check how to optimize its efficiency in a small code base first).
from pbrt-v4.
I don't know anything about Metal so can't say. What is the state of apple's C++ support on the GPU?
from pbrt-v4.
Apple helped write the Metal backend for the Blender Cycles renderer, which is said to have good performance increases in the M3. I'll be buying a Mac Studio later this semester, when the M3 model is announced (I guess June or so), not sure if I'll be getting the Max or the Ultra model (it will depend on the money, as usual). From your comment about "C++ support on the GPU", I'm guessing that your GPU implementation does much more than just accelerating raytracing. Metal can compile code, but I'm not sure what complexity you require.
from pbrt-v4.
Related Issues (20)
- Equation 14.24 seems missing from the online version of the pbrt-v4 book HOT 1
- Request: support light source definition via IES data HOT 1
- using --pixelstats in conjunction with --outfile do not work as expected
- Specify Volume with Transform and Camera Inside Volume in a Scene File
- PBRT hangs while rendering certain scenes with subsurface materials from a certain sample rate and higher
- Spectral range in SpectralFilm is overruled by constants in spectrum.h
- [Ubuntu] Unable to build TEV; uintptr_t not declared in scope.
- Illegal memory was encountered when mixed textures are used.
- build pbrt in Windows with CUDA errors HOT 3
- Denoiser not being initialized for OptiX 8.0.0
- GPU compiling error with -DPBRT_FLOAT_AS_DOUBLE HOT 1
- Periodic Radiance Values for Spectral Render
- spectrum.h not defined in the pbrt/base
- gpu runs failing: Invalid PTX input HOT 1
- Build issue vs 2022 cuda 12.5 optix 7.7 win 11 HOT 3
- Final image is black when using GPU HOT 2
- GPU rendering not working with MSCV Version 14.40 and newer
- A question about CUDA constant memory initialization. HOT 1
- Trouble replicating Radiance results with diffusive materials HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbrt-v4.