Can someone tell me, what to do to fix this?
Traceback (most recent call last):
File "/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1666, in _run_ninja_build
subprocess.run(
File "/home/user/.conda/envs/py3.8_env/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "eval_sde_adv.py", line 29, in <module>
from runners.diffpure_sde import RevGuidedDiffusion
File "/home/user/DiffusionPurification/DiffPure/runners/diffpure_sde.py", line 17, in <module>
from score_sde.losses import get_optimizer
File "/home/user/DiffusionPurification/DiffPure/score_sde/losses.py", line 22, in <module>
from .models import utils as mutils
File "/home/user/DiffusionPurification/DiffPure/score_sde/models/__init__.py", line 15, in <module>
from . import ncsnpp
File "/home/user/DiffusionPurification/DiffPure/score_sde/models/ncsnpp.py", line 18, in <module>
from . import utils, layers, layerspp, normalization
File "/home/user/DiffusionPurification/DiffPure/score_sde/models/layerspp.py", line 20, in <module>
from . import up_or_down_sampling
File "/home/user/DiffusionPurification/DiffPure/score_sde/models/up_or_down_sampling.py", line 18, in <module>
from ..op import upfirdn2d
File "/home/user/DiffusionPurification/DiffPure/score_sde/op/__init__.py", line 9, in <module>
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "/home/user/DiffusionPurification/DiffPure/score_sde/op/fused_act.py", line 19, in <module>
fused = load(
File "/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1080, in load
return _jit_compile(
File "/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1293, in _jit_compile
_write_ninja_file_and_build_library(
File "/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1405, in _write_ninja_file_and_build_library
_run_ninja_build(
File "/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1682, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'fused': [1/3] /home/user/.conda/envs/py3.8_env/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/TH -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/THC -isystem /home/user/.conda/envs/py3.8_env/include -isystem /home/user/.conda/envs/py3.8_env/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 --compiler-options '-fPIC' -std=c++14 -c /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/home/user/.conda/envs/py3.8_env/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/TH -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/THC -isystem /home/user/.conda/envs/py3.8_env/include -isystem /home/user/.conda/envs/py3.8_env/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 --compiler-options '-fPIC' -std=c++14 -c /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
cc1plus: fatal error: cuda_runtime.h: No such file or directory
compilation terminated.
[2/3] c++ -MMD -MF fused_bias_act.o.d -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/TH -isystem /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/THC -isystem /home/user/.conda/envs/py3.8_env/include -isystem /home/user/.conda/envs/py3.8_env/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp -o fused_bias_act.o
In file included from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/c10/core/DeviceType.h:8,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/c10/core/Device.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/c10/core/Allocator.h:6,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/ATen.h:7,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:9:
/home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp: In function ‘at::Tensor fused_bias_act(const at::Tensor&, const at::Tensor&, const at::Tensor&, int, int, float, float)’:
/home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:15:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
15 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
| ^
/home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:21:5: note: in expansion of macro ‘CHECK_CUDA’
21 | CHECK_CUDA(input);
| ^~~~~~~~~~
In file included from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:9:
/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:338:30: note: declared here
338 | DeprecatedTypeProperties & type() const {
| ^~~~
In file included from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/c10/core/DeviceType.h:8,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/c10/core/Device.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/c10/core/Allocator.h:6,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/ATen.h:7,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:9:
/home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:15:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
15 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
| ^
/home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:22:5: note: in expansion of macro ‘CHECK_CUDA’
22 | CHECK_CUDA(bias);
| ^~~~~~~~~~
In file included from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/user/DiffusionPurification/DiffPure/score_sde/op/fused_bias_act.cpp:9:
/home/user/.conda/envs/py3.8_env/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:338:30: note: declared here
338 | DeprecatedTypeProperties & type() const {
| ^~~~
ninja: build stopped: subcommand failed.