Error Source-File Mapping for some Kernels

Hi everyone,

I have a program with several different consecutive kernel launches. When profiling them using the Nvidia Visual Profiler I can pinpoint the bottleneck to be a memory issue. Now I want to use the PC Sampling feature to get an insight into what parts of the kernel could cause these issues.

To enable the source file mapping, I compiled all my sources with -lineinfo ( or target_compile_options(myTarget PUBLIC "-lineinfo") in CMake). A verbose output while starting make shows that all nvcc invokations contain the -lineinfo flag.

Now, when I want to look into the kernels, the source file mapping appears to work for some of the kernels but not all of them. The critical kernel that I want to look into the most gives the error message “No source file mapping” and that I should use the -lineinfo flag when compiling my kernels.

Are there any other known issues that could cause the source file mapping not to work? Something requirements a kernel needs to fulfill to be mappable to the resulting device assembler?

I am using

  • CMake version 3.20.3
  • nvcc version V11.3.58
  • Nvidia Visual Profiler Version: 11.3

The profiler is running on a Windows host and the application on a Linux target. The remote connection does not appear to be the problem, because running the profiler on the Linux machine locally causes the same error behaviour.

This is how my CMakelists.txt is structured:

cmake_minimum_required(VERSION 3.1)

project(myLib_gpu LANGUAGES CXX CUDA)

add_library(myLib)

set_property(TARGET myLib PROPERTY CXX_STANDARD 17)
set_property(TARGET myLib PROPERTY CXX_STANDARD_REQUIRED TRUE)

set_property(TARGET myLib PROPERTY CUDA_STANDARD 17)
set_property(TARGET myLib PROPERTY CUDA_STANDARD_REQUIRED TRUE)

set_property(TARGET myLib PROPERTY CUDA_ARCHITECTURES 60 61 62)

# ------------------------------------------------------------------------------

# Import JSON library
include(FetchContent)

FetchContent_Declare(json
  GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent
  GIT_TAG v3.10.0)

FetchContent_GetProperties(json)
if(NOT json_POPULATED)
  FetchContent_Populate(json)
  add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

# ------------------------------------------------------------------------------

target_sources(myLib PRIVATE
    src/main.cu
    << all of my additional sources >>
)

# ------------------------------------------------------------------------------

target_include_directories(myLib PRIVATE
    ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
    << all of my include directories >>
)

target_compile_options(myLib PUBLIC "-lineinfo")

target_link_libraries(myLib
    nlohmann_json::nlohmann_json
    << all of my linked libraries >>
)

If you have any tipps or tricks where to start debugging this issue, I would really appreciate the input.

Thanks in advance
Superheitmann