NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.43k stars 158 forks source link

Command '['ninja', '-v']' returned non-zero exit status 1 'malloc' is defined in header '<cstdlib>' #185

Closed pkpk777s closed 5 months ago

pkpk777s commented 5 months ago

It keeps having this issue. There is no docker on the server so I installed using the pip install.

`File "/data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2107, in _run_ninja_build subprocess.run( File "/data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

/data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/include/c10/util/env.h: In function 'std::optional c10::utils::check_env(const char)': /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/include/c10/util/env.h:21:21: error: 'getenv' is not a member of 'std' 21 | auto envar = std::getenv(name); | ^~ In file included from /data/eddie/miniconda3/envs/dreamgaussian/lib/gcc/x86_64-conda-linux-gnu/10.4.0/include/xmmintrin.h:34, from /data/eddie/miniconda3/envs/dreamgaussian/lib/gcc/x86_64-conda-linux-gnu/10.4.0/include/immintrin.h:29, from /data/eddie/miniconda3/envs/dreamgaussian/lib/gcc/x86_64-conda-linux-gnu/10.4.0/include/x86intrin.h:32, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/include/c10/util/ApproximateClock.h:28, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/include/c10/cuda/CUDACachingAllocator.h:7, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/include/c10/cuda/impl/CUDAGuardImpl.h:8, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/torch/include/c10/cuda/CUDAGuard.h:7, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/nvdiffrast/torch/../common/framework.h:39, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/nvdiffrast/torch/torch_common.inl:10, from /data/eddie/miniconda3/envs/dreamgaussian/lib/python3.10/site-packages/nvdiffrast/torch/torch_bindings_gl.cpp:9: /data/eddie/miniconda3/envs/dreamgaussian/lib/gcc/x86_64-conda-linux-gnu/10.4.0/include/mm_malloc.h: In function 'void _mm_malloc(size_t, size_t)': /data/eddie/miniconda3/envs/dreamgaussian/lib/gcc/x86_64-conda-linux-gnu/10.4.0/include/mm_malloc.h:42:12: error: 'malloc' was not declared in this scope 42 | return malloc (__size); | ^~ /data/eddie/miniconda3/envs/dreamgaussian/lib/gcc/x86_64-conda-linux-gnu/10.4.0/include/mm_malloc.h:1:1: note: 'malloc' is defined in header ''; did you forget to '#include '? +++ |+#include 1 | /* Copyright (C) 2004-2020 Free Software Foundation, Inc. ninja: build stopped: subcommand failed.`

Have tried lots of different versions of ninja. Nvdiffrast package was installed well and can find it in pip list | grep Nvdiffrast

Trying to run the dreamgaussian demo

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:33:58_PDT_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

Torch=2.3+cu118

+-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.67 Driver Version: 550.67 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+============

s-laine commented 5 months ago

I don’t think you need to install ninja separately, because pytorch comes with it for the purpose of compiling the extensions. Perhaps having a separate ninja installation causes a version conflict of some sort?

pkpk777s commented 5 months ago

I don’t think you need to install ninja separately, because pytorch comes with it for the purpose of compiling the extensions. Perhaps having a separate ninja installation causes a version conflict of some sort?

Checked ther is no ninja installed in the system and it will give error if uninstalled the ninja in the conda env