[BUG] Examples do not compile with 2.6.1
flx42 opened this issue · 3 comments
Describe the bug
The examples do not currently compile with CUDA 12.0 on Ubuntu 22.04
Steps/Code to reproduce bug
Use the following Dockerfile:
FROM nvidia/cuda:12.0.1-devel-ubuntu22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
cmake \
zlib1g-dev \
liblz4-dev && \
rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' -fSsL "https://developer.download.nvidia.com/compute/nvcomp/2.6.1/local_installers/nvcomp_2.6.1_x86_64_12.x.tgz" | tar xz -C /usr/local && \
ldconfig
RUN mkdir -p /usr/local/src/nvcomp && \
cd /usr/local/src/nvcomp && \
git clone --depth=1 https://github.com/NVIDIA/nvcomp.git . && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j1 VERBOSE=1 && \
make install/strip
Building this Dockerfile yields an error:
#7 1.848 cd /usr/local/src/nvcomp/build/examples && /usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -isystem=/usr/local/cuda/include -O3 -DNDEBUG -t 0 --generate-code=arch=compute_52,code=[compute_52,sm_52] -std=c++11 -MD -MT examples/CMakeFiles/lz4_cpu_compression.dir/lz4_cpu_compression.cu.o -MF CMakeFiles/lz4_cpu_compression.dir/lz4_cpu_compression.cu.o.d -x cu -c /usr/local/src/nvcomp/examples/lz4_cpu_compression.cu -o CMakeFiles/lz4_cpu_compression.dir/lz4_cpu_compression.cu.o
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(171): error: this declaration has no storage class or type specifier
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(171): error: expected a ";"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(172): error: this declaration has no storage class or type specifier
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(172): error: "nvcomp" has already been declared in the current scope
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(172): error: expected a ";"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(173): error: this declaration has no storage class or type specifier
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(173): error: "nvcomp" has already been declared in the current scope
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(173): error: expected a ";"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(47): error: "m_ptrs" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(48): error: "m_sizes" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(49): error: "m_data" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(54): error: identifier "m_data" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(54): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(61): error: identifier "m_ptrs" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(61): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(61): error: expected an identifier
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(61): error: expected a ";"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(64): error: identifier "m_sizes" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(64): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(82): error: "m_ptrs" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(83): error: "m_sizes" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(84): error: "m_data" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(88): error: identifier "m_sizes" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(88): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(95): error: identifier "m_data" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(95): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(103): error: identifier "m_ptrs" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(103): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(103): error: expected an identifier
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(103): error: expected a ";"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(115): error: "m_ptrs" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(116): error: "m_sizes" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(117): error: "m_data" is not a nonstatic data member or base class of class "BatchData"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(120): error: identifier "m_data" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(120): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(123): error: identifier "m_sizes" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(123): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(129): error: identifier "m_ptrs" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(129): error: name followed by "::" must be a class or namespace name
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(129): error: expected an identifier
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(129): error: expected a ";"
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(140): error: identifier "m_data" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(144): error: identifier "m_data" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(149): error: identifier "m_ptrs" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(153): error: identifier "m_ptrs" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(158): error: identifier "m_sizes" is undefined
#7 2.369
#7 2.369 /usr/local/src/nvcomp/examples/BatchData.h(162): error: identifier "m_sizes" is undefined
#7 2.369
#7 2.369 47 errors detected in the compilation of "/usr/local/src/nvcomp/examples/lz4_cpu_compression.cu".
#7 2.371 make[2]: Leaving directory '/usr/local/src/nvcomp/build'
#7 2.371 make[2]: *** [examples/CMakeFiles/lz4_cpu_compression.dir/build.make:76: examples/CMakeFiles/lz4_cpu_compression.dir/lz4_cpu_compression.cu.o] Error 255
#7 2.371 make[1]: Leaving directory '/usr/local/src/nvcomp/build'
#7 2.371 make[1]: *** [CMakeFiles/Makefile2:146: examples/CMakeFiles/lz4_cpu_compression.dir/all] Error 2
#7 2.371 make: *** [Makefile:136: all] Error 2
Thanks for catching this! We had to update the CMakeLists.txt in order to namespace cub and thrust to fix an issue someone else was hitting, but we forgot to put that update onto GitHub. I'll try to get the change to GitHub soon. I can't recall if there are any other changes needed, but the main change is to add:
add_compile_definitions("THRUST_CUB_WRAPPED_NAMESPACE=nvcomp")
to the main CMakeLists.txt at the end of the part dealing with CUB. Hopefully that helps, and sorry about this!
Thanks for the report. This has been fixed.
Confirmed, thanks!