Giter Site home page Giter Site logo

cmakeshift's People

Contributors

bugwelle avatar codecircuit avatar danny- avatar mbeutel avatar shuell avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

codecircuit

cmakeshift's Issues

Cannot find AddressSanitizer_CUDA_workaround.cpp

cmake_minimum_required(VERSION 3.12)
project(debugcuda LANGUAGES CXX CUDA)

find_package(CMakeshift  REQUIRED)

add_executable(main "main.cu")

include(CMakeshift/TargetCompileSettings)
cmakeshift_target_compile_settings(main
    PRIVATE
        default
		diagnostics
        $<$<CONFIG:Debug>:runtime-checks>)

try to build with cmake -DCMAKE_BUILD_TYPE=Debug ..

results in an error:

CMake Error at CMakeLists.txt:7 (add_executable):
  Cannot find source file:

    /CMakeshift/detail/CMakeshift_AddressSanitizer_CUDA_workaround.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

AddressSanitizer & CUDA

ASan and CUDA still cause tooling incompatibilities:

  • nvprof fails due to wrong preload order if ASan is enabled (check can be suppressed with ASAN_OPTIONS=verify_asan_link_order=0, with unknown consequences for ASan accuracy [I observed some false positives])
  • cuda-gdb and other ptrace-based tools don't work with the leak sanitizer in ASan (can be circumvented by disabling the leak checker with ASAN_OPTIONS=detect_leaks=0)

(Question: does the latter issue not appear in CPU-only code?)

This raises the question whether ASan should perhaps not be on by default, either by not including it in runtime-checks, or by not teaching users to use $<$<CONFIG:Debug>runtime-checks> in their settings, and rather set this via cache.

CUDA device invisible in debug build

You have a C++ library which uses CMakeshift to configure the compile settings with:

# compiler settings
include(CMakeshift/TargetCompileSettings)
cmakeshift_target_compile_settings(mycpplib
    PRIVATE
        default
	diagnostics
	$<$<CONFIG:Debug>:runtime-checks>
)

and another CUDA executable which links against that library:

add_executable(cuda_executable ...)
target_link_libraries(cuda_executable
mycpplib::mycpplib
)

If this executable is build with -DCMAKE_BUILD_TYPE=Debug no CUDA device is found any more. This is caused by runtime-checks in the CMakeshift compile settings. If no runtime checks are activated everything works fine.

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.