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 not found on windows 10 #461

Closed
Fqlox opened this issue Apr 9, 2022 · 14 comments
Closed

Cuda not found on windows 10 #461

Fqlox opened this issue Apr 9, 2022 · 14 comments

Comments

@Fqlox
Copy link

Fqlox commented Apr 9, 2022

Hi, I wanted to build the project on windows 10 but got some issue when preparing the build.

I got :

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.29.30136.0
-- The CXX compiler identification is MSVC 19.29.30136.0
-- The CUDA compiler identification is unknown
CMake Error at G:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:633 (message):
  Failed to detect a default CUDA architecture.



  Compiler output:

Call Stack (most recent call first):
  CMakeLists.txt:11 (PROJECT)

I did reinstall CUDA and update it to the path to the latest version with the visual studio integration.
And add the files in the VS directory as expected.

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_Mar__8_18:36:24_Pacific_Standard_Time_2022
Cuda compilation tools, release 11.6, V11.6.124
Build cuda_11.6.r11.6/compiler.31057947_0

Thanks in advance

@kdand35
Copy link

kdand35 commented Apr 11, 2022

Same problems for me, waiting for the solutions.

@Ardibid
Copy link

Ardibid commented Apr 11, 2022

Same issue here! It would be great if you could help with this.

@bdweix
Copy link

bdweix commented Apr 17, 2022

Same issue here - working through some troubleshooting now. I’ll update if I figure it out!

@spacemishka
Copy link

Same here....why is this always such a PITA?!

@greenbrettmichael
Copy link

are you running from developer command prompt or developer powershell?

@Fqlox
Copy link
Author

Fqlox commented Apr 30, 2022

are you running from developer command prompt or developer powershell?

I tested on both, also with and without "run as administrator"

@greenbrettmichael
Copy link

Thank you for your quick reply while I am still looking at this!
I am not affiliated with the project but I just got this up and running on Windows.

A couple of diagnostic questions that might be helpful
it says that you are using the VS 2019 generator, do you have VS 2022 installed as well? that could be a potential source of errors if the VS integration is installed to one particular installation

do you see the path similar to
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin
in your system path? also have you reset your computer since the CUDA tk was installed ? powershell can be quite sticky about env vars depending on host terminal

@Fqlox
Copy link
Author

Fqlox commented May 1, 2022

A couple of diagnostic questions that might be helpful it says that you are using the VS 2019 generator, do you have VS 2022 installed as well? that could be a potential source of errors if the VS integration is installed to one particular installation

I got also VS 2017 installed, It got installed with Unity.

do you see the path similar to C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin in your system path? also have you reset your computer since the CUDA tk was installed ? powershell can be quite sticky about env vars depending on host terminal

I got CUDA installed to my path, Not on C: but on HDD and it works ("nvcc" prompt works, and conda env with pytorch/tensorflow load CUDA).

@kdand35
Copy link

kdand35 commented May 1, 2022

This is my current error, I am using VS 2019 and cuda 11.5, still cannot fix it so far.......
C:\instant-ngp\instant-ngp-master>cmake . -B build
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.5/bin/nvcc.exe
CMake Error in C:/instant-ngp/instant-ngp-master/build/CMakeFiles/CMakeTmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_38f99".

CMake Error in C:/instant-ngp/instant-ngp-master/build/CMakeFiles/CMakeTmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_38f99".

CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCUDACompiler.cmake:39 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
CMakeLists.txt:11 (PROJECT)

-- Configuring incomplete, errors occurred!
See also "C:/instant-ngp/instant-ngp-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/instant-ngp/instant-ngp-master/build/CMakeFiles/CMakeError.log".

@greenbrettmichael
Copy link

@Fqlox the reply by @kdand35 made me reread top post
the issue is not "Cuda not found" but "Failed to detect a default CUDA architecture"

you should be able to use CUDA and CMAKE mailing lists to further debug this issue

re: @Fqlox cmake is not populating CUDA_ARCHITECTURES for your build

@kdand35 this is covered in the FAQ with this answer Windows: the Visual Studio CUDA integration was not installed correctly. Follow mitsuba-renderer/mitsuba2#103 (comment) to fix the problem without re-installing CUDA. (#18)

@Fqlox
Copy link
Author

Fqlox commented May 4, 2022

@Fqlox the reply by @kdand35 made me reread top post the issue is not "Cuda not found" but "Failed to detect a default CUDA architecture"

you should be able to use CUDA and CMAKE mailing lists to further debug this issue

re: @Fqlox cmake is not populating CUDA_ARCHITECTURES for your build

@kdand35 this is covered in the FAQ with this answer Windows: the Visual Studio CUDA integration was not installed correctly. Follow mitsuba-renderer/mitsuba2#103 (comment) to fix the problem without re-installing CUDA. (#18)

I did this, and still getting the same issue compiling

@kdand35
Copy link

kdand35 commented May 10, 2022

Hi, @Fqlox !
I complete the compilation yesterday! Some tips might be helpful for you.

Previously, I only downloaded the zip file of this project and compile it on my computer. To pass the above problems, I just deleted the whole file I downloaded and rebuilt it again. The reason might be I tried to use several versions of Cmake to compile and it made some remains in my build/CMakeFiles path. I am not sure if it is the true reason, it passed the above problems, but I met something new.......

Yesterday, I used Git to clone and compile, and it works. Also, I found a good video to show how to install it and very helpful for the installation. Please also refer: https://www.youtube.com/watch?v=kq9xlvz73Rg&t=563s

I am not sure if there are some differences between these two ways, but really recommend you use Git if you don't use it currently.

Good luck and Hope it helps!

@Fqlox
Copy link
Author

Fqlox commented May 15, 2022

I did installed via git, since the --recursive args allows to download dependencies. I did delete and redownload the repo, uninstalled VS 2019 and installed it again, swapped the CUDA File VS need (from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\extras\visual_studio_integration\MSBuildExtensions to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations ).

I did look the tutorial and did exaclty the same stuff as mentionned : still got the issue while preparing the compilation.

@Fqlox
Copy link
Author

Fqlox commented May 19, 2022

I managed to correct this issue by fully uninstalling Visual Studio and CUDA and reinstalling both on the system drive without changing the installation path.

@Fqlox Fqlox closed this as completed May 19, 2022
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

6 participants