jacobaustin123 / Titan

A high-performance CUDA-based physics simulation sandbox for soft robotics and reinforcement learning.
https://jacobaustin123.github.io/Titan
Other
96 stars 21 forks source link

ubuntu compile error #23

Open xiaoerlaigeid opened 3 years ago

xiaoerlaigeid commented 3 years ago

I have install cuda and gcc

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- The CUDA compiler identification is unknown
-- 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
-- Check for working CUDA compiler: /usr/bin/nvcc
-- Check for working CUDA compiler: /usr/bin/nvcc -- broken
CMake Error at /usr/local/share/cmake-3.12/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler

    "/usr/bin/nvcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/sjtu/yzk/Titan-master/build/debug/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_73a31/fast"
    /usr/bin/make -f CMakeFiles/cmTC_73a31.dir/build.make CMakeFiles/cmTC_73a31.dir/build
    make[1]: Entering directory '/home/sjtu/yzk/Titan-master/build/debug/CMakeFiles/CMakeTmp'
    Building CUDA object CMakeFiles/cmTC_73a31.dir/main.cu.o
    /usr/bin/nvcc     -x cu -c /home/sjtu/yzk/Titan-master/build/debug/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_73a31.dir/main.cu.o
    ptxas fatal   : Value 'sm_20' is not defined for option 'gpu-name'
    CMakeFiles/cmTC_73a31.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_73a31.dir/main.cu.o' failed
    make[1]: *** [CMakeFiles/cmTC_73a31.dir/main.cu.o] Error 255
    make[1]: Leaving directory '/home/sjtu/yzk/Titan-master/build/debug/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_73a31/fast' failed
    make: *** [cmTC_73a31/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

CMakeOutput.log CMakeError.log

jacobaustin123 commented 3 years ago

What version of CUDA did you install? Also what GPU do you have? CUDA is failing on an old sm_20 architecture (Fermi, which is an old GPU model). You could try following these instructions in the CMakeLists.txt file (https://stackoverflow.com/questions/47663033/nvcc-fatal-value-sm-20-is-not-defined-for-option-gpu-architecture).

xiaoerlaigeid commented 3 years ago

Thank you for your reply. My CUDA version is 10.1 and GPU is titanX(pascal)

jacobaustin123 commented 3 years ago

So this seems like an issue with the CUDA installation itself. Are you able to run nvcc from the command line? Or install other gpu based software like pytorch/tensorflow?

There may be a simple fix on my end, but let me know about other programs.