pbrt-v4 icon indicating copy to clipboard operation
pbrt-v4 copied to clipboard

Cannot build target pbrt_embedded_ptx_lib for GPU support

Open joeylitalien opened this issue 1 year ago • 3 comments

Hi,

I'm currently trying to compile pbrt-v4 with GPU support but I am running into the following error when I enable GPU compiling (CPU works fine). I'm running on CUDA 11.3 with Optix 7.3 (Drivers 510.108.03) and trying to compile on an A100 instance (sm_80).

This is the output of CMake configuration:

-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- OpenEXR at commit: 5cfb5dab6dfada731586b0281bdb15ee75e26782
-- OpenVDB at commit: 414bed84c2fc22e188eac7b611aa85c7edd7a5a9
-- Ptex at commit: 4cd8e9a6db2b06e478dfbbd8c26eb6df97f84483
-- double-conversion at commit: cc1f75a114aca8d2af69f73a5a959aecbab0e87a
-- filesystem at commit: c5f9de30142453eb3c6fe991e82dfc2583373116
-- glfw at commit: 4cb36872a5fe448c205d0b46f0e8c8b57530cfe0
-- libdeflate at commit: 1fd0bea6ca2073c68493632dafc4b1ddda1bcbc3
-- lodepng at commit: 8c6a9e30576f07bf470ad6f09458a2dcd7a6a84a
-- qoi at commit: 028c75fd26e5e0758c7c711216c00404994c1ad3
-- stb at commit: af1a5bc352164740c1cc1354942b1c6b72eacb8a
-- utf8proc at commit: 2484e2ed5e1d9c19edcccf392a7d9920ad90dfaf
-- zlib at commit: 54d591eabf9fe0e84c725638f8d5d8d202a093fa
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
CMake Warning (dev) at src/ext/libdeflate/CMakeLists.txt:12 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test DEFLATE_LINT_WALL
-- Performing Test DEFLATE_LINT_WALL - Success
-- Performing Test DEFLATE_LINT_WUNDEF
-- Performing Test DEFLATE_LINT_WUNDEF - Success
-- Performing Test DEFLATE_LINT_PEDANTIC
-- Performing Test DEFLATE_LINT_PEDANTIC - Success
-- Performing Test DEFLATE_LINT_DECLARATION_AFTER_STATEMENT
-- Performing Test DEFLATE_LINT_DECLARATION_AFTER_STATEMENT - Success
-- Performing Test DEFLATE_LINT_MISSING_PROTOTYPES
-- Performing Test DEFLATE_LINT_MISSING_PROTOTYPES - Success
-- Performing Test DEFLATE_LINT_STRICT_PROTOTYPES
-- Performing Test DEFLATE_LINT_STRICT_PROTOTYPES - Success
-- Performing Test DEFLATE_LINT_VLA
-- Performing Test DEFLATE_LINT_VLA - Success
-- Performing Test DEFLATE_LINT_IMPLICIT_FALLTHROUGH
-- Performing Test DEFLATE_LINT_IMPLICIT_FALLTHROUGH - Success
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Could NOT find Imath (missing: Imath_DIR)
-- Could NOT find IlmBase (missing: IlmBase_DIR)
-- Could NOT find OpenEXR (missing: OpenEXR_DIR)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Found OpenEXR: /usr/include (found suitable version "2.3.0", minimum required is "2.3") 
-- Found OpenEXR version 2.3.0
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.17") found components: doxygen missing components: dot
-- Including X11 support
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Unable to find -lprofiler
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - /usr/local/cuda-11.3/bin/nvcc
-- Found CUDA: /usr/local/cuda-11.3 (found version "11.3") 
-- Found CUDA: 11.3.109
-- The CUDA compiler identification is NVIDIA 11.3.109
-- Check for working CUDA compiler: /usr/local/cuda-11.3/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-11.3/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Detected CUDA Architecture: sm_80
-- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE
-- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE - Success
-- Performing Test HAVE_MMAP
-- Performing Test HAVE_MMAP - Success
-- Performing Test HAS_INTRIN_H
-- Performing Test HAS_INTRIN_H - Failed
-- Performing Test HAVE_DECLSPEC_NOINLINE
-- Performing Test HAVE_DECLSPEC_NOINLINE - Failed
-- Performing Test HAVE_ATTRIBUTE_NOINLINE
-- Performing Test HAVE_ATTRIBUTE_NOINLINE - Success
-- Performing Test HAVE_PRE_POST_BAR_RESTRICT
-- Performing Test HAVE_PRE_POST_BAR_RESTRICT - Success
-- Performing Test HAVE_PRE_BAR_RESTRICT
-- Performing Test HAVE_PRE_BAR_RESTRICT - Success
-- Performing Test HAVE__ALIGNED_MALLOC
-- Performing Test HAVE__ALIGNED_MALLOC - Failed
-- Performing Test HAVE_POSIX_MEMALIGN
-- Performing Test HAVE_POSIX_MEMALIGN - Success
-- Performing Test INT64_IS_OWN_TYPE
-- Performing Test INT64_IS_OWN_TYPE - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jlitalien/pbrt-v4/build

This is the output of CMake:

...
Scanning dependencies of target pbrt_embedded_ptx_lib
[ 80%] Building C object CMakeFiles/pbrt_embedded_ptx_lib.dir/src/pbrt/gpu/optix.cu.ptx_embedded.c.o
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:353:146: error: ‘_Args’ was not declared in this scope
  353 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                  ^    
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:353:137: error: parse error in template argument list
  353 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                         ^                
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:353:172: error: ‘_Vp’ was not declared in this scope
  353 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                            ^  
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:353:184: error: template argument 2 is invalid
  353 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                                        ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:353:263: error: ‘_Args’ was not declared in this scope
  353 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                                                                                                                           
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:353:254: error: parse error in template argument list
  353 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                                                                                                              ^                
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:354:48: error: ‘_Vp’ was not declared in this scope
  354 |               typename Y = EnableIfMutableView<V>>
      |                                                ^~~
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:354:55: error: ‘_Args’ was not declared in this scope
  354 |               typename Y = EnableIfMutableView<V>>
      |                                                       ^    
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:354:60: error: template argument 2 is invalid
  354 |               typename Y = EnableIfMutableView<V>>
      |                                                            ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:366:146: error: ‘_Args’ was not declared in this scope
  366 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                  ^    
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:366:137: error: parse error in template argument list
  366 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                         ^                
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:366:172: error: ‘_Vp’ was not declared in this scope
  366 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                            ^  
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:366:184: error: template argument 2 is invalid
  366 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                                        ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:366:263: error: ‘_Args’ was not declared in this scope
  366 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                                                                                                                           
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:366:254: error: parse error in template argument list
  366 |     template <typename V, typename X = EnableIfConvertibleFrom<V>,
      |                                                                                                                                                                                                                                                              ^                
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:367:47: error: ‘_Vp’ was not declared in this scope
  367 |               typename Y = EnableIfConstView<V>>
      |                                               ^~ 
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:367:54: error: ‘_Args’ was not declared in this scope
  367 |               typename Y = EnableIfConstView<V>>
      |                                                      ^    
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:367:59: error: template argument 2 is invalid
  367 |               typename Y = EnableIfConstView<V>>
      |                                                           ^
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h: In constructor ‘pbrt::PiecewiseConstant2D::PiecewiseConstant2D(pstd::span<const float>, int, int, pbrt::Bounds2f, pbrt::Allocator)’:
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:752:91: error: no matching function for call to ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D(pstd::vector<float>&, float&, float&, pbrt::Allocator&)’
  752 |         pMarginal =
      |                                                                                           ^
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:625:1: note: candidate: ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D(pstd::span<const float>, pbrt::Float, pbrt::Float, pbrt::Allocator)’
  625 |     PiecewiseConstant1D(pstd::span<const Float> f, Float min, Float max,
      | ^   ~~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:625:47: note:   no known conversion for argument 1 from ‘pstd::vector<float>’ to ‘pstd::span<const float>’
  625 |     PiecewiseConstant1D(pstd::span<const Float> f, Float min, Float max,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:622:1: note: candidate: ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D(pstd::span<const float>, pbrt::Allocator)’
  622 |     PiecewiseConstant1D(pstd::span<const Float> f, Allocator alloc = {})
      | ^   ~~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:622:1: note:   candidate expects 2 arguments, 4 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:621:1: note: candidate: ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D(pbrt::Allocator)’
  621 |     PiecewiseConstant1D(Allocator alloc) : func(alloc), cdf(alloc) {}
      | ^   ~~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:621:1: note:   candidate expects 1 argument, 4 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:620:1: note: candidate: ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D()’
  620 |     PiecewiseConstant1D() = default;
      | ^   ~~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:620:1: note:   candidate expects 0 arguments, 4 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:603:7: note: candidate: ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D(const pbrt::PiecewiseConstant1D&)’
  603 | class PiecewiseConstant1D {
      |       ^~~~~~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:603:7: note:   candidate expects 1 argument, 4 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:603:7: note: candidate: ‘pbrt::PiecewiseConstant1D::PiecewiseConstant1D(pbrt::PiecewiseConstant1D&&)’
/home/jlitalien/pbrt-v4/src/pbrt/util/sampling.h:603:7: note:   candidate expects 1 argument, 4 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h: In member function ‘pbrt::SampledSpectrum pbrt::SampledWavelengths::PDF() const’:
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:311:60: error: no matching function for call to ‘pbrt::SampledSpectrum::SampledSpectrum(const pstd::array<float, 4>&)’
  311 |     SampledSpectrum PDF() const { return SampledSpectrum(pdf); }
      |                                                            ^
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:210:1: note: candidate: ‘pbrt::SampledSpectrum::SampledSpectrum(pstd::span<const float>)’
  210 |     SampledSpectrum(pstd::span<const Float> v) {
      | ^   ~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:210:43: note:   no known conversion for argument 1 from ‘const pstd::array<float, 4>’ to ‘pstd::span<const float>’
  210 |     SampledSpectrum(pstd::span<const Float> v) {
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:208:10: note: candidate: ‘pbrt::SampledSpectrum::SampledSpectrum(pbrt::Float)’
  208 |     explicit SampledSpectrum(Float c) { values.fill(c); }
      |          ^~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:208:32: note:   no known conversion for argument 1 from ‘const pstd::array<float, 4>’ to ‘pbrt::Float’ {aka ‘float’}
  208 |     explicit SampledSpectrum(Float c) { values.fill(c); }
      |                          ~~~~~~^
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:206:1: note: candidate: ‘constexpr pbrt::SampledSpectrum::SampledSpectrum()’
  206 |     SampledSpectrum() = default;
      | ^   ~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:206:1: note:   candidate expects 0 arguments, 1 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:92:7: note: candidate: ‘constexpr pbrt::SampledSpectrum::SampledSpectrum(const pbrt::SampledSpectrum&)’
   92 | class SampledSpectrum {
      |       ^~~~~~~~~~~~~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:92:7: note:   no known conversion for argument 1 from ‘const pstd::array<float, 4>’ to ‘const pbrt::SampledSpectrum&’
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:92:7: note: candidate: ‘constexpr pbrt::SampledSpectrum::SampledSpectrum(pbrt::SampledSpectrum&&)’
/home/jlitalien/pbrt-v4/src/pbrt/util/spectrum.h:92:7: note:   no known conversion for argument 1 from ‘const pstd::array<float, 4>’ to ‘pbrt::SampledSpectrum&&’
/home/jlitalien/pbrt-v4/src/pbrt/cpu/primitive.h(23): warning: calling a __host__ function("std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > ::vector(const ::std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > &)") from a __host__ __device__ function("pbrt::OptiXAggregate::BVH::BVH") is not allowed

/home/jlitalien/pbrt-v4/src/pbrt/cpu/primitive.h(23): warning: calling a __host__ function("std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > ::vector(const ::std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > &)") from a __host__ __device__ function("pbrt::OptiXAggregate::BVH::BVH") is not allowed

/home/jlitalien/pbrt-v4/src/pbrt/cpu/primitive.h(23): warning: calling a __host__ function("std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > ::vector(const ::std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > &)") from a __host__ __device__ function("pbrt::OptiXAggregate::BVH::BVH") is not allowed

/home/jlitalien/pbrt-v4/src/pbrt/cpu/primitive.h(23): warning: calling a __host__ function("std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > ::~vector()") from a __host__ __device__ function("pbrt::OptiXAggregate::BVH::~BVH") is not allowed

/home/jlitalien/pbrt-v4/src/pbrt/cpu/primitive.h(23): warning: calling a __host__ function("std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > ::~vector()") from a __host__ __device__ function("pbrt::OptiXAggregate::BVH::~BVH") is not allowed

/home/jlitalien/pbrt-v4/src/pbrt/cpu/primitive.h(23): warning: calling a __host__ function("std::vector< ::pbrt::OptiXAggregate::HitgroupRecord, ::std::allocator< ::pbrt::OptiXAggregate::HitgroupRecord> > ::~vector()") from a __host__ __device__ function("pbrt::OptiXAggregate::BVH::~BVH") is not allowed

/home/jlitalien/pbrt-v4/src/pbrt/util/splines.h: In function ‘pbrt::Bounds3f pbrt::BoundCubicBezier(pstd::span<const pbrt::Point3<float> >, pbrt::Float, pbrt::Float)’:
/home/jlitalien/pbrt-v4/src/pbrt/util/splines.h:73:69: error: no matching function for call to ‘pstd::span<const pbrt::Point3<float> >::span(pstd::array<pbrt::Point3<float>, 4>&)’
   73 |     return BoundCubicBezier(pstd::span<const Point3f>(cpSeg));
      |                                                                     ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:368:1: note: candidate: ‘template<class V, class X, class Y> constexpr pstd::span<T>::span(const V&)’
  368 |     PBRT_CPU_GPU constexpr span(const V &v) noexcept : span(v.data(), v.size()) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:368:1: note:   template argument deduction/substitution failed:
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:363:1: note: candidate: ‘template<class V> pstd::span<T>::span(const std::vector<V>&)’
  363 |     span(const std::vector<V> &v) noexcept : span(v.data(), v.size()) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:363:1: note:   template argument deduction/substitution failed:
/home/jlitalien/pbrt-v4/src/pbrt/util/splines.h:73:69: note:   ‘pstd::array<pbrt::Point3<float>, 4>’ is not derived from ‘const std::vector<V, std::allocator<_CharT> >’
   73 |     return BoundCubicBezier(pstd::span<const Point3f>(cpSeg));
      |                                                                     ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:361:1: note: candidate: ‘template<class V> pstd::span<T>::span(std::vector<V>&)’
  361 |     span(std::vector<V> &v) noexcept : span(v.data(), v.size()) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:361:1: note:   template argument deduction/substitution failed:
/home/jlitalien/pbrt-v4/src/pbrt/util/splines.h:73:69: note:   ‘pstd::array<pbrt::Point3<float>, 4>’ is not derived from ‘std::vector<V, std::allocator<_CharT> >’
   73 |     return BoundCubicBezier(pstd::span<const Point3f>(cpSeg));
      |                                                                     ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:355:1: note: candidate: ‘template<class V, class X, class Y> pstd::span<T>::span(V&)’
  355 |     PBRT_CPU_GPU explicit span(V &v) noexcept : span(v.data(), v.size()) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:355:1: note:   template argument deduction/substitution failed:
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:349:1: note: candidate: ‘pstd::span<T>::span(std::initializer_list<typename std::remove_cv< <template-parameter-1-1> >::type>) [with T = const pbrt::Point3<float>; typename std::remove_cv< <template-parameter-1-1> >::type = pbrt::Point3<float>]’
  349 |     span(std::initializer_list<value_type> v) : span(v.begin(), v.size()) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:349:42: note:   no known conversion for argument 1 from ‘pstd::array<pbrt::Point3<float>, 4>’ to ‘std::initializer_list<pbrt::Point3<float> >’
  349 |     span(std::initializer_list<value_type> v) : span(v.begin(), v.size()) {}
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:347:1: note: candidate: ‘template<long unsigned int N> pstd::span<T>::span(T (&)[N])’
  347 |     PBRT_CPU_GPU span(T (&a)[N]) : span(a, N) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:347:1: note:   template argument deduction/substitution failed:
/home/jlitalien/pbrt-v4/src/pbrt/util/splines.h:73:69: note:   mismatched types ‘const pbrt::Point3<float> [N]’ and ‘pstd::array<pbrt::Point3<float>, 4>’
   73 |     return BoundCubicBezier(pstd::span<const Point3f>(cpSeg));
      |                                                                     ^
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:345:1: note: candidate: ‘pstd::span<T>::span(T*, size_t) [with T = const pbrt::Point3<float>; size_t = long unsigned int]’
  345 |     span(T *ptr, size_t n) : ptr(ptr), n(n) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:345:1: note:   candidate expects 2 arguments, 1 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:343:1: note: candidate: ‘pstd::span<T>::span() [with T = const pbrt::Point3<float>]’
  343 |     span() : ptr(nullptr), n(0) {}
      | ^   
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:343:1: note:   candidate expects 0 arguments, 1 provided
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:321:7: note: candidate: ‘constexpr pstd::span<const pbrt::Point3<float> >::span(const pstd::span<const pbrt::Point3<float> >&)’
  321 | class span {
      |       ^~~~
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:321:7: note:   no known conversion for argument 1 from ‘pstd::array<pbrt::Point3<float>, 4>’ to ‘const pstd::span<const pbrt::Point3<float> >&’
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:321:7: note: candidate: ‘constexpr pstd::span<const pbrt::Point3<float> >::span(pstd::span<const pbrt::Point3<float> >&&)’
/home/jlitalien/pbrt-v4/src/pbrt/util/pstd.h:321:7: note:   no known conversion for argument 1 from ‘pstd::array<pbrt::Point3<float>, 4>’ to ‘pstd::span<const pbrt::Point3<float> >&&’
make[2]: *** [CMakeFiles/pbrt_lib.dir/build.make:388: CMakeFiles/pbrt_lib.dir/src/pbrt/textures.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 81%] Linking C static library libpbrt_embedded_ptx_lib.a

I have tried different versions of compilers (gcc-10, clang-10, clang-14) and Optix (7.7), but I get the same results. Am I missing something?

joeylitalien avatar Apr 11 '23 19:04 joeylitalien

I think exist a current issue with Cuda 11.3. This are from the CMakeLists file.. message (SEND_ERROR "Unfortunately, pbrt-v4 triggers an internal compiler error in CUDA 11.3.0. Please either use CUDA 11.0-11.2 or 11.3.1 or later.") I hope this help you.. Edited: I can see that you have Cuda 11.3.109 installed and the warning message is not shown, so, not sure what are the problem..

pbrt4bounty avatar Apr 11 '23 19:04 pbrt4bounty

I’m using 11.3.1 which should be fine according to this note, but it might be worth upgrading.

Update: I have upgraded to CUDA 11.6 with Optix 7.4.0, and it compiles successfully. However, rendering with the GPU now throws a segmentation fault at the Starting OptiX initialization stage.

joeylitalien avatar Apr 11 '23 19:04 joeylitalien

If this comes up again, I'm curious if expanding out the EnableIfConvertibleFrom at line 353 using its definition at line 326 would work around this--i.e. is the templating getting that compiler version confused somehow.

On the seg fault, ugh! What OS and driver? Can you do a run with --log-level verbose and post the output?

mmp avatar Apr 20 '23 20:04 mmp