GPU - LuxRender Wiki
Luxrender GPL Physically Based Renderer

GPU

Personal tools

From LuxRender Wiki

Jump to: navigation, search

One of the most exciting features in LuxRender for many users is GPU acceleration. LuxRender uses the open GPGPU computing standard OpenCL to allow a variety of "compute devices" (such as graphics cards) in your system to accelerate the render process. The purpose of this page is to help inform users as to the features and status of GPU support in LuxRender.

GPU support is still a work in progress. In the current stable release, v1.1, GPU acceleration is available for the path tracing integrator. There is also an experimental, pure GPU renderer included in development builds.

Contents

Practical use for OpenCL in fast rendering

It is possible to have fast, GPU-accelerated renders resulting in even x10 speedup (good CPU versus dual GPU computer), with following practical pros/cons:

  • + Massive speed, e.g. 4 minutes per frame 1920x1200 pixel, in good quality, for medium-complex outdoor scene on 3*Radeon7950 card
  • + works with animations
  • + works for all operating systems
  • + works on AMD cards too (not just NVidia like with CUDA)
  • - you can use only basic materials for now - others will be replaced with simple Matte material (there will be a warning shown in the console)
  • - The pure GPU renderer (Path OpenCL) is still a work in progress and may have some bugs - just remember to use the latest version and check the bug tracker to avoid possible bugs
  • - At the beginning of the render, scene setup time can be long (e.g. 30 seconds), especially on AMD cards

To use this method - fully accelerated OpenCL rendering, you must select the SLGRenderer rendering mode and the path surface integrator. Check your exporter documentation for more information.

Introduction to OpenCL

OpenCL is an open specification for computing on "heterogeneous" devices. This means you can target the various processing devices in the system simply as an "OpenCL device" and use them for your computation task, regardless as to what kind of device they actually are. In most real-world situations, that device is a graphics card. However, you can also target the main CPU of a computer. This allows a fallback for OpenCL-enabled applications on systems that do not support OpenCL, as well as allowing a process to pull all resouces of the system at once if need be. An OpenCL device can theoretically be any general-purpose computing device in the machine, not just the CPU or GPU. it could be another GPU not attatched to any displays, or it could be a special acceleration card, such as Cell processor card.

Hybrid Rendering

Currently, LuxRender's GPU rendering uses a CPU/GPU hybrid renderer.

The problem with using OpenCL is that some functions are difficult to implement within its code. One possible solution is to use a powerful OpenCL device (usually the machine's graphics card) to handle the brute-force work being fed to it by the regular CPU. This is how LuxRender's hybrid renderer works. The CPU handles most of the tasks of the render, such as running the interface, sampling rays, managing the image buffer and effects, etc. The GPU handles the heavy-lifting part of rendering, figuring out which pieces of geometry the ray hit. This allows nearly all the features of a CPU renderer, while running at 2-3 times the speed.

However, there is a flip-side. While a CPU/GPU hybrid can achieve 2-3x the speed of a pure CPU render, a renderer written entirely using OpenCL can achieve far greater speed increases, on the order 5-10x or more.

Pure GPU Rendering (development versions)

LuxRender 1.3 dev versions include the new SLGRenderer, which packs SmallLuxGPU directly into LuxRender, complete with automatic material and light translation. This mode offers significantly improved performance compared to the hybrid renderer, but requires the entire scene to fit in GPU memory. In addition, not all materials and textures are supported in this mode.

Getting Started with GPU in LuxRender

To set up GPU rendering, you will need to specify the hybrid renderer in the scene file. Most exporters have an option to set this up for you. When using the hybrid renderer, the path and bidirectional surface integrators are available. It is important to remember that the bidirectional integrator is currently still an experimental work in progress, so its results may not match the results from the normal bidirectional integrator, often to the point of just being horribly wrong. It also does not support light strategies aside from one-uniform.

Generally, you should stick to the path integrator when using hybrid rendering for production use. Also, bear in mind that the hybrid renderer currently supports only the basic mesh shape primitive. It does not support instancing, microtriangle displacement, or mathematically defined shapes (such as the geometric sphere primitive).

System Requirements

Nvidia

GPU rendering requires a GeForce 200-series or newer card, or equivalent Quadro card. Tesla support has not been tested, but is believed to work, at least with LuxRender 1.1+.

Note that older or lower-end cards may lack the raytracing performance needed for the hybrid renderer to be faster than a pure CPU renderer. This is primarily a limitation of the technology at the time/price-range, and is not likely to improve in the future.

Using the latest available drivers is strongly recommended for best performance and stability!

AMD/ATI

You will need an HD 5000 series or newer card, or equivalent FirePro model. The HD 4000 series cards are not supported. This is not due to a lack of support from LuxRender, but rather a lack of proper driver support by AMD.

Using the latest available drivers is strongly recommended for best performance and stability!

Troubleshooting

LuxRender seems to not render anything, I have blank (checker) or black screen in Blender

Images can take slow to update, you can configure it: GPU_in_blender - update speed options (it is same for GPU and regular render modes), or simply wait longer (10 sec - 2 minutes depending on mode), or switch to LuxGUI renderer and look at the results in GUI window.

LuxRender has started, but I get a black screen, and there are no log warnings

Several users have reported issues with setting the OpenCL work group size to 0, which is supposed to be the auto-detect mode. Setting it manually to 64 seems to work around the issue. Also, this can happen when using an ATI HD 4000 series card. While these cards technically support OpenCL, AMD has neglected to support several features on HD 4000 series cards in their recent drivers, and these features are required for running LuxRender. See the AMD/ATI section above

I have multiple graphics cards, but LuxRender will only use one

This was a known limitation in the old v0.8 release. This should not be an issue with v1.1+ unless you specifically tell LuxRender to use a single device.

LuxRender's log does not show my GPU as being found, even though I have a supported card

By default, LuxRender will target OpenCL platform "0". While this is probably the platform that contains your graphics card, it may not be. You can try increasing the OpenCL Platform setting in the exporter/scene file by 1 until the graphics card is used.

Hybrid is slower than the CPU renderer! Why!?

Being a hybrid CPU/GPU renderer, LuxRender has to deal with some overhead going back and forth between the CPU and GPU. On a simple scene, or with a slow GPU, this overhead may be larger than the speedup from the GPU, resulting in a slower overal render speed.

The GPU efficiency stat in LuxRender does not match the load reported by my graphics driver

The load shown in the LuxRender GUI is not the computation load on the card as a whole. Rather, it shows the percentage of time that LuxRender is able to keep the GPU fed with rays to trace. In other words, it shows how LuxRender is balancing use between the CPU and the GPU. Since this is specific subset of the GPU's total load, and is only from one application, it will not match what your driver reports. Furthermore, remember that LuxRender is a hybrid CPU/GPU renderer. That means that there's a good chance your GPU is being limited by your CPU (or possibly vice versa). It is unlikely that both your normal CPU load and your actual GPU load will both reach 100%.

SLGRenderer says it is only using 2 threads? I have more cores than that!

The "threads" stat shows the number of OpenCL threads being used. You can think of these as individual OpenCL "jobs". These are generally 1 per OpenCL device. By default, SGLRenderer uses GPU and CPU devices, so you should see 2 threads. One is the worker for your GPU, one is the worker for your CPU. Your CPU's OpenCL driver will automatically spawn the proper number of real threads for its work. If you have disabled CPU use or don't have an OpenCL CPU driver installed, you will just see 1 thread. Similarly, if you have several graphics cards, you will see more threads.

I have strange black regions, or wrong shadows or glitches

There are many possible causes. Some are specific to GPU rendering, and some are not: