View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015482CMakeCMakepublic2015-03-30 16:342016-02-01 09:10
ReporterCurtis Mahieu 
Assigned ToJames Bigler 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015482: CUDA - Support Static Linked Binaries.
Descriptioncurrently FindCUDA searches for "cudart" and other CUDA equivalent libraries.
These find the dynamic versions of the files, as they are named libcudart.so libcudart.dylib.... etc.

It seems to be impossible to compile with the static files named "libcudart_static.a"
TagsNo tags attached.
Attached Files

 Relationships
related to 0015723closedRolf Eike Beer Regression: FindCUDA fails for C++ only projects in CMake 3.3.1 due find_package(Threads), while it works well in CMake 3.2.3 

  Notes
(0038364)
Brad King (manager)
2015-03-30 16:42

One could set the CUDA_*_LIBRARY cache entries explicitly to refer to the static libraries.
(0038366)
James Bigler (developer)
2015-03-30 17:01

I do have a pending change that enables this feature. I've been testing it and need to find some time to integrate it.
(0038367)
Curtis Mahieu (reporter)
2015-03-30 17:06

Im overriding the variable as a temporary solution, but i have to switch based on the OS as I can't see an easy way to get access to the /lib or /lib64 variable.

James, Thanks for the awesome Module!
(0038368)
Curtis Mahieu (reporter)
2015-03-30 19:39

I had some ordering wrong when i first tested my "work around" when i actually overrisde the library using this:

find_package(CUDA)
get_filename_component(CUDA_LIB_FOLDER ${CUDA_LIBRARIES} DIRECTORY)

unset(CUDA_LIBRARIES)
set(CUDA_LIBRARIES "${CUDA_LIB_FOLDER}/libcudart_static.a")

message("Using static lib: " ${CUDA_LIBRARIES})

i can see this in the build log:
Using static lib: /usr/local/cuda/lib/libcudart_static.a

But when i go to actually run the binary i get this message:

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

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

Process finished with exit code 1

NOTE: I just made a quick sample out of the deviceQuery CUDA sample source.
(0038369)
Curtis Mahieu (reporter)
2015-03-30 19:43

James,
Is there any way you could post / point me to you patch that has this support. I could at least then bundle it into the project Im working on.
(0038375)
James Bigler (developer)
2015-03-31 15:04

I could give you a copy of the FindCUDA that has these changes, but there are a few other changes in there that would need to be removed to make it work for you.

Do you have the ability to use a custom FindCUDA?
(0038376)
Curtis Mahieu (reporter)
2015-03-31 15:24

yeah i can use a custom findCUDA.
(0038377)
James Bigler (developer)
2015-03-31 16:20

I just teased it apart. You can find a copy in stage:

http://www.cmake.org/gitweb?p=stage/cmake.git;a=shortlog;h=refs/heads/FindCUDA.cmake/StaticRuntime [^]
(0038378)
Curtis Mahieu (reporter)
2015-03-31 16:27

Awesome! Thanks!

Ill test it out today.
(0038379)
Curtis Mahieu (reporter)
2015-03-31 17:12

Works perfectly! Thanks!
(0038380)
James Bigler (developer)
2015-03-31 17:16

What platforms have you tried? I developed this for Windows, Linux, and Mac.
(0038381)
Curtis Mahieu (reporter)
2015-03-31 18:44
edited on: 2015-03-31 18:57

I tested it on Mac and Linux.

(0038394)
Brad King (manager)
2015-04-03 10:14
edited on: 2015-04-03 10:15

I revised the commit message slightly and added a release note. The commit is now:

 FindCUDA: Use the static CUDA runtime library if available
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7fea2b77 [^]

(0040387)
Robert Maynard (manager)
2016-02-01 09:10

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-03-30 16:34 Curtis Mahieu New Issue
2015-03-30 16:42 Brad King Note Added: 0038364
2015-03-30 17:01 James Bigler Note Added: 0038366
2015-03-30 17:06 Curtis Mahieu Note Added: 0038367
2015-03-30 19:39 Curtis Mahieu Note Added: 0038368
2015-03-30 19:43 Curtis Mahieu Note Added: 0038369
2015-03-31 15:04 James Bigler Note Added: 0038375
2015-03-31 15:24 Curtis Mahieu Note Added: 0038376
2015-03-31 16:20 James Bigler Note Added: 0038377
2015-03-31 16:27 Curtis Mahieu Note Added: 0038378
2015-03-31 17:12 Curtis Mahieu Note Added: 0038379
2015-03-31 17:16 James Bigler Note Added: 0038380
2015-03-31 18:44 Curtis Mahieu Note Added: 0038381
2015-03-31 18:57 Curtis Mahieu Note Edited: 0038381
2015-04-03 10:14 Brad King Note Added: 0038394
2015-04-03 10:15 Brad King Note Edited: 0038394
2015-04-03 10:16 Brad King Assigned To => James Bigler
2015-04-03 10:16 Brad King Status new => resolved
2015-04-03 10:16 Brad King Resolution open => fixed
2015-04-03 10:16 Brad King Fixed in Version => CMake 3.3
2015-04-03 10:16 Brad King Target Version => CMake 3.3
2015-09-02 09:04 Brad King Relationship added related to 0015723
2016-02-01 09:10 Robert Maynard Note Added: 0040387
2016-02-01 09:10 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team