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

Problem with building from source #5

Open
ARman-AT opened this issue Aug 1, 2024 · 0 comments
Open

Problem with building from source #5

ARman-AT opened this issue Aug 1, 2024 · 0 comments

Comments

@ARman-AT
Copy link

ARman-AT commented Aug 1, 2024

I have ubunutu 22.04 with cuda 12.0 and cudnn 8.8.1,
when i try cmake -DCMAKE_BUILD_TYPE=Release .. everything works fine and i get this:

Details

`cmake -DCMAKE_BUILD_TYPE=Release ..
-- The CXX compiler identification is GNU 12.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - /usr/local/cuda-12.0/bin/nvcc
-- The CUDA compiler identification is NVIDIA 12.0.76
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-12.0/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: /usr/local/cuda-12.0/include (found version "12.0.76")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found CUDNN: /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer_static.a;/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer_static.a (found version "8.8.1")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- pybind11 v2.9.2
-- Found PythonInterp: /home/arman/miniconda3/bin/python (found version "3.12.4")
-- Found PythonLibs: /home/arman/miniconda3/lib/libpython3.12.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success

-- Summary:
-- Optimization Flags: ------------ -march=native
-- CUDA Archutecutre List: -------- 50;52;53;60;61;62;70;72;75;80;86;87;89;90
-- Python Interface: -------------- ON
-- CUDA: -------------------------- ON
-- CUDNN: ------------------------- ON
-- DNNL: -------------------------- OFF
-- BLAS: -------------------------- OFF

-- Configuring done
CMake Warning (dev) at CMakeLists.txt:186 (add_library):
Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
enabled. Run "cmake --help-policy CMP0069" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
'spyker_plugin'.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/arman/spyker/Spyker/build
`

and then when i try make -j 8 i get this error :

Details

[ 3%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/backprop.cpp.o [ 3%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/canny.cpp.o [ 5%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/code.cpp.o [ 7%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/conv.cpp.o [ 9%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/dog.cpp.o [ 11%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/fire.cpp.o [ 13%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/fc.cpp.o [ 15%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/inhibit.cpp.o [ 17%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/init.cpp.o [ 19%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/memory.cpp.o [ 21%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/pool.cpp.o [ 23%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/stdp.cpp.o [ 25%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/time.cpp.o [ 26%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/wta.cpp.o [ 28%] Building CXX object CMakeFiles/spyker.dir/src/spyker/cpu/zca.cpp.o [ 30%] Building CXX object CMakeFiles/spyker.dir/src/spyker/helper/csv.cpp.o [ 32%] Building CXX object CMakeFiles/spyker.dir/src/spyker/helper/image.cpp.o [ 34%] Building CXX object CMakeFiles/spyker.dir/src/spyker/helper/mnist.cpp.o [ 36%] Building CXX object CMakeFiles/spyker.dir/src/spyker/impl.cpp.o [ 38%] Building CXX object CMakeFiles/spyker.dir/src/spyker/opers.cpp.o [ 40%] Building CXX object CMakeFiles/spyker.dir/src/spyker/shape.cpp.o [ 42%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/base.cpp.o [ 44%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/code.cpp.o [ 46%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/conv.cpp.o [ 48%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/inhibit.cpp.o [ 50%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/opers.cpp.o [ 51%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/pad.cpp.o [ 53%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/pool.cpp.o [ 55%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/stdp.cpp.o [ 57%] Building CXX object CMakeFiles/spyker.dir/src/spyker/sparse/wta.cpp.o [ 59%] Building CXX object CMakeFiles/spyker.dir/src/spyker/utils.cpp.o [ 61%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/backprop.cu.o [ 63%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/base.cu.o [ 65%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/canny.cu.o [ 67%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/code.cu.o [ 69%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/conv.cu.o [ 71%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/dog.cu.o [ 73%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/fc.cu.o [ 75%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/fire.cu.o [ 76%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/inhibit.cu.o [ 78%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/memory.cu.o [ 80%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/pool.cu.o [ 82%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/stdp.cu.o [ 84%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/time.cu.o [ 86%] Building CUDA object CMakeFiles/spyker.dir/src/spyker/cuda/wta.cu.o [ 88%] Linking CXX static library libspyker.a [ 88%] Built target spyker [ 90%] Building CXX object CMakeFiles/play.dir/play/play.cpp.o [ 92%] Building CXX object CMakeFiles/spyker_plugin.dir/src/bind/bind.cpp.o [ 94%] Linking CUDA device code CMakeFiles/play.dir/cmake_device_link.o [ 96%] Linking CUDA device code CMakeFiles/spyker_plugin.dir/cmake_device_link.o [ 98%] Linking CXX executable play /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer_static.a(nvrtcHelperStatic.o): in function nvrtcHelper::load(bool)':
nvrtcHelperStatic.cpp:(.text+0x68): undefined reference to nvrtcVersion' /usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0x7c): undefined reference to nvrtcCreateProgram'
/usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0x87): undefined reference to nvrtcGetProgramLogSize' /usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0x8e): undefined reference to nvrtcCompileProgram'
/usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0x95): undefined reference to nvrtcGetProgramLog' /usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0x9c): undefined reference to nvrtcGetPTXSize'
/usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0xa3): undefined reference to nvrtcGetPTX' /usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0xaa): undefined reference to nvrtcGetCUBINSize'
/usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0xb1): undefined reference to nvrtcDestroyProgram' /usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0xb8): undefined reference to nvrtcGetCUBIN'
/usr/bin/ld: nvrtcHelperStatic.cpp:(.text+0x353): undefined reference to __nvrtcCPEx' [100%] Linking CXX shared module spyker_plugin.cpython-312-x86_64-linux-gnu.so collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/play.dir/build.make:127: play] Error 1 make[1]: *** [CMakeFiles/Makefile2:156: CMakeFiles/play.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [100%] Built target spyker_plugin make: *** [Makefile:91: all] Error 2

i tried this code to make sure i have nvrtc pachage installed:

#include <iostream>
#include <nvrtc.h>

void checkNVRTC() {
    int major, minor;
    nvrtcResult result = nvrtcVersion(&major, &minor);
    if (result == NVRTC_SUCCESS) {
        std::cout << "NVRTC version: " << major << "." << minor << std::endl;
    } else {
        std::cerr << "Failed to get NVRTC version: " << nvrtcGetErrorString(result) << std::endl;
    }

    nvrtcProgram prog;
    const char* progName = "test_program";
    const char* cudaSource = "extern \"C\" __global__ void kernel() { }";

    // Create the program
    result = nvrtcCreateProgram(&prog, cudaSource, progName, 0, nullptr, nullptr);
    if (result != NVRTC_SUCCESS) {
        std::cerr << "Failed to create NVRTC program: " << nvrtcGetErrorString(result) << std::endl;
        return;
    }

    // Compile the program
    result = nvrtcCompileProgram(prog, 0, nullptr);
    if (result != NVRTC_SUCCESS) {
        std::cerr << "NVRTC compilation failed: " << nvrtcGetErrorString(result) << std::endl;
        size_t logSize;
        nvrtcGetProgramLogSize(prog, &logSize);
        char* log = new char[logSize];
        nvrtcGetProgramLog(prog, log);
        std::cerr << log << std::endl;
        delete[] log;
        nvrtcDestroyProgram(&prog);
        return;
    }

    std::cout << "NVRTC compilation succeeded." << std::endl;

    // Clean up
    nvrtcDestroyProgram(&prog);
}

int main() {
    std::cout << "Checking NVRTC..." << std::endl;
    checkNVRTC();
    return 0;
}

and i got this error:

Details

g++ nvrtc_test.cpp -o nvrtc_test -lnvrtc
nvrtc_test.cpp:1:10: fatal error: nvrtc.h: No such file or directory
1 | #include <nvrtc.h>
| ^~~~~~~~~
compilation terminated.

realizing cpp can't find nvrtc package so i added these lines into bashrc:

export C_INCLUDE_PATH=/usr/local/cuda/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include:$CPLUS_INCLUDE_PATH

now nvrtc works fine with cpp but i still have problem with spyker.

thanks in advance

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