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.87k stars 448 forks source link

GPU related build and runtime problems #224

Open kyamant opened 2 years ago

kyamant commented 2 years ago

Using cmake 3.21.1, VS2019, CUDA 11.4, OptiX 7.2 on Win 10:

  1. Where exactly am I supposed to specify PBRT_OPTIX7_PATH, and to which specific directory of OptiX it needs to point (doc, include, SDK): I got by with hardcoding it in the cmakelists.txt but that can't be the appropriate place. I made it point to the parent of include but I'm not sure at all.
  2. Many C++ and nvcc warnings; too numerous to include
  3. The command line argument --gpu does not work; it needs single dash -gpu contrary to the comments
  4. App crashes with the arguments: -gpu pbrt-v4-scenes\killeroos\killeroo-simple.pbrt following a run with the arguments: pbrt-v4-scenes\killeroos\killeroo-simple.pbrt; need to perform a rebuild.
  5. PBRTOptions which is derived from BasicPBRTOptions, the debugger does not show the useGPU field that comes from the base class.
mmp commented 2 years ago
  1. Where exactly am I supposed to specify PBRT_OPTIX7_PATH, and to which specific directory of OptiX it needs to point (doc, include, SDK): I got by with hardcoding it in the cmakelists.txt but that can't be the appropriate place. I made it point to the parent of include but I'm not sure at all.

README.md says "It is necessary to manually set the cmake PBRT_OPTIX7_PATH configuration option to point at an OptiX installation". It turns out that include is in the top-level directory. Why did you hardcode it rather than specifying it when runnign cmake?

Many C++ and nvcc warnings; too numerous to include

There are unfortunately many warnings in the windows build, though I believe that most of them come from OpenEXR. Feel free to submit a PR with fixes.

The command line argument --gpu does not work; it needs single dash -gpu contrary to the comments

Strange. "It works for me", and I haven't hard a report of this before. What exactly happens if you use --gpu and how are you specifying the command-line (e.g., using PowerShell, ...) ?

App crashes with the arguments: -gpu pbrt-v4-scenes\killeroos\killeroo-simple.pbrt following a run with the arguments: pbrt-v4-scenes\killeroos\killeroo-simple.pbrt; need to perform a rebuild.

I don't understand what "need to perform a rebuild" means in this context. Is that a message printed by pbrt? What exactly is printed when it crashes? I can confirm that, to my surprise, killeroo-simple.pbrt with --gpu on Windows is crashing with an error that the program generated an exception. The few other scenes I've tried seem fine, however.

PBRTOptions which is derived from BasicPBRTOptions, the debugger does not show the useGPU field that comes from the base class.

That sounds like a shortcoming of your debugger. I'm not sure what pbrt can do about that.

kyamant commented 2 years ago

"I don't understand what "need to perform a rebuild" means in this context. Is that a message printed by pbrt? " It crashes without any messages printed on the console. Using Visual Studio's Build->Rebuild Solution (ctrl+alt+f7 if you prefer), rebuild the solution then it works.