Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-31 Thread Brian J. Davis


My responses are inline.

As are mine.

On Sat, Jul 29, 2017 at 7:00 PM, Brian J. Davis http://public.kitware.com/mailman/listinfo/cmake>> wrote:
>/@Robert />//>/I created a fresh simple cmake project in 3.9. This appeared to find 
CUDA />/8.0 successfully so it may have something do with my other project 
settings />/that I am trying to get to work with 3.9, VS13, CUDA 7.5/8.0. />//>/Using: />//>/message( CUDACXX = ${CUDACXX}) />/message( CMAKE_CUDA_COMPILER = ${CMAKE_CUDA_COMPILER}) />//>//>/Reports />//>/CUDACXX= />/CMAKE_CUDA_COMPILER=C:/Program Files/NVIDIA GPU Computing />/Toolkit/CUDA/v8.0/bin/nvcc.exe />/Configuring done />/Generating done />//>/The question was at setting the CUDA version say 7.5 or 8.0. />//>/I search doc for CUDACXX and CMAKE_CUDA_COMPILER with no hits. Is this />/stuff documented anywhere. /

Unfortunately the environment variables are not documented anywhere
and this is a known issue
that I hope to have fixed in CMake 3.10.

The CMAKE_CUDA_COMPILER falls under the the CMAKE__COMPILER documentation
now with the new CUDA support (
https://cmake.org/cmake/help/v3.8/variable/CMAKE_LANG_COMPILER.html  ).



So let me get this straight.  Changes appear to begin in 3.7 / 3.8 with 
VS started to be supported in 3.9, but the only way us schleps on the 
internet know how to use it is to wait until 3.10. Wow... seriously.  
And well I am not holding out *hope*.


>//>/Do I really need to say set: />//>/CMAKE_CUDA_COMPILER=C:/Program Files/NVIDIA GPU Computing />/Toolkit/CUDA/v7.5/bin/nvcc.exe />//>/To get CMake to compile for 7.5? I mean: />//>/find_package(CUDA 7.5) />//>/you could agree is/was much simpler. I am becoming frustrated and 
confused />/by these changes. /

It might be possible in the future to provide other hint controls to
tell CMake which
version of CUDA you would like to use before the project /
enable_language call. This
would be something that is best addressed on the cmake developer list or as
a gitlab issue (https://gitlab.kitware.com/cmake/cmake/issues  )
In the future with the robots... anything is possible... provided they 
are not out to kill us.


Why would I bother to seemingly point out the obvious @developers list 
or issue tracker.  Hopefully anyone reading this can tell I am a bit 
frustrated at this point.  Huh here's how that would go:


Me: Hey Devs you forgot to document how to use the tool.  Do you expect 
anyone but you to know how to use it?


Devs: Huh yea we know...  Ugh ... errr... Huhhh were getting to that.

Me: sigh...
>//>/I can't even get a simple CUDA app to run using FindCUDA (will 
compile) or />/compile using v3.9 and new project( CXX CUDA). />//>/Your example at: />//>/https://cmake.org/cmake/help/latest/manual/cmake-compile-features.7.html />//>//>/Used: />//>/add_executable(CudaConsumeCompileFeatures main.cu) />//>/Is is required now that main.cpp be a .cu file now? I wouldn't think so, />/but I am so lost in the woods on this that I am not sure of anything />/anymore. /

So with the new CUDA support you can mix C/C++/CUDA sources together
inside a single library or executable. This example was only using CUDA
in the executable to reduce the complexity of the test.

Only if I can get it to work.  Which I can't ... and would not know how 
anyway as well it is not documented... so why waste my time.
>//>/How do I get all the toolkit and sdk include and lib dir variables now 
as />/FindCUDA provided? /

The toolkit include directory can be found by querying
CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
As far as CUDA SDK libraries those can simply used with target_link_libraries
as the SDK library path is considered to be an implicit link directory, and will
always be on the link line. This is actually the same for the CUDA sdk include
directory ( it will be placed on the include line when building ).

>//>/I am so curfuffled by these changes. /
These changes are needed to allow targets using CUDA to properly work with
'Modern' CMake 
(https://cmake.org/cmake/help/v3.8/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements).
Without these changes usage requirements and CUDA would never work together.

I assume the term *work* is used loosely VERY loosely.  I hate to 
point out the obvious, but I can't get it to work now and have not clue 
or seemingly hope on figuring it out other than to check out CMake and 
roll my own version after reading impl in order to figure out how it 
does and how to get it to work.  By that time I'd rather revert to 
writing VS xml project file by hand.


Regarding 960M and CUDA  7.5/7.5, 8.0/7.5, and 7.7/9.0

Answer is:

960M was likely released post CUDA  7.5 driver and possibly post 8.0.  
Seems that architecture differences do not allow old drivers to work on 
newer arch

Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-31 Thread Brian J. Davis


Could this be a Win 10 Pro/Enterprise CMake combo issue.  I brought over 
demo project to OS refreshed M4700.  Was Win7 Pro now Windows 10 
Enterprise.


Dell M4700 combo is:

Device 0: "Quadro K1000M"
  CUDA Driver Version / Runtime Version  8.0 / 7.5

CMake 3.2 or 3.9 will build but not run which is the same as on the Dell 
7559 w 960M.


I am rebuilding, due to OS change a rebuild in CMake is necessary, my 
existing project that was working and will test that.  Though simple 3.2 
project does not work so my hopes are not high that my existing project 
will fair any better.


Samples such as NBody work on M4700.

All worked on M4700 Win7 before OS refresh with exception of 3.9 
attempts as I started trying 3.9 on 7559 w/Win10Pro.


Why would it be that CMake can compile an executable but not run it when 
the CUDA samples work?


CUDA SDK Samples run just fine from VS (well when driver run time is 
9.0/7.5 on 7559 w 960M), but simple CMake generated app does not. Simple 
in that it only finds device (0) and calls cudaMalloc... ya know... the 
ultra basic.





--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-30 Thread Brian J. Davis


Saga novella continues:

>> Next I am going to remove all NVIDA drivers and try reinstall of 
CUDA 7.5  see if I can get deviceQuery to report 7.5/7.5.


Nvidia 352.65 driver removal from Add/Remove Programs
Device Manager -> NVIDIA GeForce GTX 960M -> General reports "device has 
been disabled"


Device Query:

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\bin\win64\Debug>rem 
start "Device Query" deviceQuery.exe


C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v7.5\bin\win64\Debug>deviceQuery.exe

deviceQuery.exe Starting...

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

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

Ok so great no driver installed!

Reinstall of CUDA 7.5.18

Run of DeviceQuery:

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\bin\win64\Debug>rem 
start "Device Query" deviceQuery.exe


C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v7.5\bin\win64\Debug>deviceQuery.exe

deviceQuery.exe Starting...

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

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 960M"
  CUDA Driver Version / Runtime Version  7.5 / 7.5
  CUDA Capability Major/Minor version number:5.0
  Total amount of global memory: 4096 MBytes 
(4294967296 bytes)

  ( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA Cores
  GPU Max Clock rate:1176 MHz (1.18 GHz)
  Memory Clock rate: 2505 Mhz
  Memory Bus Width:  128-bit
  L2 Cache Size: 2097152 bytes
  Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 
65536), 3D=(4096, 4096, 4096)

  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 
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 1 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 PCI Domain ID / Bus ID / location ID:   0 / 2 / 0
  Compute Mode:
 < Default (multiple host threads can use ::cudaSetDevice() with 
device simultaneously) >


deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.5, CUDA 
Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GTX 960M

Result = PASS

Ok return to sanity with 7.5/7.5

Return to insanity as NBody still does not work with:

Run "nbody -benchmark [-numbodies=]" to measure performance.
-fullscreen   (run n-body simulation in fullscreen mode)
-fp64 (use double precision floating point values 
for simulation)

-hostmem  (stores simulation data in host memory)
-benchmark(run benchmark to measure performance)
-numbodies=(number of bodies (>= 1) to run in simulation)
-device=   (where d=0,1,2 for the CUDA device to use)
-numdevices=   (where i=(number of CUDA devices > 0) to use 
for simulation)
-compare  (compares simulation results running once on 
the default GPU and once on the CPU)

-cpu  (run n-body simulation on the CPU)
-tipsy= (load a tipsy model file for simulation)

NOTE: The CUDA Samples are not meant for performance measurements. 
Results may vary when GPU Boost is enabled.


> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
> Compute 5.0 CUDA device: [GeForce GTX 960M]
CUDA error at c:\programdata\nvidia corporation\cuda 
samples\v7.5\5_simulations\nbody\bodysystemcuda_impl.h:160 
code=46(cudaErrorDevicesUnavailable) 
"cudaEventCreate(&m_deviceData[0].event)"


There is at this point clearly some very odd behavior with CUDA 7.5 and 
GeForce 960M.  CMake still can build a project, but will not run or 
create memory with cudaMalloc etc.


Installed driver at this point is 353.90.

GeForce Experience reports 381.65 driver

but I have downloaded:

384

Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-30 Thread Brian J. Davis


Things I have tried:

Install Visual Studio 15
Install CUDA 8.0 + patch
Install Visual Studio 13 <- Yes Nvidia / CMake'ers sometimes we have to 
do back ports

Install CUDA 7.5
VS 13 will run CUDA 8.0 samples nbody/deviceQuery
VS 13 does not run CUDA 7.5  samples nbody or any example attempting to 
actually use the GPU.  deviceQuery worked.
CMake v3.2/3.9 compiles with either FindCUDA approach v3.2 or new 
"project" approach v3.9, but neither is able to access the deivce. 
Devcie query code such as in deviceQuery works stating there is a CUDA 
cable device ready and waiting but fails on device access like 
cudaMalloc calls.

Reinstalled CUDA 7.5
Still only VS with 8.0 works with samples.
Used NVIDIA Control panel to assign every program to run on NVIDIA GPU 
such as VS and CMake instead of Integrated graphics through Nvidia 
Optimus Interface.

Used GeForce Experience to get latest driver.
VS, CUDA, CMake is at same state.
Removed all CUDA 8.0 goop
Forced to reinstall/repair VS 13 due to .NET not sure why this happened.
VS unable to run nbody in VS 13 CUDA 7.5
Reinstall CUDA 7.5
Same state
Reinstall CUDA 8.0
VS 13 works with CUDA 8.0 but still  will not run nbody with 7.5 will 
run deviceQuery and report happily there a a CUDA device just beckoning 
to be used.

Removed CUDA 8.0
Removed CUDA 7.5
Removed GeForce Experience to keep it from mucking about in the 
background with what ever driver version shenanigans it may be performing.

Device Manager -> NVIDIA GeForce GTX 960M -> Uninstall device.
Device keeps cumming back across reboots as it appears, may be due to 
NVIDIA Graphics Driver 353.90 in "Add remove programs"

Reinstalled CUDA 7.5
VS 13 runs successfully deviceQuery and nbody with 7.5.  Oddly 
deviceQuery reports driver version at 9.0 ???  Not sure how that's 
possible.  My understanding/experience has been Driver version / Runtime 
match after install say like 7.5 / 7.5, but hey this has gone completely 
off the rails.


C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v7.5\bin\win64\Debug>deviceQuery.exe

deviceQuery.exe Starting...

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

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 960M"
  CUDA Driver Version / Runtime Version  9.0 / 7.5
  CUDA Capability Major/Minor version number:5.0
  Total amount of global memory: 4096 MBytes 
(4294967296 bytes)

  ( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA Cores
  GPU Max Clock rate:1176 MHz (1.18 GHz)
  Memory Clock rate: 2505 Mhz
  Memory Bus Width:  128-bit
  L2 Cache Size: 2097152 bytes
  Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 
65536), 3D=(4096, 4096, 4096)

  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 
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 1 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 PCI Domain ID / Bus ID / location ID:   0 / 2 / 0
  Compute Mode:
 < Default (multiple host threads can use ::cudaSetDevice() with 
device simultaneously) >


deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA 
Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GTX 960M



Device Manager -> NVIDIA GeForce GTX 960M -> Properties reports:
NVidia GeForce GTX 960M
Driver provider: NVIDIA
Driver Date:  7/18/2017
Driver Version: 22.21.13.8494
Digital Signer: Microsoft Windows Hardware Compatibility Publisher

Note: Driver Date:  7/18/2017

Could this mean there is a 9.0 driver in the wild that I cannot download 
from NVIDIA or through GeForce Experience, but may be delivered via OS?  
Posted @ https://devtalk.nvidia.com/default/board/58/ to see if anyone 
knows what is going on here.


CMake 3.2/3.9 still fail to run (again compiles fine)

What It appears I am experiencing is some CUDA 7.5 / 8.0 d

Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-29 Thread Brian J. Davis


With simple stand alone cmake 3.9 project using

cmake_minimum_required(VERSION 3.9)
project(cmake_testing CXX CUDA)

I can get a simple app to compile.  It however fails to run with:

GPU Device 0: "GeForce GTX 960M" with compute capability 5.0

Current device is [0]
Current device is [0]
CUDA error at 
C:\projects\cmake\cmaketesting\v3.9\cuda_basic\src\cuda_basic_test.cpp:67 
code=46(cudaErrorDevicesUnavailable) "cudaMalloc((void **)&d_volume, size)"


When trying to call cudaMalloc.  When trying to actually use the device.

checkCudaErrors(cudaMalloc((void **)&d_volume, size));

So I am right back I started in the new simple project.

I am able to complle and run SDK examples say nbody.

it can only be two things right???  compile args and runtime environment 
(dll paths).  right?  err well or gremlins.


NBody compile important bits:

1>  C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v8.0\5_Simulations\nbody>"C:\Program Files\NVIDIA GPU Computing 
Toolkit\CUDA\v8.0\bin\nvcc.exe" 
-gencode=arch=compute_20,code=\"sm_20,compute_20\" 
-gencode=arch=compute_30,code=\"sm_30,compute_30\" 
-gencode=arch=compute_35,code=\"sm_35,compute_35\" 
-gencode=arch=compute_37,code=\"sm_37,compute_37\" 
-gencode=arch=compute_50,code=\"sm_50,compute_50\" 
-gencode=arch=compute_52,code=\"sm_52,compute_52\" 
-gencode=arch=compute_60,code=\"sm_60,compute_60\" --use-local-env 
--cl-version 2013 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\bin\x86_amd64"  -I./ -I../../common/inc -I./ -I"C:\Program 
Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\/include" 
-I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing 
Toolkit\CUDA\v8.0\include"  -G --keep-dir x64\Debug -maxrregcount=0  
--machine 64 --compile -cudart static -Xcompiler "/wd 4819" -g   -DWIN32 
-DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 
/MTd " -o x64/Debug/bodysystemcuda.cu.obj "C:\ProgramData\NVIDIA 
Corporation\CUDA Samples\v8.0\5_Simulations\nbody\bodysystemcuda.cu"



My simple test app compile bits:

2> C:\projects\cmake\cmaketesting\v3.9\build\cuda_basic\src>"C:\Program 
Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -ccbin 
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64"  
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" 
-I"C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0\common\inc" 
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" 
-I"C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0\common\inc" 
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" 
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"  
-G   --keep-dir x64\Debug -maxrregcount=0  --machine 64 --compile   
-Xcompiler="/EHsc -Zi -Ob0" -g   -D_WINDOWS -D"CMAKE_INTDIR=\"Debug\"" 
-DWIN32 -D_WINDOWS -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -Xcompiler "/EHsc 
/W3 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -o 
cuda_basic_test.dir\Debug\cuda_basic_test.cu.obj 
"C:\projects\cmake\cmaketesting\v3.9\cuda_basic\src\cuda_basic_test.cu" 
-clean
2>CUDACOMPILE : nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' 
architectures are deprecated, and may be removed in a future release 
(Use -Wno-deprecated-gpu-targets to suppress warning).

2>  cuda_basic_test.cu
2>  Building Custom Rule 
C:/projects/cmake/cmaketesting/v3.9/cuda_basic/src/CMakeLists.txt
2>  CMake does not need to re-run because 
C:/projects/cmake/cmaketesting/v3.9/build/cuda_basic/src/CMakeFiles/generate.stamp 
is up-to-date.

2>  Compiling CUDA source file ..\..\..\cuda_basic\src\cuda_basic_test.cu...
2>
2> C:\projects\cmake\cmaketesting\v3.9\build\cuda_basic\src>"C:\Program 
Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" 
-gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env 
--cl-version 2013 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\bin\x86_amd64"  -I"C:\Program Files\NVIDIA GPU Computing 
Toolkit\CUDA\v8.0\include" -I"C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v8.0\common\inc" -I"C:\Program Files\NVIDIA GPU Computing 
Toolkit\CUDA\v8.0\include" -I"C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v8.0\common\inc" -I"C:\Program Files\NVIDIA GPU Computing 
Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing 
Toolkit\CUDA\v8.0\include"  -G   --keep-dir x64\Debug -maxrregcount=0  
--machine 64 --compile -cudart static -Xcompiler="/EHsc -Zi -Ob0" -g   
-D_WINDOWS -D"CMAKE_INTDIR=\"Debug\"" -DWIN32 -D_WINDOWS 
-D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS 
/Zi /RTC1 /MDd /GR" -o cuda_basic_test.dir\Debug\cuda_basic_test.cu.obj 
"C:\projects\cmake\cmaketesting\v3.9\cuda_basic\src\cuda_basic_test.cu"









--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.htm

Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-29 Thread Brian J. Davis

@Robert

I created a fresh simple cmake project in 3.9.  This appeared to find 
CUDA 8.0 successfully so it may have something do with my other project 
settings that I am trying to get to work with 3.9, VS13, CUDA 7.5/8.0.


Using:

message( CUDACXX = ${CUDACXX})
message( CMAKE_CUDA_COMPILER = ${CMAKE_CUDA_COMPILER})


Reports

CUDACXX=
CMAKE_CUDA_COMPILER=C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v8.0/bin/nvcc.exe

Configuring done
Generating done

The question was at setting the CUDA version say 7.5 or 8.0.

I search doc for CUDACXX and CMAKE_CUDA_COMPILER with no hits.  Is this 
stuff documented anywhere.


Do I really need to say set:

CMAKE_CUDA_COMPILER=C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v7.5/bin/nvcc.exe


To get CMake to compile for 7.5?  I mean:

find_package(CUDA 7.5)

you could agree is/was much simpler.  I am becoming frustrated and 
confused by these changes.


I can't even get a simple CUDA app to run using FindCUDA (will compile) 
or compile using v3.9 and new project( CXX CUDA).


Your example at:

https://cmake.org/cmake/help/latest/manual/cmake-compile-features.7.html


Used:

add_executable(CudaConsumeCompileFeatures main.cu)

Is is required now that main.cpp be a .cu file now?  I wouldn't think 
so, but I am so lost in the woods on this that I am not sure of anything 
anymore.


How do I get all the toolkit and sdk include and lib dir variables now 
as FindCUDA provided?


I am so curfuffled by these changes.

Can I get the CMake doc in one (1) html page again... those were the 
good old days when scanning back and forth I would stumble on some good 
bits ... not that I can seemly find the doc for the new CUDA changes.  
This reminds me of the days when I could only get doc on things like 
ExternalProject_Add at the command prompt.






--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-28 Thread Brian J. Davis


Saying I could get this to work, which it is not how, would one using 
project:


Project( myproject CXX CUDA)

specify the version of CUDA to use if I have CUDA 7.5 and 8 installed 
simultaneously.  FindCUDA could do it.  And say if version of cuda could 
be specified why not c++ 0x or 11... Ya know cuz if we are going to be 
able to specify the version of one "first class" language we should be 
able to specify the version of each yeah I am guessing I know the 
answer to this already.  I just had this burning desire to ask this 
question.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-28 Thread Brian J. Davis


@Robert

Adding CUDA to my PROJECT(4DRTProto CXX CUDA)

Yields:


CMake Error at 
C:/projects/4DRTProto/4DRTProto_3rdParty/platform/tools/cmake-3.9.0-rc6-win64-x64/share/cmake-3.9/Modules/CMakeTestCUDACompiler.cmake:45 
(message):

  The CUDA compiler "C:/Program Files/NVIDIA GPU Computing
  Toolkit/CUDA/v8.0/bin/nvcc.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: C:/projects/4DRTProto/4DRTProto/build/CMakeFiles/CMakeTmp



  Run Build Command:"C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe"
  "cmTC_20a4f.vcxproj" "/p:Configuration=Debug" 
"/p:VisualStudioVersion=12.0"


  Microsoft (R) Build Engine version 12.0.31101.0


  [Microsoft .NET Framework, version 4.0.30319.42000]


  Copyright (C) Microsoft Corporation.  All rights reserved.





  Build started 7/28/2017 7:33:34 PM.


  Project
"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj"
  on node 1 (default targets).


  PrepareForBuild:


Creating directory "cmTC_20a4f.dir\Debug\".

Creating directory 
"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\Debug\".


Creating directory "cmTC_20a4f.dir\Debug\cmTC_20a4f.tlog\".


  InitializeBuildStatus:


Creating "cmTC_20a4f.dir\Debug\cmTC_20a4f.tlog\unsuccessfulbuild" 
because "AlwaysCreate" was specified.



  C:\Program Files
  (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA
  8.0.targets(216,9): error : Item 'main.cu' Code Generation value is 
not in

  the expected format '[Arch],[Code]'.
[C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj]



  Done Building Project
"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj"
  (default targets) -- FAILED.





  Build FAILED.






"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj"
  (default target) (1) ->


  (AddCudaCompileMetadata target) ->


C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 
8.0.targets(216,9): error : Item 'main.cu' Code Generation value is not 
in the expected format '[Arch],[Code]'. 
[C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj]






  0 Warning(s)

  1 Error(s)





  Time Elapsed 00:00:00.35






  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)


And so it goes the CMake, CUDA, Visual Studio Experience.  Maybe time to 
revert back to FindCUDA in CMAKE version 3.2.  Sure is awesome.





--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] Fwd: Re: CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-28 Thread Brian J. Davis


@Robert

>> It works and will generate hybrid C++ and CUDA projects. A very 
simple example of making a library and an executable that uses both 
languages can be seen at: 
https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt


Thanks for the example I'll try that.  It's been ages since I even 
looked at my project call


From:

https://cmake.org/cmake/help/latest/command/project.html?highlight=project

Specifically:

"Optionally you can specify which languages your project supports. 
Example languages are C, CXX (i.e. C++), Fortran, etc. *By default C and 
CXX are enabled if no language options are given.* Specify language 
NONE, or use the LANGUAGES keyword and list no languages, to skip 
enabling any languages. "


Looks as though c and cxx are the 1%'ers in the "class" system. Might be 
good to update this documentation whenever Kitware gets around to it.




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-28 Thread Brian J. Davis

@Caleb

I am asking how do I get it to work in post 3.8 or 3.9.  Does it work.  
I know how it worked before CMake 3.2 and prior both on Linux and 
windows... ie ... it did not without considerable manual futzing due to 
NVIDIA's inability to put their goop in a standard location that they 
would be internally consistent with... as though they always picked the 
"new person" to do the release and that person never spoke with the 
person who released the previous version. Believe me I know how it 
?worked? in prior versions... a term used loosely here.


: resend to do T-Bird picking wrong send from addr apologies if you get 
2 of these.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

2017-07-28 Thread Brian J. Davis


@Robert

So how do I go about using it in 3.9?  And more importantly does it 
work?  Does it generate hybrid CPP/CU projects that can be compiled in 
visual studio the way FindCUDA (did/does?).


Currently using FindCUDA, but I have had some CUDA 7.5 / 8.0 and VS 
13/15 cats in a bag trouble.  Finally uninstalled CUDA 8.0  and had to 
reinstall/repair VS13 due to .NET goop removal with 8.0 somehow. Then 
reinstalled 7.5, but still no luck with SampleProjects from NVIDIA.  
Then removed 7.5 and reinstalled 8.0 and sample projects then built the 
8.0 projects and ran successfully with VS13.  NVIDIA states that cross 
mojonation with runtimes and drivers would work just swimmingly... and 
well I got news for them on that one. FindCUDA during 7.5 yeiled 
confusing warning saying that I was specifying 7.5, but it found 8.0 
even though 7.5 was installed as though FindCUDA did not seem to listen 
to the version I was specifying.


I upgraded CMake from 3.2 to 3.9 so I could set env{var} and use CMake's 
Open Project to set env build vars for VS to be used in project settings 
with outthe need for my run_vs.bat script CMake used to have to generate 
with configure_file. So with CMake, CUDA and Visual Studio it's like 
three cats in a bag and one is a like bobcat (CUDA) so it's kinda messy.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMake and Learning from bad examples

2017-07-27 Thread Brian J. Davis



Also at 
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html?highlight=configure_package_config_file


set(INCLUDE_INSTALL_DIR  include/  ...  CACHE  )
set(LIB_INSTALL_DIR  lib/  ...  CACHE  )
set(SYSCONFIG_INSTALL_DIR  etc/foo/  ...  CACHE  )
#...
include(CMakePackageConfigHelpers)
configure_package_config_file(FooConfig.cmake.in
  ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
  INSTALL_DESTINATION  ${LIB_INSTALL_DIR}/Foo/cmake
  PATH_VARS  INCLUDE_INSTALL_DIR  SYSCONFIG_INSTALL_DIR)
write_basic_package_version_file(
  ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
  VERSION  1.2.3
  COMPATIBILITY  SameMajorVersion  )
install(FILES  ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
  ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
DESTINATION  ${LIB_INSTALL_DIR}/Foo/cmake  )


Does

INSTALL_DESTINATION  ${LIB_INSTALL_DIR}/Foo/cmake

from configure_package_config_file and

install(FILES  ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake 

install the file twice?  Is this from department of redundancy 
department department?.




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] ExternalProject_Add and include_external_msproject dynamic duo... but what if their powers combined?

2017-01-11 Thread Brian J. Davis
Every time I create a superbuild using ExternalProject_Add sooner or 
later a project will not support cmake, but will have buried within its 
bowels  a visual studio solution project .sln and sometimes gobs of 
.vcxproj files (read CPython).  Now ofcourse include_external_msproject 
can do this.  If only these two wonder twins 
(https://en.wikipedia.org/wiki/Wonder_Twins) could work together in the 
same ExternalProject_Add command.  Maybe by adding after HG_TAG say 
VCX_PROJS or some such.


Only thing better would be getting original project maintainer to 
support CMake.


So feature request: Can we get ExternalProject_Add to support visual 
studio project files?




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] Calling NMake from CMake

2012-06-16 Thread Brian J. Davis


Since I do not see a FindNmake or the likes, is there a way to call 
Nmake from a CMakeLists.txt file?


The root CMakeList.txt file contains:

set( LIBTIFF_CONFIGURE_FILE ${TOP}/CMake/libtiff/CMakeLists.txt.config )
configure_file( ${LIBTIFF_CONFIGURE_FILE} 
${SOURCE_DIR}/libtiff/CMakeLists.txt.config )


externalproject_add(
  libtiff
  URL http://download.osgeo.org/libtiff/tiff-4.0.2.zip
  DOWNLOAD_DIR ${DOWNLOAD_DIR}
  SOURCE_DIR ${SOURCE_DIR}/libtiff
  INSTALL_DIR ${INSTALL_DIR}

)

Where the configure_file dumps a CMakeLists.txt file wich is generated 
form CMakeLists.txt.config into the libtiff source directory so that 
ExternalProject_Add has a CMakeLIsts.txt file.  It is in this 
CMakeLists.txt file that I need to spawn the build for libtiff such as:


nmake /f makefile.vc

Though CMake does not seem to support nmake calls from CMakeLists.txt 
files configured to generate VisualStudio Build Files.  Basically I want 
a visual studio target to build libtiff using nmake.  How does one do this?


I have been able to do this for zlib, and libpng

There are a myriad of projects all with their each flavor of building 
their source which I need to build.  it's a regular potpourii of source 
build scents and not in a good way.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake