Error setting up pytorch plugins

Windows 10 + CUDA 11.1 + pytorch 1.8.0 + vs2019(added to path)+ rtx 3060 + conda.

I’m trying to run

“ --outdir=out --target=mytargetimg.png

in stylegan2ada implementation, but can’t past beyond this error:

Loading networks from ""...
Computing W midpoint and stddev using 10000 samples...
Setting up PyTorch plugin "bias_act_plugin"... C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\ UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x87 in position 5: invalid start byte
  warnings.warn(f'Error checking compiler version for {compiler}: {error}')
D:\sgan2ada\torch_utils\ops\ UserWarning: Failed to build CUDA kernels for bias_act. Falling back to slow reference implementation. Details:

Traceback (most recent call last):
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\", line 1667, in _run_ninja_build
  File "C:\Anaconda3\envs\sgan2ada\lib\", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\sgan2ada\torch_utils\ops\", line 48, in _init
    _plugin = custom_ops.get_plugin('bias_act_plugin', sources=sources, extra_cuda_cflags=['--use_fast_math'])
  File "D:\sgan2ada\torch_utils\", line 110, in get_plugin
    torch.utils.cpp_extension.load(name=module_name, verbose=verbose_build, sources=sources, **build_kwargs)
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\", line 1079, in load
    return _jit_compile(
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\", line 1292, in _jit_compile
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\", line 1404, in _write_ninja_file_and_build_library
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\", line 1682, in _run_ninja_build
    message += f": {error.output.decode()}"  # type: ignore
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 1233: invalid start byte

  warnings.warn('Failed to build CUDA kernels for bias_act. Falling back to slow reference implementation. Details:\n\n' + traceback.format_exc())
Setting up PyTorch plugin "upfirdn2d_plugin"...

Double checked all the variables. I even removed environment and tried on 1.7 and 1.9 and tried all relevant posts on github but still no luck. Any advice?

The error is raised due to a failure in the decoding. You could try to save the file as 'utf-8' or check for any characters, which could yield this error. I think 0x87 would point to a cedilla, so maybe you could check all files for this character.

I added more error log but I doubt this has something to do with encoding as I downloaded file from github and did no changes on it. I simply do this on Ipython console:

%run --outdir=out --target=mytargetimg.png --network=

Could this be related to system locale. Here is the output of cl.exe:

I guess root cause is this: