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

RuntimeError: Could not find MSVC/GCC/CLANG installation on this computer. #13

Closed
justinjohn0306 opened this issue Jan 7, 2021 · 24 comments

Comments

@justinjohn0306
Copy link

Capture

@carlosedubarreto
Copy link

Hello @justinjohn0306 ,
If you can share, how did you get to this point?
I was struggling with the first step, where I have to run

conda env create -f environment.yml

As it didnt creat the enviroment and didnt install any package.
From the print looks like you are using windows system.
Can you share some info?

thanks a lot for the attention.

About your problem, try this, as stated on https://github.com/NVlabs/stylegan2. I think maybe it is what you need (from my previous attemp on other codes installation)

On Windows, the compilation requires Microsoft Visual Studio to be in PATH. We recommend installing Visual Studio Community Edition and adding into PATH using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat".

@carlosedubarreto
Copy link

if you already have Visual Studio installed, just execute this on conda prompt
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
or the place you installed Visual Studio

@justinjohn0306
Copy link
Author

Hello @justinjohn0306 ,
If you can share, how did you get to this point?
I was struggling with the first step, where I have to run

conda env create -f environment.yml

As it didnt creat the enviroment and didnt install any package.
From the print looks like you are using windows system.
Can you share some info?

thanks a lot for the attention.

About your problem, try this, as stated on https://github.com/NVlabs/stylegan2. I think maybe it is what you need (from my previous attemp on other codes installation)

On Windows, the compilation requires Microsoft Visual Studio to be in PATH. We recommend installing Visual Studio Community Edition and adding into PATH using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat".

Hi there, I had to manually install the dependencies and excluded some of them as they were build for Linux.

@carlosedubarreto
Copy link

Thanks a lot Justin....
I'll sit here and install one by one 😊

@justinjohn0306
Copy link
Author

Thanks a lot Justin....
I'll sit here and install one by one 😊

yes, and one more thing it looks like you'll have to install Microsoft Visual Studio version between 2013-2017 for this to work.

@justinjohn0306
Copy link
Author

Any idea how to fix this error?

Capture

@carlosedubarreto
Copy link

carlosedubarreto commented Jan 7, 2021

Looks like its missing some header file to compile.
Maybe you need to install some dev package form tensorflow.

I would suggest you to look at tensorflow issues about this missing file "op.h"

like this issue on another github
charlesq34/pointnet2#36

I cant help better because I'm working now at my job, and cant test it at the moment

@justinjohn0306
Copy link
Author

Looks like its missing some header file to compile.
Maybe you need to install some dev package form tensorflow.

I would suggest you to look at tensorflow issues about this missing file "op.h"

like this issue on another github
charlesq34/pointnet2#36

I cant help better because I'm working now at my job, and cant test it at the moment

Thanks a lot!

@RameenAbdal
Copy link
Owner

RameenAbdal commented Jan 7, 2021

This could help solve compiling issues on Windows.

@johndpope
Copy link

N.B. the stylegan2-ada 2020 project is a version bump from stylegan2 2019 - file formats are compatible.
There's underlying code dnn that should be included in this repo.
https://github.com/johndpope/stylegan2-ada/tree/

It would take a few hours to switch in the dnn lib - and it fixes glitches found in stylegan2 architecture.
there's ops bump that may have relevant fixes
https://github.com/johndpope/stylegan2-ada/blob/digressions/dnnlib/tflib/custom_ops.py

@flavienbwk
Copy link
Contributor

@johndpope Maybe you should open an issue instead of flooding each issue :)

@augustfr
Copy link

RuntimeError: Could not find MSVC/GCC/CLANG installation on this computer. Check compiler_bindir_search_path list in "C:\Users\Administrator\styleflow\dnnlib\tflib\custom_ops.py".

I'm having a similar issue. I already did: C:"Program Files (x86)""Microsoft Visual Studio"\2019\Community\VC\Auxiliary\Build\vcvars64.bat

Seems to have not helped.
I'm python 3.6.16
cuda 10.1
windows server 2019
and have microsoft visual studio community 2019

Any suggestions?

@provostm
Copy link

Hello,

Are you still fighting to install your environment and run the main.py file? (because it is really a fight against the machine lol)

I manage to install it on my Windows 10 computer.
Here are some advices I can give you all :

The command "conda env create -f environment.yml" never worked for me, I had to install each package one by one and some of them failed so I looked for the good channel for the requested version to modify the "-c" argument and relaunch.

Some of the packages needed CUDA or CMAKE so I installed them at the end. I could do another post for this.

For pytorch I use the following command (after installing cuda 10.0) : conda install pytorch==1.1.0 cudatoolkit=10.0 -c pytorch

For pycuda I use this command : pip install --global-option=build_ext --global-option="-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" --global-option="-LC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64" pycuda
Make sure that the path of the include and x64 folder are the same on your computer.

At some point I had the MSVC/GCC/CLANG problem. My issue was that didn't have a "VC" folder in the folder "Microsoft Visual Studio\2017\Community".
(I read that you shouldn't use VS2019, I don't remember where. So I used VS2017.)
To correct it I modify the install of MVS2017 with the VS Installer and add the "Dev Desktop for C++" (the name might be different because my installer is in french).
After that I finally had the VC folder and so on.

Check the file "\dnnlib\tflib\custom_ops.py" and edit, if necessary, the value of the variable compiler_bindir_search_path. Be sure that the path is where you have a "cl.exe" file. I also added this path to the PATH of windows, just to be sure. (a reboot might be necessary to be sure that the PATH has been modify properly).

Another thing I did is to follow the Requirements of https://github.com/NVlabs/stylegan2 which means I managed to have a clean CUDA install by running nvcc test_nvcc.cu -o test_nvcc -run (you need to clone the git before).

After all that you should be good to launch the main.py. (be sure to activate your environment : conda activate <name_of_env>)

@augustfr
Copy link

@provostm Yes I got it figured out on windows. Now the only issue I have is the that gui is cut off on the right side and i can't change display size since I'm on an ec2 rdp client

@provostm
Copy link

@provostm Yes I got it figured out on windows. Now the only issue I have is the that gui is cut off on the right side and i can't change display size since I'm on an ec2 rdp client

Can you modify the scripts ? If yes you can follow this issue : ##19
I commented it to point to the script where you can modify the size of the primary window but you might have horizontal scrolling

@Machspeedz
Copy link

@provostm
Hi,
I followed the steps you detailed as best as I could, and seem to be getting stuck with the path for the variable compiler_bindir_search_path. I added the path to cl.exe to the windows PATH variables as well.
In custom_ops.py my paths look like
compiler_bindir_search_path = [ 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64', 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64', 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/vc/bin', ]
with the first entry being the path that I have to MSVC after modifying my MVS2017 install with the Dev Desktop for C++.

I have CUDA 10.0 installed and as per the StyleGan2 reqs nvcc test_nvcc.cu -o test_nvcc -run works.

When I attempt to run python main.py it says that "The system cannot find the path specified". I can't see where I might have a syntax error but I'd appreciate any ideas about what could be going wrong.

here is the error https://pastebin.com/x4d2mpyf

@provostm
Copy link

provostm commented Feb 1, 2021

@Machspeedz, your error line 3 says that nvcc is in /usr/local/cuda/bin/nvcc which is wrong.
Remove the path and keep only "nvcc" your PATH will do the rest.

@Machspeedz
Copy link

@Machspeedz, your error line 3 says that nvcc is in /usr/local/cuda/bin/nvcc which is wrong.
Remove the path and keep only "nvcc" your PATH will do the rest.

Sorry for the confusion, but remove the path from where? I don't remember ever specifying this path.

@provostm
Copy link

provostm commented Feb 2, 2021

@Machspeedz oh right, it is in the dnnlib/tflib/custom_ops.py file at line 65. (you can look the entire code of the repository by searching in github)

@mdinoulis
Copy link

Even after running

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" 

I am still getting the error message:

RuntimeError('Could not find MSVC/GCC/CLANG installation on this computer. Check compiler_bindir_search_path list in "%s".' % __file__)
RuntimeError: Could not find MSVC/GCC/CLANG installation on this computer. Check compiler_bindir_search_path list in "D:\Projects\stylegan2\dnnlib\tflib\custom_ops.py".

This is what I had in custom_ops.py

compiler_bindir_search_path = [
'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio 14.0/vc/bin', ]

I solved the problem by changing custom_ops.py to:
compiler_bindir_search_path = [
'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio 14.0/vc/bin',
]

as my Visual Studio was actually:
14.28.29910

@bmquynhlinh
Copy link

I fixed it! I found out that Visual studio 2022 install in program file, not program file x86, so just need to modify custom_ops.py :
def _find_compiler_bindir():
patterns = [
'C:/Program Files (x86)/Microsoft Visual Studio//Professional/VC/Tools/MSVC//bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio//BuildTools/VC/Tools/MSVC//bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio//Community/VC/Tools/MSVC//bin/Hostx64/x64',
'C:/Program Files (x86)/Microsoft Visual Studio */vc/bin',
'C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat',
]

@HFourier
Copy link

HFourier commented Apr 8, 2022

custom_ops.py

This method is worked, and I have solved it too!

@Yihang6688
Copy link

I fixed it! I found out that Visual studio 2022 install in program file, not program file x86, so just need to modify custom_ops.py : def find_compiler_bindir(): patterns = [ 'C:/Program Files (x86)/Microsoft Visual Studio//Professional/VC/Tools/MSVC//bin/Hostx64/x64', 'C:/Program Files (x86)/Microsoft Visual Studio//BuildTools/VC/Tools/MSVC//bin/Hostx64/x64', 'C:/Program Files (x86)/Microsoft Visual Studio//Community/VC/Tools/MSVC/_/bin/Hostx64/x64', 'C:/Program Files (x86)/Microsoft Visual Studio */vc/bin', 'C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat', ]

You mean that I don't need to modify the first four lines?

@ll2pakll
Copy link

I've been agonizing with this problem all night tonight, and I've solved it. Just by trying to figure out the right way to do it. Very much misled by what people wrote about the file vcvars64.bat , as it turned out the path is not needed to it. This is what the inserted line looks like, which worked
'c:\Program Files\Microsoft Visual Studio\\2022\Community\VC\Tools\MSVC\\14.33.31629\\bin\Hostx64\\x64'
It is also mandatory to install Visual Studio and there in the section "Development of classic applications in C++" install the module "MSVC version 143".

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