2

I am attempting to set up PyTorch to work my laptop's on board GTX 1050 GPU. Following this I have attempt to set up CUDA, I have been following the guide set up by Nvidia here. As far as I can tell I haven't had any issues with this. I can run nvcc -V and get below as I would expect:

enter image description here

When I attempt to run the sample solutions they provide to ensure the installation was successful - ie nvcc displayQueue or nvcc bandwidth I only received the following error:

enter image description here

In following with this, I attempted to download the community version of Visual Studio 2017 to obtain a C++ compiler and "cl.exe". Upon doing this though it appears that the installation did not set a path to a compiler "cl.exe" in the environment variables.

Attempting to find a "cl.exe" in my files appears to be another issue as I have multiple "cl.exe"'s under the following paths:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86
\...\bin\Hostx86\x64
\...\bin\Hostx64\x64
\...\bin\Hostx64\x86

Setting any one of these paths to PATH in my environment variables then running "nvcc displayQueue" or "nvcc bandwidth" again then only gives the error:

enter image description here

Something has changed, but the system does not appear to work.
Any help is greatly appreciated.

9
  • In this answer the solution was to go down in CUDA version to 9.1 and VS2017 version 15.6.7.
    – harrymc
    Apr 1, 2019 at 20:30
  • Possible duplicate of Install Drywall Authentication
    – Ramhound
    Apr 1, 2019 at 20:43
  • I believe this is due to WindowsSDKDir not pointing to the correct location. You need to install the proper Windows SDK, since cl.exe, belongs to it. It does not matter which version of the Windows SDK you install, install the current version, and all it's components
    – Ramhound
    Apr 1, 2019 at 20:45
  • I am not very familiar with Visual Studio, but I believe I did install the correct Windows SDK. In the installation window for VS, the option "Windows 10 SDK (10.0.17763.0)" was selected. If this isn't the correct SDK, what would be - is there a version specific to CUDA I should use?
    – J. Auon
    Apr 1, 2019 at 20:51
  • Is your GTX 1050 a CUDA-enabled GPU? I have a feeling the on-board version is not the same as the one that is listed.
    – DrZoo
    Apr 1, 2019 at 20:55

2 Answers 2

1

Setting only cl.exe path will not take effect as it need other tools also. The official way is to use developer command prompt that comes with Visual Studio only.

According to this:

Try searching for the name of the command prompt file, such as VsDevCmd.bat, or go to the Tools folder such as C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools (path changes according to your Visual Studio version, edition, and installation location).

Open a Command Prompt (CMD) window, run this command:

call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 

This will set all the required paths for you. The x64 parameter is for 64 bit Intel CPU only. Change that parameter to x86 for 32 bit Intel CPU. Or arm and arm64. The path may change according to your Visual Studio version. Do not close that CMD window. You can also check the path (if it is set correctly) with where cl.exe command. Now run the required commands to compile.

Note: If you need only C++ compiler try the VS build Tools and Windows SDK only.

1
  • Thank you for the reply, but it doesn't appear to have fixed my issue. Running the command above in a VS developer CMD appears to set the paths, but running "nvcc displayQueue" or similar leaves me with the same issue as listed in the final image in my original post.
    – J. Auon
    Apr 1, 2019 at 21:26
0

You will first need to find out your gpu details using the method in the question part there, that is the deviceQuery app according to https://forums.developer.nvidia.com/t/what-is-the-compute-capability-of-a-geforce-gt-710/146956/4:

there should be a deviceQuery executable in the demo suite of your CUDA installation. On Windows it should be in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y\extras\demo_suite, where X.Y specifies your CUDA version, e.g. 10.2. deviceQuery will tell you the compute architecture of your device: CUDA Capability Major/Minor version number.

Now have a look at How to install pytorch (with cuda enabled for a deprecated CUDA cc 3.5 of an old gpu) FROM SOURCE using anaconda prompt on Windows 10? and there point 3 to 5 of the answer. The core is basically point 3, the table with the green arrows in it. Look up that table in the original https://gist.github.com/ax3l/9489132 again and make the decision the same way as it was done in point 3.

The table will show you how to choose the right MSVC compiler for the right CUDA compiler driver for your gpu SM Arch (e.g. CUDA cc [= compute capability] 3.5, CUDA cc 8.0 or whatever you card provides).

If you need to install pytorch with cuda from source because your card might not be supported anymore by the official pytorch installer (which I read between the lines in your question), the whole answer there should be relevant for the answer here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .