Comments (17)
Could you please try the commit I just pushed and see if it helps? (You can also try this branch which is based on the current master and has the atomic patch included.)
from pbrt-v4.
Thanks for your reply, but PBRT-v4 uses std library modified by NVIDIA which is named "libcu++", supporting cuda::std::atomic
and it cannot replace by std library std::atomic
which is included in <atomic>
I think it must be solved by replace the atomic operation.
from pbrt-v4.
@mmp will know better, but AFAICT those atomics in particular are only used by the CPU and never by the GPU so it should be fine to use the ones from the regular standard library.
from pbrt-v4.
@neverfelly to be clear, is that with the latest version of pbrt? This check should in theory ensure that it only tries to use them for sm_70 and up oin Windows. (I can't test that myself locally, but it seems simple enough that it should be hard to have a bug in...)
And indeed, those atomics are all for GPU code, so can't be replaced with std::atomic
.
from pbrt-v4.
I'm not sure we are talking about the same atomics: aren't https://github.com/mmp/pbrt-v4/blob/master/src/pbrt/gpu/accel.cpp#L211 and https://github.com/mmp/pbrt-v4/blob/master/src/pbrt/gpu/pathintegrator.cpp#L275 CPU-only atomics? There might still be a point to include <cuda/std/atomic>
rather than <atomic>
to access those, that I am missing.
from pbrt-v4.
Doh! (Need more coffee..)
You're right, and yes, that would cause this. Fix pushed to the master branch--thanks!
from pbrt-v4.
No worries! (I should have been less lazy and swap GPUs to try it out on Pascal.)
from pbrt-v4.
Still getting an error about atomics on Pascal, when compiling optix.cu. It's sadly not giving much details as to where that header is coming from; I'll try to track it down.
9>------ Build started: Project: pbrt_lib, Configuration: RelWithDebInfo x64 ------
8>Building NVCC ptx file cuda_compile_ptx_1_generated_optix.cu.ptx
8>optix.cu
8>D:\Program Files\NVIDIA Corporation\CUDA\v11.0\Toolkit\include\cuda\std\detail/__atomic(10): fatal error C1189: #error: "CUDA atomics are only supported for sm_60 and up on *nix and sm_70 and up on Windows."
8>CMake Error at cuda_compile_ptx_1_generated_optix.cu.ptx.RelWithDebInfo.cmake:212 (message):
8> Error generating
8> D:/Builds/pbrt-v4/cuda_compile_ptx_1_generated_optix.cu.ptx
from pbrt-v4.
Found the issue: optix.cu ends up including workqueue.h but does not define PBRT_IS_WINDOWS
and so the added atomics check has no effect. PBRT_IS_WINDOWS
and other such defines are defined on line 299+, way after the macro for compiling to PTX and embedding it is defined (lines 186 through 202).
from pbrt-v4.
Yep, ugh--that one optix.cu file is compiled in its own way, which leads to all sorts of troubles. I just pushed a fix to move that stuff earlier; hopefully that will do it.
from pbrt-v4.
You missed a small detail: you moved the definition of PBRT_DEFINITIONS
around but it is still not used by the cuda_compile_ptx()
macro. I tried simply passing in ${PBRT_DEFINITIONS}
as an option, similar to ${PBRT_CUDA_DIAG_FLAGS}
,but that fails since the definitions are not prefixed by -D
so nvcc considers them as additional input files. I also tried doing add_definitions (${PBRT_DEFINITIONS})
but that completely messes up everything else.
I'll send a MR with a rework of that part to not use the cuda_compile_ptx()
macro but instead use the built-in support in CMake for CUDA, which avoids having to do those global includes and should hopefully help with those troubles you were mentioning.
that one optix.cu file is compiled in its own way, which leads to all sorts of troubles
from pbrt-v4.
I should add that manually passing -DPBRT_IS_WINDOWS
results in PBRT compiling properly, and the code runs fine, rendering killeroo-gold.pbrt in 41 seconds on my GTX 1080 Ti. So once we get those definitions squared off, we should be good.
from pbrt-v4.
@neverfelly Merge request #31 should allow you to finally compile pbrt-v4 on Pascal (at least it does so locally).
from pbrt-v4.
(Looks like github automatically closed this based on the commit message.) Hopefully this does it for you, @neverfelly, but please re-open the issue if not.
from pbrt-v4.
This is still failing with the latest master.
from pbrt-v4.
I will re-check later today.
@atulitk Could you please share which version of Visual Studio and CMake you are using, as well as the whole compilation line with nvcc that is failing (or all build messages associated to optix.cu)?
from pbrt-v4.
Could you please give the code in #65 a try? There seems to be an issue with the Visual Studio CUDA integration that prevents host definitions from being passed along when compiling device code, leading to this issue.
from pbrt-v4.
Related Issues (20)
- How to add 360 degree image as background of the model HOT 1
- Possible wrong use of non-symmetric BRDF with BDPT
- Random crash on CPU rendering HOT 3
- mmp, FYI, --cropwindow
- Function Film.ToOutputRGB seems to output negative values in the photon mapper.
- Results get overly exposure when rendering with AOIntegrator and RGBFilm with ISO larger than 100
- Cannot use pbrt-v4 HOT 4
- GPU Build issue HOT 6
- Exhaustive light sampler + area light + GPU render = fatal error HOT 1
- pbrt-v4 as an external lib fails to create pbrt_soa.h HOT 2
- Cannot use GPU version on windows HOT 2
- Units for scene files HOT 6
- TeX comments in IDE HOT 1
- Potential incorrect mutex usage in ptex cache construction HOT 1
- 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
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.