Windows Build Error C2338

I’ve been trying to set up pytorch on my pc with an old GPU for a while. Some previous details here:

I have updated visual studio to 2019 and now get the a C2338 error as in the log here:

The main links i found for this error are the pytorch discussion topic 31484 and the pytorch github topic 9122 (can only include 2 links apparently). The first is unhelpful while the second says to use vsx64 shell but i’m doing this through anaconda so I’ve been using an anaconda terminal i’m not sure if its relevant or how i would be able to install to anaconda using the vsx64 shell.

Not sure where to do from here, i’m kind of flailing around so any help would be appreciated. Note: env details included below.

Collecting environment information…
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A

OS: Microsoft Windows 7 Professional
GCC version: Could not collect
CMake version: version 3.14.0

Python version: 3.7
Is CUDA available: N/A
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: GeForce GTX 770M
Nvidia driver version: 425.31
cuDNN version: E:\python\Cuda\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip] numpy==1.16.5
[pip] numpydoc==0.9.1
*[conda] blas 1.0 mkl *
*[conda] mkl 2019.4 245 *
*[conda] mkl-include 2019.4 245 *
*[conda] mkl-service 2.3.0 py37hb782905_0 *
*[conda] mkl_fft 1.0.14 py37h14836fe_0 *
[conda] mkl_random 1.1.0 py37h675688f_0

You’ll need this PR: For some reason, I cannot land it to master.

1 Like

That fixed it thank you for all your help.

Keywords: error C2338: CopyToCPU requires fundamental types

I went to the github commit linked above which is a branch of the peterjc123/pytorch repo. I cloned that repo and use the command checkout branch is_fundamental_fix (you can see all branches with git branch -a). You can verify that you are using the correct branch by checking that the changes in are consistent with what you have on your machine. From there I did the normal pytorch install from source commands.