Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA_NVRTC_ENABLED を無効化したほうが、起動が早くなる説を検証したい #5

Open
gam0022 opened this issue Aug 20, 2019 · 3 comments

Comments

@gam0022
Copy link
Owner

gam0022 commented Aug 20, 2019

.cu を .ptx にプリコンパイルしたい

@gam0022
Copy link
Owner Author

gam0022 commented Aug 20, 2019

なんかコンパイルエラーになるので中止

1>------ ビルド開始: プロジェクト: sutil_sdk, 構成: Release x64 ------
1>Building NVCC ptx file lib/ptx/cuda_compile_ptx_generated_phong.cu.ptx
1>CMake Error at cuda_compile_ptx_generated_phong.cu.ptx.cmake:251 (message):
1>  Error generating
1>  C:/Users/gam0022/Dropbox/redflash/build/lib/ptx/cuda_compile_ptx_generated_phong.cu.ptx
1>
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" はコード 1 を伴って終了しました。
1>プロジェクト "sutil_sdk.vcxproj" のビルドが終了しました -- 失敗。
2>------ ビルド開始: プロジェクト: optixRaymarching, 構成: Release x64 ------
2>Building NVCC ptx file lib/ptx/optixRaymarching_generated_optixRaymarching.cu.ptx
2>CMake Error at optixRaymarching_generated_optixRaymarching.cu.ptx.cmake:251 (message):
2>  Error generating
2>  C:/Users/gam0022/Dropbox/redflash/build/lib/ptx/optixRaymarching_generated_optixRaymarching.cu.ptx
2>
2>
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" はコード 1 を伴って終了しました。
2>プロジェクト "optixRaymarching.vcxproj" のビルドが終了しました -- 失敗。
========== ビルド: 0 正常終了、2 失敗、1 更新不要、0 スキップ ==========

@gam0022
Copy link
Owner Author

gam0022 commented Aug 24, 2019

https://devtalk.nvidia.com/default/topic/1048819/optix/hdr-denoising-variable-has-no-effect/post/5323114/#5323114

Damn, that's due to the CUDA_HOST_COMPILER setting which is not finding the matching cl.exe location, because MSVS 2017 changed the installation folder hierarchy and FindCUDA.cmake is probably not aware of that.

The solution is simple though and part of this thread:
https://devtalk.nvidia.com/default/topic/1036401/optix/optix-installation-windows-cuda-9-2/post/5265364/#5265364

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 and for unknown reasons sutil) with MSVS 2017, 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"

https://github.com/gam0022/redflash/pull/12/files#diff-51242c74e99d0d75fbc77e8a318d94e4R210

@gam0022
Copy link
Owner Author

gam0022 commented Aug 24, 2019

#12

重大度レベル    コード    説明    プロジェクト    ファイル    行    抑制状態
エラー        calling a __host__ function("map") from a __global__ function("intersect") is not allowed    redflash    C:\Users\gam0022\Dropbox\redflash\redflash\redflash.cu    399

重大度レベル    コード    説明    プロジェクト    ファイル    行    抑制状態
エラー        identifier "map" is undefined in device code    redflash    C:\Users\gam0022\Dropbox\redflash\redflash\redflash.cu    399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant