Thanks for your well-organized code. When I run your code, an error is as follow:
**Using /home/qwt/.cache/torch_extensions/py38_cu117 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /home/qwt/.cache/torch_extensions/py38_cu117/adam_upd_cuda/build.ninja...
Building extension module adam_upd_cuda...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
Traceback (most recent call last):
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
subprocess.run(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/subprocess.py", line 512, 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 "/home/qwt/code/4K-NeRF-main/run.py", line 11, in
from lib import img_encoder, utils, dvgo, dcvgo, dmpigo, sr_esrnet, sr_unetdisc, dvqgo
File "/home/qwt/code/4K-NeRF-main/lib/utils.py", line 12, in
from .masked_adam import MaskedAdam
File "/home/qwt/code/4K-NeRF-main/lib/masked_adam.py", line 7, in
adam_upd_cuda = load(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1284, in load
return _jit_compile(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1624, in _write_ninja_file_and_build_library
_run_ninja_build(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1909, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'adam_upd_cuda'
[1/2] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=adam_upd_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/TH -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/ls/anaconda3/envs/py38/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++17 -c /home/qwt/code/4K-NeRF-main/lib/cuda/adam_upd_kernel.cu -o adam_upd_kernel.cuda.o
FAILED: adam_upd_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=adam_upd_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/TH -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/ls/anaconda3/envs/py38/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++17 -c /home/qwt/code/4K-NeRF-main/lib/cuda/adam_upd_kernel.cu -o adam_upd_kernel.cuda.o
nvcc fatal : Unsupported gpu architecture 'compute_86'
ninja: build stopped: subcommand failed.**
Thanks for your well-organized code. When I run your code, an error is as follow:
**Using /home/qwt/.cache/torch_extensions/py38_cu117 as PyTorch extensions root... Detected CUDA files, patching ldflags Emitting ninja build file /home/qwt/.cache/torch_extensions/py38_cu117/adam_upd_cuda/build.ninja... Building extension module adam_upd_cuda... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) Traceback (most recent call last): File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build subprocess.run( File "/home/ls/anaconda3/envs/py38/lib/python3.8/subprocess.py", line 512, 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 "/home/qwt/code/4K-NeRF-main/run.py", line 11, in
from lib import img_encoder, utils, dvgo, dcvgo, dmpigo, sr_esrnet, sr_unetdisc, dvqgo
File "/home/qwt/code/4K-NeRF-main/lib/utils.py", line 12, in
from .masked_adam import MaskedAdam
File "/home/qwt/code/4K-NeRF-main/lib/masked_adam.py", line 7, in
adam_upd_cuda = load(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1284, in load
return _jit_compile(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1624, in _write_ninja_file_and_build_library
_run_ninja_build(
File "/home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1909, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'adam_upd_cuda'
[1/2] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=adam_upd_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/TH -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/ls/anaconda3/envs/py38/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++17 -c /home/qwt/code/4K-NeRF-main/lib/cuda/adam_upd_kernel.cu -o adam_upd_kernel.cuda.o
FAILED: adam_upd_kernel.cuda.o
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=adam_upd_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/TH -isystem /home/ls/anaconda3/envs/py38/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/ls/anaconda3/envs/py38/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++17 -c /home/qwt/code/4K-NeRF-main/lib/cuda/adam_upd_kernel.cu -o adam_upd_kernel.cuda.o
nvcc fatal : Unsupported gpu architecture 'compute_86'
ninja: build stopped: subcommand failed.**
Could you give me some suggestions to solve it?