microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.62k stars 2.92k forks source link

[Build] fatal error: too many errors emitted, stopping now [-ferror-limit=] #16576

Open slipperyslipped opened 1 year ago

slipperyslipped commented 1 year ago

Describe the issue

Trying to build wheel for AMD 6700XT on Linux for three days and have faced numerous issues. I have finally got to a point where the build process starts but I am getting a lot of errors.

I get the following message at around 32% ```fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated when compiling for gfx1030.

It continues til 35% and then stops after giving the following info
```[ 35%] Built target onnxruntime_mlas
gmake: *** [Makefile:166: all] Error 2
Traceback (most recent call last):
  File "/home/hobi/onnxruntime/tools/ci_build/build.py", line 2599, in <module>
    sys.exit(main())
  File "/home/hobi/onnxruntime/tools/ci_build/build.py", line 2495, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/home/hobi/onnxruntime/tools/ci_build/build.py", line 1434, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/home/hobi/onnxruntime/tools/ci_build/build.py", line 781, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "/home/hobi/onnxruntime/tools/python/util/run.py", line 49, in run
    completed_process = subprocess.run(
  File "/home/hobi/miniconda3/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/hobi/miniconda3/bin/cmake', '--build', 'build/Linux/Release', '--config', 'Release', '--', '-j12']' returned non-zero exit status 2.

I am very new to all of this so please let me know what other information I can include to help make troubleshooting easier.

Distro: Linux Mint 21.1 ROCm version 5.4.0 Onnxruntime 1.15 Python 3.10

Using the following build command:


    python3.10 tools/ci_build/build.py \
      --allow_running_as_root \
      --build_dir=build/Linux \
      --config=Release \
      --enable_pybind \
      --build_wheel \
      --parallel \
      --use_rocm \
      --rocm_home=/opt/rocm```

### Urgency

_No response_

### Target platform

Linux/AMD

### Build script

   python3.10 -m pip install -r requirements-dev.txt &&\
    python3.10 tools/ci_build/build.py \
      --allow_running_as_root \
      --build_dir=build/Linux \
      --config=Release \
      --enable_pybind \
      --build_wheel \
      --parallel \
      --use_rocm \
      --rocm_home=/opt/rocm

### Error / output

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated when compiling for gfx1030.

### Visual Studio Version

_No response_

### GCC / Compiler Version

_No response_
kailums commented 1 year ago

HI, @slipperyslipped

Since there no enough log shows what error it is. I think it may be because of the compiler arch, 6700 XT is using arch of gfx1031, based on this link.

And also you can refer to this issue #16566 on how to change the build arch in build commands.

slipperyslipped commented 1 year ago

hi @kailums, I actually managed to build the wheel file using the dockerfile but now I am getting the following error when trying to actually run the software.:

class PickableInferenceSession(onnxruntime.InferenceSession): AttributeError: module 'onnxruntime' has no attribute 'InferenceSession'

kailums commented 1 year ago

hi @kailums, I actually managed to build the wheel file using the dockerfile but now I am getting the following error when trying to actually run the software.:

class PickableInferenceSession(onnxruntime.InferenceSession): AttributeError: module 'onnxruntime' has no attribute 'InferenceSession'

It should have that API, see https://onnxruntime.ai/docs/api/python/api_summary.html.

May be there are some other error when loading onnxruntime module. you can check if there any other error message.