jittor运行错误

环境:Ubuntu 20.04
GPU信息:单卡RTX3090
驱动信息:NVIDIA-SMI 550.54.15
Driver Version: 550.54.15
CUDA Version: 12.4

错误产生的过程:

1.使用conda创建环境:conda create -n jittor python=3.7

2.激活环境后,安装jittor:python3.7 -m pip install jittor

3.运行示例代码,产生错误:$ python3.7 -m jittor.test.test_example

报错:
[i 0418 21:40:42.469118 20 compiler.py:956] Jittor(1.3.8.5) src: /home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor
[i 0418 21:40:42.470274 20 compiler.py:957] g++ at /usr/bin/g++(9.4.0)
[i 0418 21:40:42.470302 20 compiler.py:958] cache_path: /home/pcf/.cache/jittor/jt1.3.8/g++9.4.0/py3.7.16/Linux-5.15.0-1x7d/12thGenIntelRCxd8/default
[i 0418 21:40:42.471672 20 __init__.py:411] Found nvcc(10.1.243) at /usr/bin/nvcc.
[i 0418 21:40:42.498274 20 __init__.py:411] Found gdb(20.04.1) at /usr/bin/gdb.
[i 0418 21:40:42.500066 20 __init__.py:411] Found addr2line(2.34) at /usr/bin/addr2line.
[i 0418 21:40:42.542064 20 compiler.py:1011] cuda key:cu10.1.243_sm_86
[i 0418 21:40:42.684594 20 __init__.py:227] Total mem: 62.61GB, using 16 procs for compiling.
/usr/include/c++/9/bits/stl_function.h(437): error: identifier “__builtin_is_constant_evaluated” is undefined

1 error detected in the compilation of “/tmp/tmpxft_0002fa90_00000000-6_nan_checker.cpp1.ii”.
multiprocessing.pool.RemoteTraceback:
“”"
Traceback (most recent call last):
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/multiprocessing/pool.py”, line 121, in worker
result = (True, func(*args, **kwds))
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor_utils/init.py”, line 197, in do_compile
return cc.cache_compile(cmd, cache_path, jittor_path)
RuntimeError: [f 0418 21:40:42.976962 20 log.cc:608] Check failed ret(256) == 0(0) Run cmd failed: “/usr/bin/nvcc” “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/src/misc/nan_checker.cu” -std=c++14 -Xcompiler -fPIC -Xcompiler -march=native -Xcompiler -fdiagnostics-color=always -I"/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/src" -I/home/pcf/miniconda3/envs/jittor/include/python3.7m -I/home/pcf/miniconda3/envs/jittor/include/python3.7m -DHAS_CUDA -DIS_CUDA -I"/usr/include" -I"/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/extern/cuda/inc" -I"/home/pcf/.cache/jittor/jt1.3.8/g++9.4.0/py3.7.16/Linux-5.15.0-1x7d/12thGenIntelRCxd8/default/cu10.1.243_sm_86" -O2 -c -o “/home/pcf/.cache/jittor/jt1.3.8/g++9.4.0/py3.7.16/Linux-5.15.0-1x7d/12thGenIntelRCxd8/default/cu10.1.243_sm_86/obj_files/nan_checker.cu.o” -x cu --cudart=shared -ccbin=“/usr/bin/g++” -w -I"/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/extern/cuda/inc"
“”"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/runpy.py”, line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/runpy.py”, line 109, in get_module_details
import(pkg_name)
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/init.py”, line 18, in
from . import compiler
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/compiler.py”, line 1354, in
compile(cc_path, cc_flags+opt_flags, files, ‘jittor_core’+extension_suffix)
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/compiler.py”, line 151, in compile
jit_utils.run_cmds(cmds, cache_path, jittor_path, "Compiling "+base_output)
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor_utils/init.py”, line 251, in run_cmds
for i,
in enumerate(p.imap_unordered(do_compile, cmds)):
File “/home/pcf/miniconda3/envs/jittor/lib/python3.7/multiprocessing/pool.py”, line 748, in next
raise value
RuntimeError: [f 0418 21:40:42.976962 20 log.cc:608] Check failed ret(256) == 0(0) Run cmd failed: “/usr/bin/nvcc” “/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/src/misc/nan_checker.cu” -std=c++14 -Xcompiler -fPIC -Xcompiler -march=native -Xcompiler -fdiagnostics-color=always -I"/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/src" -I/home/pcf/miniconda3/envs/jittor/include/python3.7m -I/home/pcf/miniconda3/envs/jittor/include/python3.7m -DHAS_CUDA -DIS_CUDA -I"/usr/include" -I"/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/extern/cuda/inc" -I"/home/pcf/.cache/jittor/jt1.3.8/g++9.4.0/py3.7.16/Linux-5.15.0-1x7d/12thGenIntelRCxd8/default/cu10.1.243_sm_86" -O2 -c -o “/home/pcf/.cache/jittor/jt1.3.8/g++9.4.0/py3.7.16/Linux-5.15.0-1x7d/12thGenIntelRCxd8/default/cu10.1.243_sm_86/obj_files/nan_checker.cu.o” -x cu --cudart=shared -ccbin=“/usr/bin/g++” -w -I"/home/pcf/miniconda3/envs/jittor/lib/python3.7/site-packages/jittor/extern/cuda/inc"

注意到第三行信息:[i 0418 21:40:42.470274 20 compiler.py:957] g++ at /usr/bin/g++(9.4.0)

怀疑是g++问题,gcc、g++切换到8.4.0版本就解决问题了