Can't load sample projects after local installation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 9.6k
- Forks
- 2.4k
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
I followed the procedure for installation of the CUDA Toolkit found here
https://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#local-installer
After cloning this repo and attempting to load the projects I got the following error regarding importing the projects.
C:\Users\jerem\source\repos\cuda-samples\Samples\0_Introduction\clock_nvrtc\clock_nvrtc_vs2022.vcxproj : error : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.1.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.1.props" is correct, and that the file exists on disk. C:\Users\jerem\source\repos\cuda-samples\Samples\0_Introduction\clock_nvrtc\clock_nvrtc_vs2022.vcxproj
This error popped up for all the projects and the reason was the CUDA 12.1.props and CUDA 12.1.targets files were not where my VCTargetsPath was pointing. My CUDA props file was located here
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\extras\visual_studio_integration\MSBuildExtensions\CUDA 12.1.props
But the VCTargetsPath was pointing here
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations
So, it seems the default location for the local installation of the toolkit doesn't match where Visual Studio is expecting to find the visual c++ target files.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Samples/0_Introduction/clock_nvrtc/clock_nvrtc_vs2022.vcxproj and inspect its import declarations for CUDA 12.1.props and CUDA 12.1.targets. Compare those paths with the local installation under extras/visual_studio_integration/MSBuildExtensions and the Visual Studio BuildCustomizations path; done means the sample projects import successfully after a local CUDA Toolkit installation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100