Ubuntu 22.04 上安装失败

环境: Ubuntu 22.04, 老旧显卡

wow@wow:~/git/pytorch$ python3 -m jittor.test.test_example
[i 0826 22:36:33.225158 68 compiler.py:955] Jittor(1.3.5.12) src: /home/wow/.local/lib/python3.10/site-packages/jittor
[i 0826 22:36:33.228079 68 compiler.py:956] g++ at /usr/bin/g++(11.2.0)
[i 0826 22:36:33.228156 68 compiler.py:957] cache_path: /home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default
[i 0826 22:36:33.237216 68 install_cuda.py:88] cuda_driver_version: [11, 4]
[i 0826 22:36:33.237466 68 install_cuda.py:76] restart /usr/bin/python3 ['-m', 'jittor.test.test_example']
[i 0826 22:36:33.374757 72 compiler.py:955] Jittor(1.3.5.12) src: /home/wow/.local/lib/python3.10/site-packages/jittor
[i 0826 22:36:33.377991 72 compiler.py:956] g++ at /usr/bin/g++(11.2.0)
[i 0826 22:36:33.378067 72 compiler.py:957] cache_path: /home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default
[i 0826 22:36:33.387234 72 install_cuda.py:88] cuda_driver_version: [11, 4]
[i 0826 22:36:33.387471 72 install_cuda.py:76] restart /usr/bin/python3 ['-m', 'jittor.test.test_example']
[i 0826 22:36:33.502923 28 compiler.py:955] Jittor(1.3.5.12) src: /home/wow/.local/lib/python3.10/site-packages/jittor
[i 0826 22:36:33.506233 28 compiler.py:956] g++ at /usr/bin/g++(11.2.0)
[i 0826 22:36:33.506306 28 compiler.py:957] cache_path: /home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default
[i 0826 22:36:33.515248 28 install_cuda.py:88] cuda_driver_version: [11, 4]
[i 0826 22:36:33.518581 28 __init__.py:411] Found /home/wow/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/bin/nvcc(11.2.152) at /home/wow/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/bin/nvcc.
[i 0826 22:36:33.628282 28 __init__.py:411] Found gdb(12.0.90) at /usr/bin/gdb.
[i 0826 22:36:33.631756 28 __init__.py:411] Found addr2line(2.38) at /usr/bin/addr2line.
[i 0826 22:36:33.792569 28 compiler.py:1010] cuda key:cu11.2.152_sm_35
[i 0826 22:36:34.118985 28 __init__.py:227] Total mem: 7.75GB, using 2 procs for compiling.
/usr/include/stdio.h(189): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(201): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(223): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(260): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(285): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(294): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(303): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(309): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(315): error: attribute "__malloc__" does not take arguments

/usr/include/stdio.h(830): error: attribute "__malloc__" does not take arguments

/usr/include/stdlib.h(566): error: attribute "__malloc__" does not take arguments

/usr/include/stdlib.h(570): error: attribute "__malloc__" does not take arguments

/usr/include/stdlib.h(799): error: attribute "__malloc__" does not take arguments

/usr/include/c++/11/type_traits(1406): error: type name is not allowed

/usr/include/c++/11/type_traits(1406): error: type name is not allowed

/usr/include/c++/11/type_traits(1406): error: identifier "__is_same" is undefined

/usr/include/wchar.h(155): error: attribute "__malloc__" does not take arguments

/usr/include/wchar.h(582): error: attribute "__malloc__" does not take arguments

/home/wow/.local/lib/python3.10/site-packages/jittor/src/misc/cstr.h(19): error: no instance of overloaded function "std::unique_ptr<_Tp [], _Dp>::reset [with _Tp=char, _Dp=std::default_delete<char []>]" matches the argument list
            argument types are: (char *)
            object type is: jittor::unique_ptr<char []>

/home/wow/.local/lib/python3.10/site-packages/jittor/src/misc/cstr.h(25): error: no instance of overloaded function "std::unique_ptr<_Tp [], _Dp>::reset [with _Tp=char, _Dp=std::default_delete<char []>]" matches the argument list
            argument types are: (char *)
            object type is: jittor::unique_ptr<char []>

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long, std::is_same<int, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long, _Ret=int, _CharT=char, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6620): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long, std::is_same<long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long, _Ret=long, _CharT=char, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6625): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const unsigned long, std::is_same<unsigned long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=unsigned long, _Ret=unsigned long, _CharT=char, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6630): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long long, std::is_same<long long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long long, _Ret=long long, _CharT=char, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6635): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const unsigned long long, std::is_same<unsigned long long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=unsigned long long, _Ret=unsigned long long, _CharT=char, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6640): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const float, std::is_same<float, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=float, _Ret=float, _CharT=char, _Base=<>]" 
/usr/include/c++/11/bits/basic_string.h(6646): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const double, std::is_same<double, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=double, _Ret=double, _CharT=char, _Base=<>]" 
/usr/include/c++/11/bits/basic_string.h(6650): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long double, std::is_same<long double, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long double, _Ret=long double, _CharT=char, _Base=<>]" 
/usr/include/c++/11/bits/basic_string.h(6654): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long, std::is_same<int, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long, _Ret=int, _CharT=wchar_t, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6751): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long, std::is_same<long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long, _Ret=long, _CharT=wchar_t, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6756): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const unsigned long, std::is_same<unsigned long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=unsigned long, _Ret=unsigned long, _CharT=wchar_t, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6761): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long long, std::is_same<long long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long long, _Ret=long long, _CharT=wchar_t, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6766): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const unsigned long long, std::is_same<unsigned long long, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=unsigned long long, _Ret=unsigned long long, _CharT=wchar_t, _Base=<int>]" 
/usr/include/c++/11/bits/basic_string.h(6771): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const float, std::is_same<float, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=float, _Ret=float, _CharT=wchar_t, _Base=<>]" 
/usr/include/c++/11/bits/basic_string.h(6777): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const double, std::is_same<double, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=double, _Ret=double, _CharT=wchar_t, _Base=<>]" 
/usr/include/c++/11/bits/basic_string.h(6781): here

/usr/include/c++/11/ext/string_conversions.h(85): error: no instance of overloaded function "_Range_chk::_S_chk" matches the argument list
            argument types are: (const long double, std::is_same<long double, int>)
          detected during instantiation of "_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT *, _CharT **, _Base...), const char *, const _CharT *, std::size_t *, _Base...) [with _TRet=long double, _Ret=long double, _CharT=wchar_t, _Base=<>]" 
/usr/include/c++/11/bits/basic_string.h(6785): here

36 errors detected in the compilation of "/home/wow/.local/lib/python3.10/site-packages/jittor/src/misc/nan_checker.cu".
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/wow/.local/lib/python3.10/site-packages/jittor_utils/__init__.py", line 197, in do_compile
    return cc.cache_compile(cmd, cache_path, jittor_path)
RuntimeError: [f 0826 22:38:18.184577 28 log.cc:608] Check failed ret(256) == 0(0) Run cmd failed: "/home/wow/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/bin/nvcc"  "/home/wow/.local/lib/python3.10/site-packages/jittor/src/misc/nan_checker.cu"     -std=c++14 -Xcompiler -fPIC  -Xcompiler -march=native  -Xcompiler -fdiagnostics-color=always   -I"/home/wow/.local/lib/python3.10/site-packages/jittor/src" -I/usr/include/python3.10 -I/usr/include/python3.10 -DHAS_CUDA -DIS_CUDA -I"/home/wow/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/include" -I"/home/wow/.local/lib/python3.10/site-packages/jittor/extern/cuda/inc"   -I"/home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default/cu11.2.152_sm_35"   -O2   -c -o "/home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default/cu11.2.152_sm_35/obj_files/nan_checker.cu.o" -x cu --cudart=shared -ccbin="/usr/bin/g++"   -w  -I"/home/wow/.local/lib/python3.10/site-packages/jittor/extern/cuda/inc" 
"""

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

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/home/wow/.local/lib/python3.10/site-packages/jittor/__init__.py", line 18, in <module>
    from . import compiler
  File "/home/wow/.local/lib/python3.10/site-packages/jittor/compiler.py", line 1334, in <module>
    compile(cc_path, cc_flags+opt_flags, files, 'jittor_core'+extension_suffix)
  File "/home/wow/.local/lib/python3.10/site-packages/jittor/compiler.py", line 151, in compile
    jit_utils.run_cmds(cmds, cache_path, jittor_path, "Compiling "+base_output)
  File "/home/wow/.local/lib/python3.10/site-packages/jittor_utils/__init__.py", line 251, in run_cmds
    for i,_ in enumerate(p.imap_unordered(do_compile, cmds)):
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 873, in next
    raise value
RuntimeError: [f 0826 22:38:18.184577 28 log.cc:608] Check failed ret(256) == 0(0) Run cmd failed: "/home/wow/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/bin/nvcc"  "/home/wow/.local/lib/python3.10/site-packages/jittor/src/misc/nan_checker.cu"     -std=c++14 -Xcompiler -fPIC  -Xcompiler -march=native  -Xcompiler -fdiagnostics-color=always   -I"/home/wow/.local/lib/python3.10/site-packages/jittor/src" -I/usr/include/python3.10 -I/usr/include/python3.10 -DHAS_CUDA -DIS_CUDA -I"/home/wow/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/include" -I"/home/wow/.local/lib/python3.10/site-packages/jittor/extern/cuda/inc"   -I"/home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default/cu11.2.152_sm_35"   -O2   -c -o "/home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default/cu11.2.152_sm_35/obj_files/nan_checker.cu.o" -x cu --cudart=shared -ccbin="/usr/bin/g++"   -w  -I"/home/wow/.local/lib/python3.10/site-packages/jittor/extern/cuda/inc" 

您好,ubuntu 22.04提供了最新的 gcc-11,需要安装最新的cuda (11.5 及以上)才能支持。

由于目前jittor提供的cuda安装版本是11.2,所以请您自行安装最新的cuda版本,同时删除

/home/wow/.cache/jittor

按你说的方法,安装成功了,谢谢

出现了另外的问题:

Traceback (most recent call last):
  File "/home/wow/git/dl_code/jittor_learn/hello/hello_jittor.py", line 35, in <module>
    pred_index = np.argmax(pred_y.numpy(), axis=1)
RuntimeError: [f 0827 22:09:25.320705 84 executor.cc:665] 
Execute fused operator(2/6) failed. 
[JIT Source]: /home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default/cu11.7.99_sm_35/jit/__opkey0_broadcast_to__Tx_float32__DIM_3__BCAST_1__opkey1_broadcast_to__Tx_float32__DIM_3____hash_9d5a71d1062958a5_op.cc 
[OP TYPE]: fused_op:( broadcast_to, broadcast_to, binary.multiply, reduce.add,)
[Input]: float32[10,1,], float32[16,1,], 
[Output]: float32[16,10,], 
[Async Backtrace]: not found, please set env JT_SYNC=1, trace_py_var=3 
[Reason]: [f 0827 22:09:25.319372 84 helper_cuda.h:128] CUDA error at /home/wow/.cache/jittor/jt1.3.5/g++11.2.0/py3.10.6/Linux-5.15.0-4x10/IntelRXeonRCPUxf3/default/cu11.7.99_sm_35/jit/cublas_matmul__T_float32__Trans_a_N__Trans_b_T__op_S__JIT_1__JIT_cuda_1__index_t_int32_hash_e5c685b2023aaaa5_op.cc:77  code=8( CUBLAS_STATUS_ARCH_MISMATCH ) cublasGemmEx(handle_, CUBLAS_OP_T, CUBLAS_OP_N, k, n, m, &alpha, b->ptr<T>(),get_dtype(b->dtype()), 'T' == 'N' ? k : m, a->ptr<T>(),get_dtype(a->dtype()), 'N' == 'N' ? m : n, &beta, c->ptr<T>(),get_dtype(c->dtype()), k, computeType, algo)
**********
Async error was detected. To locate the async backtrace and get better error report, please rerun your code with two enviroment variables set:
>>> export JT_SYNC=1
>>> export trace_py_var=3

在这之前应该还有一些错误信息,麻烦您提供更完整的 log