mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.83k stars 440 forks source link

Final image is black when using GPU #428

Closed vincentsiu closed 2 months ago

vincentsiu commented 3 months ago

I have successfully used my Windows desktop GPU (Nvidia RTX 3090Ti) to accelerate PBRT rendering. Now, I want to experiment with AWS EC2 (Windows) and its GPU options (Tesla M60, T4, or A10G Tensor Core) for running PBRT.

Using the simple example from https://pbrt.org/fileformat-v4, PBRT renders the sphere correctly without GPU acceleration. However, when using the GPU, the resulting image has the correct pixel count but appears entirely black. The verbose log shows no obvious errors.

I suspect the issue might be driver-related, as Tesla drivers are typically used for computation rather than rendering. I followed AWS documentation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html) to install both public NVIDIA drivers (which are intended for computation tasks) and GRID drivers (which are for professional visualization applications that render content such as 3d models), but the problem persists.

Does anyone have any suggestions on why the image is black when using the GPU on the cloud?

vincentsiu commented 2 months ago

More info about this issue and I am starting to think that may be something I used is no longer supporting new GPUs, or may be I have missed something very fundamental.

My setup:

I have tried -DCMAKE_CUDA_ARCHITECTURES=native or =89 to set the cuda architecture. But I am getting a black image with GPU rendering. With CPU, the scene is rendered correctly as expected.

This is the command I used to configure and build the project.

cmake .. -DCMAKE_BUILD_TYPE=Release -DPBRT_GPU_SHADER_MODEL=sm_89 -DPBRT_OPTIX7_PATH="C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.3.0"

cmake --build . --config Release

Does anyone have any idea what the culprit might be?

vincentsiu commented 2 months ago

I just to report that https://github.com/mmp/pbrt-v4/issues/429 solves my issue. It's definitely true that MSVC =14.40 breaks the GPU framework somehow. Downgrading to MSVC 14.39 solves it!

My setup are: Windows 11 GeForce RTX 4080 SUPER Optix 7.7 Cuda 12.4 MSVC 14.39

Thanks!