Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to compile #33

Open
josephzsombor opened this issue Jan 26, 2025 · 1 comment
Open

Failing to compile #33

josephzsombor opened this issue Jan 26, 2025 · 1 comment

Comments

@josephzsombor
Copy link

I am trying to compile this in an Ubuntu/CUDA apptainer using

Bootstrap: docker
From: nvcr.io/nvidia/cuda:12.6.3-cudnn-devel-ubuntu20.04

I have installed all the dependencies, but I keep getting the following error. Do you have any idea what could be causing this? Could it be that there's an issue with my cuda toolkit installation?

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- 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
-- 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
-- Could NOT find OptiX80 (missing: OPTIX80_INCLUDE_DIR) 
CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "FindCUDAToolkit.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "CUDAToolkit", but CMake did not find one.

  Could not find a package configuration file provided by "CUDAToolkit"
  (requested version 12.0) with any of the following names:

    CUDAToolkitConfig.cmake
    cudatoolkit-config.cmake

  Add the installation prefix of "CUDAToolkit" to CMAKE_PREFIX_PATH or set
  "CUDAToolkit_DIR" to a directory containing one of the above files.  If
  "CUDAToolkit" provides a separate development package or SDK, be sure it
  has been installed.


-- Configuring incomplete, errors occurred!

I installed cuda toolkit as follows:

    wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb
    dpkg -i cuda-keyring_1.1-1_all.deb
    apt-get update
    apt-get -y install cuda-toolkit-12-8

Any advice would be appreciated!

@josephzsombor
Copy link
Author

I managed to fix the CUDAToolkitConfig.cmake missing issue. It turns out cmake 3.22 is necessary to have FindCUDAToolkit.cmake, so I added the following to my def file:

    # Download the latest CMake installer
    echo "Downloading the latest CMake installer..."
    wget -q https://cmake.org/files/v3.31/cmake-3.31.4-linux-x86_64.sh -O /tmp/cmake.sh
    chmod +x /tmp/cmake.sh
    echo "Installing CMake..."
    /tmp/cmake.sh --skip-license --prefix=/usr/local
    echo "Creating symlink for cmake..."
    ln -s /usr/local/bin/cmake /usr/bin/cmake
    echo "Cleaning up..."
    rm /tmp/cmake.sh
    echo "CMake installation complete."

The version of cmake installed by simply apt-get cmake was < 3.22.

So I can now successfully build Denoiser, but the make command does end with some warnings:

/opt/NvidiaAIDenoiser/src/main.cpp: In instantiation of 'void PrintInfo(const char*, Args ...) [with Args = {}]':
/opt/NvidiaAIDenoiser/src/main.cpp:183:40:   required from here
/opt/NvidiaAIDenoiser/src/main.cpp:83:12: warning: format not a string literal and no format arguments [-Wformat-security]
   83 |     sprintf(buffer, c, args...);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/opt/NvidiaAIDenoiser/src/main.cpp: In instantiation of 'void PrintError(const char*, Args ...) [with Args = {}]':
/opt/NvidiaAIDenoiser/src/main.cpp:207:54:   required from here
/opt/NvidiaAIDenoiser/src/main.cpp:99:12: warning: format not a string literal and no format arguments [-Wformat-security]
   99 |     sprintf(buffer, c, args...);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/opt/NvidiaAIDenoiser/src/main.cpp: In function 'std::string getTime()':
/opt/NvidiaAIDenoiser/src/main.cpp:73:31: warning: 'sprintf' writing a terminating nul past the end of the destination [-Wformat-overflow=]
   73 |     sprintf(s, "%02d:%02d:%03d", minutes, seconds, (int)milliseconds);
      |                               ^
/opt/NvidiaAIDenoiser/src/main.cpp:73:12: note: 'sprintf' output between 10 and 36 bytes into a destination of size 9
   73 |     sprintf(s, "%02d:%02d:%03d", minutes, seconds, (int)milliseconds);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking CXX executable Denoiser
[100%] Built target Denoiser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant