optix installation windows cuda 9.2

I’m trying optix 5.1 install, Windows 10, VS 2017, CUDA 9.2.
CMAKE refuses CUDA version as incompatible. Is that right??

At first CUDA was not found at all.
Had to manually set CUDA_SDK_ROOT_DIR and CUDA_TOOLKIT_ROOT_DIR, both to:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2
Then configure gave me this:

CMake Warning (dev) at CMake/FindCUDA.cmake:742 (find_program):
Syntax error in cmake code at

D:/ProgramData/NVIDIA Corporation/OptiX SDK 5.1.0/SDK/CMake/FindCUDA.cmake:742

when parsing string

CUDA_NVCC_EXECUTABLE;NAMES;nvcc;PATHS;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2;ENV;CUDA_PATH;ENV;CUDA_BIN_PATH;PATH_SUFFIXES;bin;bin64;NO_DEFAULT_PATH

Invalid escape sequence \P

Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
“cmake --help-policy CMP0010” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMake/FindCUDA.cmake:749 (cuda_find_host_program)
CMakeLists.txt:136 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMake/FindCUDA.cmake:742 (find_program):
Syntax error in cmake code at

D:/ProgramData/NVIDIA Corporation/OptiX SDK 5.1.0/SDK/CMake/FindCUDA.cmake:742

when parsing string

CUDA_NVASM_EXECUTABLE;NAMES;nvasm_internal;PATHS;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2;ENV;CUDA_PATH;ENV;CUDA_BIN_PATH;PATH_SUFFIXES;bin;bin64;NO_DEFAULT_PATH

Invalid escape sequence \P

Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
“cmake --help-policy CMP0010” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMake/FindCUDA.cmake:762 (cuda_find_host_program)
CMakeLists.txt:136 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMake/FindCUDA.cmake:742 (find_program):
Syntax error in cmake code at

D:/ProgramData/NVIDIA Corporation/OptiX SDK 5.1.0/SDK/CMake/FindCUDA.cmake:742

when parsing string

CUDA_FATBINARY_EXECUTABLE;NAMES;fatbinary;PATHS;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2;ENV;CUDA_PATH;ENV;CUDA_BIN_PATH;PATH_SUFFIXES;bin;bin64;NO_DEFAULT_PATH

Invalid escape sequence \P

Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
“cmake --help-policy CMP0010” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMake/FindCUDA.cmake:776 (cuda_find_host_program)
CMakeLists.txt:136 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

Requested CUDA version 5.0, but found unacceptable version
CMake Error at D:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find CUDA (missing: CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS
CUDA_CUDART_LIBRARY) (Required is at least version “5.0”)
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
CMake/FindCUDA.cmake:1150 (find_package_handle_standard_args)
CMakeLists.txt:136 (find_package)

Configuring incomplete, errors occurred!
See also “D:/ProgramData/NVIDIA Corporation/OptiX SDK 5.1.0/SDK/build/CMakeFiles/CMakeOutput.log”.

Same error here

I’m assuming you installed the OptiX 5.1.0 SDK and the pre-compiled examples work and now you’re trying to build the OptiX SDK examples?

I’ve not used MSVS 2017 and CUDA 9.2, yet.

What’s the environment variable CUDA_PATH on your systems?
That should be the only environment variable you would need to set to find the CUDA toolkit as needed for OptiX.

If you set some other CMake variables to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2 and CMake complains about an invalid escape sequence \P, that’s because CMake uses forward slashes for file paths.
You might also need to add quotation marks to handle the spaces in the path.

Thanks, that helped.
I am following
INSTALL-WIN.txt
in the Optix SDK directory.

CUDA_PATH is set to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2
I tried to change that too to forward slashes, didn’t help. I’m still getting:

Requested CUDA version 5.0, but found unacceptable version
CMake Error at D:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find CUDA (missing: CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS
CUDA_CUDART_LIBRARY) (Required is at least version “5.0”)
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
CMake/FindCUDA.cmake:1150 (find_package_handle_standard_args)
CMakeLists.txt:136 (find_package)

Configuring incomplete, errors occurred!
See also “D:/ProgramData/NVIDIA Corporation/OptiX SDK 5.1.0/SDK/build/CMakeFiles/CMakeOutput.log”.

I have no option in CMAKE gui to set CUDA_NVCC_EXECUTABLE or CUDA_INCLUDE_DIRS

I shortly tested compiling some *.cu files with MSVS 2017 and CUDA 9.2 and the problem seems to be that the current MSVS 2017 _MSC_VER is 1914 (from MSVC version 19.14.26430.0 in my case) where CUDA 9.2 only supports versions up to _MSC_VER 1913.
https://devtalk.nvidia.com/default/topic/1035535/cuda-setup-and-installation/cuda-9-2-does-not-work-with-visual-studio-2017-15-7-1/2

One solution would be to install MSVS 2017 with the MSVS 2015 tools and use those tools and CUDA 9.0 instead. That’s actually the recommended combination for OptiX 5.1.0 because it was built with that.

Hacking the CUDA 9.2 host_config.h line 131 from this
#if _MSC_VER < 1600 || _MSC_VER > 1913
to this
#if _MSC_VER < 1600 || _MSC_VER > 1914
also gets the *.cu to *.ptx compilation going with MSVS 2017 and CUDA 9.2, but do this at your own risk. There is no guarantee that everything is working because that is an untested combination.

To be able to compile *.cu files which are not used in OptiX device code, but as native kernels (all OptiX Prime examples and the optixRaycasting example), I also needed to set the CUDA_HOST_COMPILER in the CMake GUI explicitly to the 64-bit cl.exe. In my installation that was here:
“C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe”

The problem there is that MSVS 2017 changed the folder hierarchy and the default $(VCInstallDir)bin didn’t work anymore due to the new Hostx64 folder in between.

After that the OptiX 5.1.0 SDK samples compiled and worked with MSVS 2017 (MSVC 19.14.26430.0) and CUDA 9.2.

There actually seems to be an underlying problem. My CUDA installation was incomplete. Trying to reinstall failed miserably. Looking in the forums revealed this as being generally encountered and related to VS2017 and/or driver problems. Anyway, I’m without CUDA now (9.0 also didn’t install), so will wait until NVIDIA has straightened out these several issues.

Yes, I feel your pain. There are bugs in the CUDA 9.x installers and I filed one myself.

When installing the CUDA toolkit, simply disable all options which are related to the display driver contained in the package.
That driver is only needed when the CUDA toolkit is brandnew and no official display driver has been released so far. It’s also often reason why the CUDA installer complains about incompatibilities because it doesn’t know of newer graphics boards released after some CUDA toolkit. Personally I would have put that into the beta section of the display driver downloads.

The CUDA toolchain (compilers, headers, libraries) should always install and that’s all you need for OptiX development.
Simply install the newest available display driver after the toolkit and you should be set.

I did not have a problem installing MSVS 2017 and CUDA 9.2 and the newest display driver from www.nvidia.com (in that order because of an installer bug!) when I did the above test under Windows 10.
You wouldn’t even need the CUDA Visual Studio integration if that runs into problems during installation.
OptiX examples configure the *.cu to *.ptx compilation custom build steps with CMake.

Thanks so much for your help. I actually succeeded getting it done.