-
Notifications
You must be signed in to change notification settings - Fork 500
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
NVCC error. Compilation of custom CUDA ops on Windows 10 for Tensorflow 2.x #104
Comments
try https://github.com/johndpope/stylegan2-ada/ tensorflow is dead to nvidia labs - gotta move to pytorch. |
@johndpope the links you suggested don't seem to have any changes for Windows compile flags, only Linux. Though I tried it, yet ops are still not compiled and the error is the same. Just in case you didn't notice, I mentioned that I had tried to disable v2 behaviour (one of the main changes in shared links), but no success. I know that there is an official PyTorch port and all upcoming projects by NVlabs will use it, yet I still would like to compile the ops on Windows and Tf 2.x. |
I had some problems with fused ops on Linux / one of the problems was gcc version. When os updated / version bumped to 10.3 (broken) 10.2 was working fine and had similar error. Had to link nvcc to Gcc 9 vs downgrading system Gcc. |
Interesting. On Windows I use Visual Studio and MSVC (suggested by NVlabs and works for Tf 1.14). Actually, one of my guesses was that some versions of MSVC are not compatiable with Tf 2.x (except the old ones), so I tried using MSVC 14.16 (VS 2017) and MSVC 14.29 (VS 2019), but none of them worked for Tf 2.x. I'm not sure if it's a compiler version, some missing components of VS (though again it works for Tf 1.14), Visual Studio version or compilation options (most likely this one in my opinion). |
I has the same problem to build 'upfirdn_2d.cu'. D:/notebook_root/StyleGAN2-TensorFlow-2.x-master/dnnlib/ops/upfirdn_2d.cu(310): error: expected an expression D:/notebook_root/StyleGAN2-TensorFlow-2.x-master/dnnlib/ops/upfirdn_2d.cu(310): error: no instance of constructor "tensorflow::register_op::OpDefBuilderWrapper::OpDefBuilderWrapper" matches the argument list |
Hi everyone,
I'm trying to compile custom CUDA ops on Windows 10 for Tensorflow 2.x, however, I encountered a problem.
Below is the output of compilation of fused_bias_act op.
This is how these lines look in script (taken from the repo):
It's the same as sescribed by
mavanmanen
here.I tried several conda environments and here are the results:
As you can see the problem seems to be related to Tf 2.x (see option 1). I thought maybe it had something to do with cuda/cudnn, but trying different versions didn't help (see options 2 and 3). I also thought that maybe something isn't installed when using conda channels, but again the result is the same (see options 3 and 4). I tried to use Tf v1 mode, but it also didn't provide result. Code for this:
I noticed that most of Tf 2.x ports of StyleGAN2/StyleGAN2-ADA (both projects have these custom ops) use different flags for compilation on Linux. Example 1 and 2.
The changes are aligned with the offical Tf 2.x guide for custom ops. However, none of the ports I found changes anything for Windows (except for the path to MSVC). The guide also only provides details for Linux.
I have found an official repo with details for both: Linux and Windows, but it didn't help me a lot. It has a potentially very useful BAZEL build file, which provides flags/options for Windows, but, unfortunately, still I couldn't compile the op. I tried to explicitly add flags to the script from this repo (I mean StyleGAN2-ADA), but I only had errors saying that some of them are not recognized. Note: I still tried to compile them with MSVC, not with Bazel.
So, if anyone could help wih compiling these ops on Windows with Tensorflow 2.x, it would be great. Pieces of code (explicit compilation flags, etc.), ideas, explanations and just thoughts are welcome.
Thanks in advance
The text was updated successfully, but these errors were encountered: