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

10 errors detected in the compilation of upfirdn_2d.cu #17

Open
dauersuchti opened this issue Nov 17, 2022 · 0 comments
Open

10 errors detected in the compilation of upfirdn_2d.cu #17

dauersuchti opened this issue Nov 17, 2022 · 0 comments

Comments

@dauersuchti
Copy link

Thank you very much for your great work and contribution!

I try to get the code running using CUDA Version: 11.6 , Tensorflow 2.8 and Cudnn 8303

When calling the discriminator through train.py I get several NVCC errors in upfirdn_2d.cu.

Tensorflow version: 2.8.0
2022-11-17 09:21:46.087225: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-11-17 09:21:46.430941: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 13626 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3080 Laptop GPU, pci bus id: 0000:01:00.0, compute capability: 8.6
1 Physical GPUs, 1 Logical GPUs
2022-11-17 09:21:56.034905: I tensorflow/stream_executor/cuda/cuda_blas.cc:1786] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
2022-11-17 09:21:56.258153: I tensorflow/stream_executor/cuda/cuda_dnn.cc:368] Loaded cuDNN version 8303

Setting up TensorFlow plugin "upfirdn_2d.cu": PreprocessingC:... 2022-11-17 09:22:04.023226: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 13626 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3080 Laptop GPU, pci bus id: 0000:01:00.0, compute capability: 8.6
CompilingC:... Failed!
Traceback (most recent call last):
File "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "c:\Users\XX.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy_main
.py", line 39, in
cli.main()
File "c:\Users\XX.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\XX.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "c:\Users\XX.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "c:\Users\XX.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "c:\Users\XX.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "C:...\train.py", line 438, in
main()
File "C:...\train.py", line 432, in main
trainer = Trainer(training_parameters, name=f'stylegan2-ffhq-{args["train_res"]}x{args["train_res"]}')
File "C:...\train.py", line 63, in init
self.discriminator, self.generator, self.g_clone = initiate_models(self.g_params,
File "C:...\train.py", line 16, in initiate_models
generator = load_generator(g_params=g_params, is_g_clone=False, ckpt_dir=None, custom_cuda=use_custom_cuda)
File "C:...\load_models.py", line 25, in load_generator
_ = generator([test_latent, test_labels])
File "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:...\stylegan2\generator.py", line 104, in call
image_out = self.synthesis(w_broadcasted)
File "C:...\stylegan2\layers\synthesis_block.py", line 144, in call
x = block([x, w0, w1])
File "C:...\stylegan2\layers\synthesis_block.py", line 83, in call
x = self.conv_0([x, w0])
File "C:...\stylegan2\layers\modulated_conv2d.py", line 71, in call
x = upsample_conv_2d(x, self.in_res, w, self.kernel, self.kernel, self.pad0, self.pad1, self.k)
File "C:...\stylegan2\layers\cuda\upfirdn_2d_v2.py", line 88, in upsample_conv_2d
return _simple_upfirdn_2d(x, new_x_res, k, pad0=pad0, pad1=pad1)
File "C:...\stylegan2\layers\cuda\upfirdn_2d_v2.py", line 106, in _simple_upfirdn_2d
y = upfirdn_2d_cuda(y, k, upx=up, upy=up, downx=down, downy=down, padx0=pad0, padx1=pad1, pady0=pad0, pady1=pad1)
File "C:...\stylegan2\layers\cuda\upfirdn_2d_v2.py", line 146, in upfirdn_2d_cuda
return func(x)
File "C:...\stylegan2\layers\cuda\upfirdn_2d_v2.py", line 138, in func
y = _get_plugin().up_fir_dn2d(x=x, k=kc, upx=upx, upy=upy, downx=downx, downy=downy, padx0=padx0, padx1=padx1, pady0=pady0, pady1=pady1)
File "C:...\stylegan2\layers\cuda\upfirdn_2d_v2.py", line 10, in _get_plugin
return custom_ops.get_plugin(os.path.join(loc, cu_fn))
File "C:...\stylegan2\layers\cuda\custom_ops.py", line 148, in get_plugin
_run_cmd(nvcc_cmd + ' "%s" --shared -o "%s" --keep --keep-dir "%s"' % (cuda_file, tmp_file, tmp_dir))
File "C:...\stylegan2\layers\cuda\custom_ops.py", line 62, in _run_cmd
raise RuntimeError('NVCC returned an error. See below for full command line and output log:\n\n%s\n\n%s' % (cmd, output))
RuntimeError: Exception encountered when calling layer "conv_0" (type ModulatedConv2D).

NVCC returned an error. See below for full command line and output log:

nvcc --std=c++11 -DNDEBUG "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python_pywrap_tensorflow_internal.lib" --gpu-architecture=sm_86 --use_fast_math --disable-warnings --include-path "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\include" --include-path "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\include\external\protobuf_archive\src" --include-path "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\include\external\com_google_absl" --include-path "C:\Users\XX\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\include\external\eigen_archive" --compiler-bindir "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64" 2>&1 "C:...\stylegan2\layers\cuda\upfirdn_2d.cu" --shared -o "C:\Users\XX\AppData\Local\Temp\tmp7cgcj6sd\upfirdn_2d_tmp.dll" --keep --keep-dir "C:\Users\XX\AppData\Local\Temp\tmp7cgcj6sd"

C:...\stylegan2\layers\cuda\upfirdn_2d.cu(310): error: expected an expression
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(310): error: no instance of constructor "tensorflow::register_op::OpDefBuilderWrapper::OpDefBuilderWrapper" matches the argument list
argument types are: (const char [10], __nv_bool)
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(323): error: expected an expression
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(323): error: expected an expression
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(323): error: expected a type specifier
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(323): error: expected an expression
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(324): error: expected an expression
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(324): error: expected an expression
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(324): error: expected a type specifier
C:...\stylegan2\layers\cuda\upfirdn_2d.cu(324): error: expected an expression

10 errors detected in the compilation of "w:/Entwicklung/300_Neural_Network/331_StyleGAN_Keras/stylegan2/layers/cuda/upfirdn_2d.cu".
nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored.
_pywrap_tensorflow_internal.lib
upfirdn_2d.cu

Call arguments received:
• inputs=['tf.Tensor(shape=(1, 512, 4, 4), dtype=float32)', 'tf.Tensor(shape=(1, 512), dtype=float32)']
• training=None
• mask=None

Do you've got any idea how to fix it?

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

1 participant