Giter Club home page Giter Club logo

titan's Introduction

Titan

Titan is a versatile CUDA-based physics simulation library that provides a GPU-accelerated environment for physics primatives like springs and masses. Library users can create masses, springs, and more complicated objects, apply constraints, and modify simulation parameters in real time, while the simulation runs asynchronously on the GPU. Titan has been used for GPU-accelerated reinforcement learning, physics and biomedical research, and topology optimization. See our ICRA paper here.

Installation

Detailed instructions can be found in the Titan user page. Old documentation (not necessarily up to date) can be found on the user wiki.

Try a simple Titan physics simulation

#include <Titan/sim.h>

int main() {
  titan::Simulation sim;
  sim.createLattice(titan::Vec(0, 0, 10), titan::Vec(5, 5, 5), 5, 5, 5); // create lattice with center at (0, 0, 10) and given dimensions
  sim.createPlane(titan::Vec(0, 0, 1), 0); // create constraint plane
  sim.start();
}

This simple program produces a large lattice bouncing on the given plane:

For more examples and troubleshooting, see the github wiki. We also have a user Google Group where you can ask questions about installation and usage, and make feature requests.

Also see this overview video for an overview of the library and its capabilities.

About

This software was written by Jacob Austin and Rafael Corrales Fatou as part of a project led by Professor Hod Lipson at the Creative Machines Lab at Columbia University. This software is released under an Apache 2.0 license.

If using this software in published work, please cite

J. Austin, R. Corrales-Fatou, S. Wyetzner, and H. Lipson, “Titan: A Parallel Asynchronous Library for Multi-Agent and Soft-Body Robotics using NVIDIA CUDA,” ICRA 2020, May 2020.

or use the BibTex

@inproceedings {TitanICRA,
   title	= {Titan: A Parallel Asynchronous Library for Multi-Agent and Soft-Body Robotics using NVIDIA CUDA},
   author	= {Jacob Austin, Raphael Corrales-Fatou, Soia Wyetzner, and Hod Lipson},
   bookTitle	= {Proc. of the {IEEE} International Conference on Robotics and Automation},
   month	= {May},
   year		= {2020},
   location	= {Paris, France}
}

titan's People

Contributors

jacobaustin123 avatar rcorralesf avatar tk-21st avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

titan's Issues

pythonTitan build error

Hi,
Running CMakeList.txt causes some structural errors.

`/usr/local/bin/cmake -S/home/kazuyahoribe/pythonTitan -B/home/kazuyahoribe/pythonTitan/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/kazuyahoribe/pythonTitan/build/CMakeFiles /home/kazuyahoribe/pythonTitan/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/kazuyahoribe/pythonTitan/build'
make -f CMakeFiles/cu_lib.dir/build.make CMakeFiles/cu_lib.dir/depend
make[2]: Entering directory '/home/kazuyahoribe/pythonTitan/build'
cd /home/kazuyahoribe/pythonTitan/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/kazuyahoribe/pythonTitan /home/kazuyahoribe/pythonTitan /home/kazuyahoribe/pythonTitan/build /home/kazuyahoribe/pythonTitan/build /home/kazuyahoribe/pythonTitan/build/CMakeFiles/cu_lib.dir/DependInfo.cmake --color=
Scanning dependencies of target cu_lib
make[2]: Leaving directory '/home/kazuyahoribe/pythonTitan/build'
make -f CMakeFiles/cu_lib.dir/build.make CMakeFiles/cu_lib.dir/build
make[2]: Entering directory '/home/kazuyahoribe/pythonTitan/build'
[ 5%] Building CUDA object CMakeFiles/cu_lib.dir/src/object.cu.o
/usr/local/cuda/bin/nvcc -I/home/kazuyahoribe/pythonTitan/include/Titan -I/usr/local/cuda/include -I/home/kazuyahoribe/pythonTitan/include/Titan} -isystem=/home/kazuyahoribe/vcpkg/installed/x64-linux/include -Xcompiler=-fPIC -std=c++11 -x cu -dc /home/kazuyahoribe/pythonTitan/src/object.cu -o CMakeFiles/cu_lib.dir/src/object.cu.o
[ 10%] Building CXX object CMakeFiles/cu_lib.dir/src/graphics.cpp.o
/usr/bin/c++ -I/home/kazuyahoribe/pythonTitan/include/Titan -I/usr/local/cuda/include -I/home/kazuyahoribe/pythonTitan/include/Titan} -isystem /home/kazuyahoribe/vcpkg/installed/x64-linux/include -fPIC -std=gnu++14 -o CMakeFiles/cu_lib.dir/src/graphics.cpp.o -c /home/kazuyahoribe/pythonTitan/src/graphics.cpp
[ 15%] Building CUDA object CMakeFiles/cu_lib.dir/src/mass.cu.o
/usr/local/cuda/bin/nvcc -I/home/kazuyahoribe/pythonTitan/include/Titan -I/usr/local/cuda/include -I/home/kazuyahoribe/pythonTitan/include/Titan} -isystem=/home/kazuyahoribe/vcpkg/installed/x64-linux/include -Xcompiler=-fPIC -std=c++11 -x cu -dc /home/kazuyahoribe/pythonTitan/src/mass.cu -o CMakeFiles/cu_lib.dir/src/mass.cu.o
[ 20%] Building CUDA object CMakeFiles/cu_lib.dir/src/sim.cu.o
/usr/local/cuda/bin/nvcc -I/home/kazuyahoribe/pythonTitan/include/Titan -I/usr/local/cuda/include -I/home/kazuyahoribe/pythonTitan/include/Titan} -isystem=/home/kazuyahoribe/vcpkg/installed/x64-linux/include -Xcompiler=-fPIC -std=c++11 -x cu -dc /home/kazuyahoribe/pythonTitan/src/sim.cu -o CMakeFiles/cu_lib.dir/src/sim.cu.o
/home/kazuyahoribe/pythonTitan/src/sim.cu(1871): error: class "Simulation" has no member "createBeam"

/home/kazuyahoribe/pythonTitan/src/sim.cu(1872): error: identifier "ENDED" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1878): error: identifier "d_masses" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1878): error: identifier "masses" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1879): error: identifier "d_springs" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1879): error: identifier "springs" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1882): error: identifier "createMass" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1886): error: identifier "createSpring" is undefined

/home/kazuyahoribe/pythonTitan/src/sim.cu(1889): error: identifier "containers" is undefined

9 errors detected in the compilation of "/tmp/tmpxft_00002eb0_00000000-6_sim.cpp1.ii".
CMakeFiles/cu_lib.dir/build.make:104: recipe for target 'CMakeFiles/cu_lib.dir/src/sim.cu.o' failed
make[2]: *** [CMakeFiles/cu_lib.dir/src/sim.cu.o] Error 1
make[2]: Leaving directory '/home/kazuyahoribe/pythonTitan/build'
CMakeFiles/Makefile2:80: recipe for target 'CMakeFiles/cu_lib.dir/all' failed
make[1]: *** [CMakeFiles/cu_lib.dir/all] Error 2
make[1]: Leaving directory '/home/kazuyahoribe/pythonTitan/build'
Makefile:86: recipe for target 'all' failed`
OS: Ubuntu 18.04
Thnaks!

Questions regarding parameters

  1. For each mass there is this setDrag method which sets a drag_coefficient constant. Is this the same as scaling the acceleration of each mass by a constant? Is this same as damping that would look something like (pseudo-code) mass->acceleration *= drag
  2. How do you set friction of the ground plane that's created using the sim.createPlane method? I see that the creatPlane method creates ContactPlane which doesn't seem to have fricition parameter while ConstraintPlane does.
    • if ContactPlane doesn't accept friction parameter, can we replace it with ConstraintPlane?
  3. If I want to set the response of the ground plane which is currently hardcoded can I do it in some hacky way?

Difference between w/ and w/o Graphics

I ran two same simple experiments with only one particle both w/ and w/o Graphics, and the results are slightly different from each other.

The only difference in source code is I delete the line

target_compile_definitions(Titan PUBLIC GRAPHICS)

in CMakeLists.txt

I fixed the initial position, and I use sim.pause(sim.time()+_constant_) to make sure the times are the same.
w/ Graphics, the final position is 0: (8.11824, -0.497202, -1.86328e-05)
w/o Graphics, the final position is 0: (8.11705, -0.497376, -1.53156e-05)

Will this be an issue?
P.S. I learned a lot from the source code. Thanks.

Windows installation failure

I encountered a problem when installing titan in vcpkg.

The command line shows the following error:
CMake Error at scripts/cmake/vcpkg_build_cmake.cmake:175 (message):
Command failed: C:/vcpkg/downloads/tools/cmake-3.12.4-windows/cmake-3.12.4-win32-x86/bin/cmake.exe;--build;.;--config;Debug;--target;install;--;-v;-j1
Working Directory: C:/vcpkg/buildtrees/titan/x64-windows-dbg
See logs for more information:
C:\vcpkg\buildtrees\titan\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
ports/titan/portfile.cmake:60 (vcpkg_install_cmake)
scripts/ports.cmake:71 (include)

The install-x64-windows-dbg-out.log shows the following error:
......
c:\vcpkg\installed\x64-windows\include\glm\detail/type_vec1.hpp(132): warning: host annotation is ignored on a function("operator=") that is explicitly defaulted on its first declaration

c:\vcpkg\installed\x64-windows\include\glm\detail/qualifier.hpp(104): error: attributes are not allowed here
detected during:
instantiation of class "glm::detail::storage<3, T, true> [with T=float]"
c:\vcpkg\installed\x64-windows\include\glm\ext../detail/type_vec3.hpp(53): here
instantiation of class "glm::vec<3, T, Q> [with T=float, Q=glm::aligned_lowp]"
c:\vcpkg\installed\x64-windows\include\glm\ext../detail/type_mat4x3.hpp(23): here
instantiation of class "glm::mat<4, 3, T, Q> [with T=float, Q=glm::aligned_lowp]"
c:\vcpkg\installed\x64-windows\include\glm\detail\func_matrix_simd.inl(69): here

c:\vcpkg\installed\x64-windows\include\glm\detail/qualifier.hpp(96): error: attributes are not allowed here
detected during:
instantiation of class "glm::detail::storage<L, T, true> [with L=2, T=float]"
c:\vcpkg\installed\x64-windows\include\glm\ext../detail/type_vec2.hpp(50): here
instantiation of class "glm::vec<2, T, Q> [with T=float, Q=glm::aligned_lowp]"
c:\vcpkg\installed\x64-windows\include\glm\ext../detail/type_mat4x2.hpp(23): here
instantiation of class "glm::mat<4, 2, T, Q> [with T=float, Q=glm::aligned_lowp]"
c:\vcpkg\installed\x64-windows\include\glm\detail\func_matrix_simd.inl(69): here

C:/vcpkg/buildtrees/titan/src/420888144f-fb31a06eb3/src/sim.cu(71): warning: statement is unreachable

2 errors detected in the compilation of "C:/Users/mashi/AppData/Local/Temp/tmpxft_00004564_00000000-10_sim.cpp1.ii".
sim.cu
ninja: build stopped: subcommand failed.

Can't find a way to fix it.

too many resources requested for launch in example program.

Hi,

I tried to run the example program:

#include <Titan/sim.h>
int main() {
	titan::Simulation sim;
	sim.createLattice(titan::Vec(0, 0, 10), titan::Vec(5, 5, 5), 5, 5, 5); // create lattice with center at (0, 0, 10) and given dimensions
	sim.createPlane(titan::Vec(0, 0, 1), 0); // create constraint plane
	sim.start();
	return 0;
}

But I get a 701 too many resources requested for launch.:

Starting simulation with 125 masses and 1036 springs.
Simulation destructor called.
Linking program
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1589
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1569
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1586
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1589
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1569
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1586
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1589
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1569
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1586
GPUassert: 701 too many resources requested for launch C:/dev/vcpkg/buildtrees/titan/src/Titan/src/sim.cu 1589
...

I'm using a 1050 TI mobile. I thought on MAX_BLOCKS=65535 and THREADS_PER_BLOCK=1024, but It happens after a destructor's call. This is CUDA Device Query output from my gpu:

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "NVIDIA GeForce GTX 1050 Ti"
  CUDA Driver Version / Runtime Version          11.3 / 10.1
  CUDA Capability Major/Minor version number:    6.1
  Total amount of global memory:                 4096 MBytes (4294967296 bytes)
  ( 6) Multiprocessors, (128) CUDA Cores/MP:     768 CUDA Cores
  GPU Max Clock rate:                            1620 MHz (1.62 GHz)
  Memory Clock rate:                             3504 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 1048576 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 5 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  CUDA Device Driver Mode (TCC or WDDM):         WDDM (Windows Display Driver Model)
  Device supports Unified Addressing (UVA):      Yes
  Device supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      No
  Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.3, CUDA Runtime Version = 10.1, NumDevs = 1
Result = PASS

It's my first time using CUDA in general. So, I'm little confused.

Thanks!

Accessing simulation time from CUDA kernel

I want to implement something like

double rest_length = spring -> _rest * (1 + spring -> a * sin(spring -> omega* sim -> T + spring- > b));

This will set the cube to have breathing behavior by changing the rest length in a sinusoidal fashion. However, such functions require access to simulation time sim->T. I could add a private variable T to each spring that copies the global T, but is there a better way to do this?

Equation for velocity verlet

Hi Jacob,

I was going through your code on the velocity verlet:

Titan/src/sim.cu

Lines 1152 to 1155 in 951733f

#elif VERLET
mass.vel += 0.5 * (mass.acc + mass.force / mass.m) * dt;
mass.acc = mass.force / mass.m;
mass.pos += mass.vel * dt + 0.5 * mass.acc * pow(dt, 2);

It was implemented differently than the one I found in Wikipedia and also in this page, specifically the next position is calcualted based on the previous velocity and acceleration; and in your code the position is updated base on the current velocity and acceleration.

I checked both implementation, your implementation seems to be more stable in larger time step compared to the Wikipedia implementation. Mathematically they are different, can you confirm that your implantation is also correct?
Thanks!

STL import error

Hello,
Running importFromSTL() seems to cause a memory allocation error:

File found. Parsing STL file.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

This was caused by running this code:

#include <Titan/sim.h>
#include <iostream>

int main() {

    Simulation sim;

    sim.importFromSTL("/home/sw3390/Desktop/teapot.stl", 10, 10);
    sim.createPlane(Vec(0, 0, 1), 0);
    sim.start();
    return 0;
}

Thanks!

Installation issue on Ubuntu 18.04, CUDA 10.0

  • Install vcpkg
  • Install CUDA 10.0
  • Build Titan with vcpkg
  • Build test1,test2,test3 in Titan repo

My local file structure

.
├── phaseA
│   └── __pycache__
├── phaseB
│   ├── CMakeFiles
│   │   ├── 3.10.2
│   │   │   ├── CompilerIdC
│   │   │   │   └── tmp
│   │   │   ├── CompilerIdCUDA
│   │   │   │   └── tmp
│   │   │   └── CompilerIdCXX
│   │   │       └── tmp
│   │   ├── CheckLibraryExists
│   │   └── CMakeTmp
│   └── src
├── Titan
│   ├── cmake
│   ├── include
│   │   └── Titan
│   ├── src
│   ├── tests
│   │   ├── test1
│   │   ├── test2
│   │   └── test3
│   └── vcpkg
│       └── titan
└── vcpkg

vcpkg list

$ ./vcpkg/vcpkg list

cuda:x64-linux                                     9.0              A parallel computing platform and programming model
glew:x64-linux                                     2.1.0-1          The OpenGL Extension Wrangler Library (GLEW) is ...
glfw3:x64-linux                                    3.2.1-3          GLFW is a free, Open Source, multi-platform libr...
glm:x64-linux                                      0.9.9.3          OpenGL Mathematics (GLM) https://glm.g-truc.net
opengl:x64-linux                                   0.0-5            Open Graphics Library (OpenGL)[3][4][5] is a cro...
titan:x64-linux                                    1.0              A CUDA-accelerated physics library

Test1 build trace CMakeLists

| 10:52 =>  cmake -DCMAKE_TOOLCHAIN_FILE=/home/tingkai/Courses/mecs4150/project/vcpkg/scripts/buildsystems/vcpkg.cmake test1
-- CUDA FOUND
CMake Error at CMakeLists.txt:29 (find_package):
  By not providing "FindOPENGL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OPENGL", but
  CMake did not find one.

  Could not find a package configuration file provided by "OPENGL" with any
  of the following names:

    OPENGLConfig.cmake
    opengl-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/tingkai/Courses/mecs4150/project/Titan/tests/test1/CMakeFiles/CMakeOutput.log".

Test2 build trace CMakeLists

$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/tingkai/Courses/mecs4150/project/vcpkg/scripts/buildsystems/vcpkg.cmake test2

CMake Error at CMakeLists.txt:18 (find_package):
  Could not find a package configuration file provided by "Titan" with any of
  the following names:

    TitanConfig.cmake
    titan-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/tingkai/Courses/mecs4150/project/Titan/tests/test2/CMakeFiles/CMakeOutput.log".

Test3 build trace CMakeLists

$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/tingkai/Courses/mecs4150/project/vcpkg/scripts/buildsystems/vcpkg.cmake test3

CMake Error at CMakeLists.txt:6 (find_package):
  Could not find a package configuration file provided by "Titan" with any of
  the following names:

    TitanConfig.cmake
    titan-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/tingkai/Courses/mecs4150/project/Titan/tests/test3/CMakeFiles/CMakeOutput.log".

"/usr/bin/ld: cannot find -lglm" when compiling program with Titan

I installed Titan using vcpkg on Ubuntu (on WSL, windows 10). Here is my CMakeLists.txt for the test program in C++:
cmake_minimum_required(VERSION 3.1)
project(test_titan LANGUAGES CXX CUDA)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wall -Wextra")
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
add_executable(test_titan main.cpp)
find_package(Titan CONFIG REQUIRED)
target_link_libraries(test_titan PRIVATE Titan)
target_link_libraries(test_titan PRIVATE glm::glm)

The test code is taken from the Titan github.io page. I have installed vcpkg in /home/username/vcpkg and Titan in /home/username/Titan.

This was an error after installation of titan, but I couldn't make sense of it:
error: Found 1 post-build check problem(s). To submit these ports to curated catalogs, please first correct the portfile: /home/shivang/vcpkg/ports/titan/portfile.cmake

Now, when I try to compile my test program, using the following:
cmake . -DCMAKE_TOOLCHAIN_FILE=/home/username/vcpkg/scripts/buildsystems/vcpkg.cmake
It goes without error, but the next step:
make
gives the following error:

[ 50%] Linking CXX executable test_titan
/usr/bin/ld: cannot find -lglm
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/test_titan.dir/build.make:90: test_titan] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/test_titan.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I have tried a bunch of stuff but can't get this to go. Could this be a problem with WSL?

Error Message in Tutorial 3

Source Code

The main.cpp is as follows:

#include <Titan/sim.h>
#include <iostream>

int main() {
    Simulation sim; // create the basic simulation object.
    sim.setViewport(Vec(20, 20, 10), Vec(0, 0, 10), Vec(0, 0, 1)); // move the viewport so you can see the cubes

    Lattice * l1 = sim.createLattice(Vec(0, 0, 20), Vec(5, 5, 5), 5, 5, 5);
    sim.createPlane(Vec(0, 0, 1), 0);

    l1 -> masses[0] -> addConstraint(CONSTRAINT_PLANE, Vec(0, 0, 1), 0);
    l1 -> masses[20] -> addConstraint(DIRECTION, Vec(0, 1, 1), 0);
    l1 -> masses[0] -> setDrag(100); // add drag to the mass with drag coefficient C equal to 100.

    sim.start();
    while (sim.time() < 10.0) {
        sim.pause(sim.time() + 1.0);
        sim.get(l1); // get lattice data from the GPU;
        l1 -> setSpringConstants(10000 * exp(-sim.time() / 3)); // exponential decay of the spring constant
        sim.set(l1); // push the lattice data to the GPU;
        sim.resume();
    }
    sim.stop();
}

Terminal Trace

the result is

$ ./tutorial3
 
Starting simulation with 125 masses and 1036 springs.
Linking program
Breakpoint set for time 1 reached at simulation time 1.0001!
Breakpoint set for time 2.0001 reached at simulation time 2.0002!
Breakpoint set for time 3.0002 reached at simulation time 3.0002!
Breakpoint set for time 4.0002 reached at simulation time 4.0002!
Breakpoint set for time 5.0002 reached at simulation time 5.0003!
Breakpoint set for time 6.0003 reached at simulation time 6.0004!
Breakpoint set for time 7.0004 reached at simulation time 7.0005!
Breakpoint set for time 8.0005 reached at simulation time 8.0006!
Breakpoint set for time 9.0006 reached at simulation time 9.0007!
Breakpoint set for time 10.0007 reached at simulation time 10.0008!
Breakpoint set for time 10.0008 reached at simulation time 10.0008!
Simulation destructor called.
terminate called after throwing an instance of 'std::runtime_error'
  what():  The simulation has ended. Control functions cannot be called.
Aborted (core dumped)

Issues

  1. Calling sim.pause seems to print out breakpoint message, is this behavior intended since sim.setbreakpoint is a different command?
  2. Not sure where the error comes from in the end.

ubuntu compile error

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

Constraints flag broken

Disabling the constraints flag breaks the build. createBeam is not specified under #idfed CONSTRAINTS but still uses constraints. Detected during debugging of errors introduced in latest master branch. Corrected in Python branch to be able to continue debugging, consider fixing in C++if there is no reason for it to be that way.

windows install error (link lib)

I'm not able to install Titan on windows.

I follow the steps from https://jacobaustin123.github.io/Titan/. but I get a link error:

LINK : fatal error LNK1104: cannot open file 'glm.lib'

I attach log error:

install-x64-windows-dbg-out.log

  • Cuda compilation tools, release 10.1, V10.1.243
  • Vcpkg: 2021-01-13-d67989bce1043b98092ac45996a8230a059a2d7e
  • Visual studio 2017
  • C/C++ Optimizing Compiler: 19.16.27045
  • link: 14.16.27045.0

I see step 8 is ok. nvcc sees glm.lib, but link.exe couldn't

thanks!

Bouncing example error

Example gives main.cpp have the following issues

#include <Titan/sim.h>
int main () {
  // need to add: static Simulation sim;   
  sim.createCube(Vec(0, 0, 10), Vec(2, 2, 2)); // not defined, see error message below
  sim.createPlane(Vec(0, 0, 1), 0);
  sim.setBreakpoint(10.0);
  sim.start();

 // need to have a for loop here otherwise the graphics driver will be constantly shutting down
}

createCube not defined

main.cpp:6:45: error: no matching function for call to ‘Simulation::createCube(Vec, Vec)’                    │
   sim.createCube(Vec(0, 0, 10), Vec(2, 2, 2));  

sim.start() need to have a for-loop afterwards

otherwise I got this:

GPUassert: driver shutting down /home/tingkai/vcpkg/buildtrees/titan/src/420888144f-fb31a06eb3/src/sim.cu 1490
GPUassert: driver shutting down /home/tingkai/vcpkg/buildtrees/titan/src/420888144f-fb31a06eb3/src/sim.cu 1492
GPUassert: driver shutting down /home/tingkai/vcpkg/buildtrees/titan/src/420888144f-fb31a06eb3/src/sim.cu 1490
GPUassert: driver shutting down /home/tingkai/vcpkg/buildtrees/titan/src/420888144f-fb31a06eb3/src/sim.cu 1492
Breakpoint set for time 10 reached at simulation time 10.0001!
terminate called after throwing an instance of 'thrust::system::system_error'
  what():  get_max_shared_memory_per_block :failed to cudaGetDevice: driver shutting down
Aborted (core dumped)

Local development setup

How should I do local development of the Package?

It seems like in the vcpkg/titan/profile.cmake, vcpkg is pulling source directly from GitHub. Can I ask it to use my local folder?

Cpp question about constructor syntax

In the spring.h code, there appear to be multiple constructor definitions. I want to ask about the syntax in the last 3 definitions.

    Spring() { _left = nullptr; _right = nullptr; arrayptr = nullptr; _rest = 1.0; _k = 10000.0; }
    
    Spring(const CUDA_SPRING & spr);

    Spring(Mass * left, Mass * right, double k = 10000.0, double rest_len = 1.0) :
            _k(k), _rest(rest_len), _left(left), _right(right), arrayptr(nullptr) {}; //

    Spring(double k, double rest_length, Mass * left, Mass * right) :
            _k(k), _rest(rest_length), _left(left), _right(right) {};

    Spring(Mass * left, Mass * right, double k = 10000.0, double rest_len = 1.0) :
            _k(k), _rest(rest_len), _left(left), _right(right), arrayptr(nullptr) {}; //

For example, what does Spring(double k, double rest_length, Mass * left, Mass * right) : _k(k), _rest(rest_length), _left(left), _right(right) {}; mean? what does _k(k) mean in this context?

Windows installation error: Building package titan:x64-windows failed with: BUILD_FAILED

Some users have reported an error when installing the windows version using vcpkg:

Error: Building package titan:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: titan:x64-windows
  Vcpkg version: 2018.11.23-nohash

The issue has been resolved.
Those who have run into the error before, please do the following:

  • Delete vcpkg's downloads and buildtrees folders
C:\vcpkg\downloads
C:\vcpkg\buildtrees
C:\vcpkg\ports

This time the installation should finish successfully without any warnings and you may proceed with the rest of the guide.

If you encounter any additional errors please let us know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.