Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,823
    • Issues 3,823
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21992
Closed
Open
Created Mar 26, 2021 by Robert Chisholm@Robadob

VS: Unable to target "CUDA Linker" -> "Additional Dependencies" project option

If a CUDA target A depends on a second CUDA target B which is a static library, and both have relocatable device code enabled (CUDA_SEPARABLE_COMPILATION). If the CUDA static library is changed, and CUDA target A is incrementally built. The nvcc -dlink stage will not be triggered, so compilation will fail with a device link error.

Prior to CUDA 11.2, this could not be fixed (something would need to be changed in target A, to trick -dlink into being triggered). However in CUDA 11.2, files listed under CUDA Linker->Additional Dependencies are treated as dependencies for the -dlink stage, and if they have been updated will trigger -dlink and the build succeed.

This is not the same using GCC, based on our project configuration. That has always triggered -dlink on incremental builds.

Note, in CUDA 11.0, and likely CUDA 11.1. Specifying a library as both a Host and Device dependency would lead to it being passed twice to -dlink which results in a multiply defined symbols error.

The screenshot below shows the setting we are trying to target.

image

This is likely a bug with CUDA (which I have been following up with them the past week), as the "Use Host Library Dependencies:Yes" option is not treating host dependencies as actual dependencies. However, it could still be useful in other cases to specify device link targets.

We've attempted things like target_link_libraries(${NAME} $<DEVICE_LINK:flamegpu2>), however the DEVICE_LINK genex is restricted to target_link_options(), so that doesn't work.

Could you please add support for manually specifying device link dependencies (or clarify the correct way of doing it if it's already possible).

Thanks Robert

Edited Mar 26, 2021 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking