HJ-harry/DiffusionMBIR

Can't fix the problem

Oubit1 opened this issue · 11 comments

subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

me too

I had the same problem. To solve it, I did the following steps:

  1. Run this command under DiffusionMBIR folder:

conda env create -f environment.yml

  1. In my case, since torch version in this environment does not see my GPUs, I run the following command:

conda install -c conda-forge pytorch-gpu

  1. After that, if your gcc version is higher than 10, you will probably get the error that @Oubit1 mentioned. To fix that, you need to install gcc-9 and g++-9.

  2. After installing them, you need to set the following environment variables:

export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9

After these steps, it should work. Last thing, if you don't want to set the env variables every time you activate the conda environment, you can check here:
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#setting-environment-variables

I had the same problem. To solve it, I did the following steps:

  1. Run this command under DiffusionMBIR folder:

conda env create -f environment.yml

  1. In my case, since torch version in this environment does not see my GPUs, I run the following command:

conda install -c conda-forge pytorch-gpu

  1. After that, if your gcc version is higher than 10, you will probably get the error that @Oubit1 mentioned. To fix that, you need to install gcc-9 and g++-9.
  2. After installing them, you need to set the following environment variables:

export CC=/usr/bin/gcc-9 export CXX=/usr/bin/g++-9

After these steps, it should work. Last thing, if you don't want to set the env variables every time you activate the conda environment, you can check here: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#setting-environment-variables

It works!Thank you very much!

subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

For this question, you need to change '['ninja', '-v']' to '['ninja', '--version']'

subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

Modify in this file : lib/python3.6/site-packages/torch/utils/cpp_extension.py
The related link is this:https://blog.csdn.net/weixin_43731803/article/details/116787152

I want to add one more think to this error "subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1."

One can also try to go to the ~/.cache/torch_extensions/something directory and that "something" should be the cuda directory that your python program uses. In that folder, you can delete the "lock" file and make sure your CUDA_HOME and LD_LIBRARY_PATH are set correctly. You can check that by simply running these in your env:

echo $CUDA_HOME
echo $LD_LIBRARY_PATH

In my case, they are pointing to "/usr/local/cuda" and "/usr/local/cuda/lib64" respectively.

I had the same problem. To solve it, I did the following steps:

  1. Run this command under DiffusionMBIR folder:

conda env create -f environment.yml

  1. In my case, since torch version in this environment does not see my GPUs, I run the following command:

conda install -c conda-forge pytorch-gpu

  1. After that, if your gcc version is higher than 10, you will probably get the error that @Oubit1 mentioned. To fix that, you need to install gcc-9 and g++-9.
  2. After installing them, you need to set the following environment variables:

export CC=/usr/bin/gcc-9 export CXX=/usr/bin/g++-9
After these steps, it should work. Last thing, if you don't want to set the env variables every time you activate the conda environment, you can check here: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#setting-environment-variables

It works!Thank you very much!

You are welcome!

wyk04 commented

I had the same problem. To solve it, I did the following steps:

  1. Run this command under DiffusionMBIR folder:

conda env create -f environment.yml

  1. In my case, since torch version in this environment does not see my GPUs, I run the following command:

conda install -c conda-forge pytorch-gpu

  1. After that, if your gcc version is higher than 10, you will probably get the error that @Oubit1 mentioned. To fix that, you need to install gcc-9 and g++-9.
  2. After installing them, you need to set the following environment variables:

export CC=/usr/bin/gcc-9 export CXX=/usr/bin/g++-9

After these steps, it should work. Last thing, if you don't want to set the env variables every time you activate the conda environment, you can check here: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#setting-environment-variables

@Sunses-hub Sorry to trouble you,but I can't get it.My computer's system is a Windows system,how can I solve the problem?

My computer's system is a Windows system,how can I solve the problem?

@Sunses-hub , I need your help ,And another problem: ImportError: No module named 'fused'

@ormosia6,How to solve this problem? ImportError: No module named 'fused' Thank you in advance!