Windows 用户名存在空格导致在conda环境中安装Jittor时遇到错误

我由于系统用户名存在空格,导致有一些包安装失败。但是我已经在相应的conda环境里设置了环境变量,请问究竟应该如何修改cache_path来更改jittor的缓存路径?

电脑系统为 Windows10专业版,版本号21H2,内部版本19044.1889;cuda驱动版本号11.7.0;

我已经在conda环境里设置了cache_path的环境变量:

(D:\Python_virtual_environment\JittorFrame) C:\Users\Xiangrui the Admin>conda env config vars list -n JittorFrame
cache_path = D:\Python_virtual_environment\JittorFrame\.cache\jittor

在执行下面三条命令时均有不同程度的报错:
python -m jittor.test.test_core
python -m jittor.test.test_example
上面两条命令虽然有出错,但是最后都显示”ok“。

python -m jittor.test.test_cudnn_op
最后这条测试cuda的命令结果是 FAILED (failures=2)

具体命令及报错如下:
一、
出错的语句:

[i 0927 21:38:43.691000 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\mkl
[i 0927 21:38:43.692000 20 compile_extern.py:65] Downloading mkl...
Downloading https://cg.cs.tsinghua.edu.cn/jittor/assets/dnnl_win_2.2.0_cpu_vcomp.zip to C:\Users\Xiangrui the Admin\.cache\jittor\mkl\dnnl_win_2.2.0_cpu_vcomp.zip
6.70MB [00:00, 10.8MB/s]
'C:\Users\Xiangrui' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
[w 0927 21:38:44.510000 20 compile_extern.py:589] MKL install failed, msg:

全部输出:

(D:\Python_virtual_environment\JittorFrame) C:\Users\Xiangrui the Admin>python -m jittor.test.test_core
[i 0927 21:34:11.459093 20 lock.py:85] Create lock file:C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\jittor.lock
[i 0927 21:34:11.468063 20 install_msvc.py:8] Installing MSVC...
Downloading https://cg.cs.tsinghua.edu.cn/jittor/assets/msvc.zip to C:\Users\Xiangrui the Admin\.cache\jittor\msvc\msvc.zip
53.3MB [00:03, 18.3MB/s]
[i 0927 21:34:15.584117 20 compiler.py:955] Jittor(1.3.5.16) src: d:\python_virtual_environment\jittorframe\lib\site-packages\jittor
[i 0927 21:34:15.682208 20 compiler.py:956] cl at C:\Users\Xiangrui the Admin\.cache\jittor\msvc\VC\_\_\_\_\_\bin\cl.exe(19.29.30133)
[i 0927 21:34:15.683206 20 compiler.py:957] cache_path: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default
[i 0927 21:34:15.689185 20 install_cuda.py:88] cuda_driver_version: [11, 7, 0]
Downloading https://cg.cs.tsinghua.edu.cn/jittor/assets/cuda11.2_cudnn8_win.zip to C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win.zip
1.85GB [02:31, 13.1MB/s]
[i 0927 21:37:07.300711 20 __init__.py:411] Found C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe(11.2.67) at C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe.
[i 0927 21:37:07.399385 20 __init__.py:411] Found gdb(8.1) at C:\Program Files\mingw64\bin\gdb.EXE.
[i 0927 21:37:07.456196 20 __init__.py:411] Found addr2line(2.30) at C:\Program Files\mingw64\bin\addr2line.EXE.
[i 0927 21:37:07.483128 20 compiler.py:1010] cuda key:cu11.2.67
[i 0927 21:37:07.484098 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67
[i 0927 21:37:07.485094 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\jit
[i 0927 21:37:07.485663 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\obj_files
[i 0927 21:37:07.486714 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\gen
[i 0927 21:37:07.486714 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\tmp
[i 0927 21:37:07.487708 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\checkpoints
[i 0927 21:37:07.488705 20 __init__.py:227] Total mem: 15.65GB, using 5 procs for compiling.
Compiling jit_utils_core(5/5) used: 2.379s eta: 0.000s
Compiling jittor_core(148/148) used: 33.291s eta: 0.000ss
[i 0927 21:37:55.938000 20 jit_compiler.cc:28] Load cc_path: C:\Users\Xiangrui the Admin\.cache\jittor\msvc\VC\_\_\_\_\_\bin\cl.exe
[i 0927 21:37:55.938000 20 jit_compiler.cc:34] Load cache_path: D:\Python_virtual_environment\JittorFrame\.cache\jittor
[i 0927 21:37:55.943000 20 init.cc:62] Found cuda archs: [86,]
[i 0927 21:37:56.136000 20 compile_extern.py:517] mpicc not found, distribution disabled.
[i 0927 21:37:56.136000 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\cutt
[i 0927 21:37:56.137000 20 compile_extern.py:334] Downloading cutt...
Downloading https://codeload.github.com/Jittor/cutt/zip/v1.2 to C:\Users\Xiangrui the Admin\.cache\jittor\cutt\cutt-1.2.zip
296kB [00:01, 175kB/s]
[i 0927 21:37:57.893000 20 compile_extern.py:347] installing cutt...
Compiling libcutt(9/9) used: 43.866s eta: 0.000s
[i 0927 21:38:42.221000 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\custom_ops
[i 0927 21:38:43.691000 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\mkl
[i 0927 21:38:43.692000 20 compile_extern.py:65] Downloading mkl...
Downloading https://cg.cs.tsinghua.edu.cn/jittor/assets/dnnl_win_2.2.0_cpu_vcomp.zip to C:\Users\Xiangrui the Admin\.cache\jittor\mkl\dnnl_win_2.2.0_cpu_vcomp.zip
6.70MB [00:00, 10.8MB/s]
'C:\Users\Xiangrui' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
[w 0927 21:38:44.510000 20 compile_extern.py:589] MKL install failed, msg:
[i 0927 21:38:44.510000 20 compiler.py:34] Create cache dir: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default\cu11.2.67\cuda
Compiling gen_ops_cudnn_conv3d_backward_w_cudnn_conv3d_backw___hash78c3ee(16/16) used: 3.091s eta: 0.000s
.
Compiling Operators(5/5) used: 2.67s eta:    0s
.Var(52:1:2:2:i1:o1:s0:n0,float32,aa,0)[10,]
Var(54:1:1:1:i1:o1:s0:n0,float32,,0)[10,]
Var(56:1:1:1:i1:o1:s0:n0,float32,,0)[10,]
Var(58:2:1:1:i1:o0:s0:n0,float32,bb,0)[10,]
........Var(1033:0:1:0:i0:o1:s1:n1,bool,,19303177460)[10,]
.Var(1077:0:1:0:i0:o1:s1:n1,bool,,19303177a60)[10,]
.
Compiling Operators(7/7) used: 3.91s eta:    0s
33 10
...
Compiling Operators(5/5) used: 2.71s eta:    0s
.
----------------------------------------------------------------------
Ran 16 tests in 21.694s

OK

二、(由于第二条命令的输出过长,我先摘出了出错时的语句)

出错的语句:

[i 0927 22:51:15.233000 88 compile_extern.py:517] mpicc not found, distribution disabled.

全部输出:

(D:\Python_virtual_environment\JittorFrame) C:\Users\Xiangrui the Admin>python -m jittor.test.test_example
[i 0927 22:51:14.037000 88 compiler.py:955] Jittor(1.3.5.16) src: d:\python_virtual_environment\jittorframe\lib\site-packages\jittor
[i 0927 22:51:14.057000 88 compiler.py:956] cl at C:\Users\Xiangrui the Admin\.cache\jittor\msvc\VC\_\_\_\_\_\bin\cl.exe(19.29.30133)
[i 0927 22:51:14.057000 88 compiler.py:957] cache_path: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default
[i 0927 22:51:14.060000 88 install_cuda.py:88] cuda_driver_version: [11, 7, 0]
[i 0927 22:51:14.076000 88 __init__.py:411] Found C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe(11.2.67) at C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe.
[i 0927 22:51:14.185000 88 __init__.py:411] Found gdb(8.1) at C:\Program Files\mingw64\bin\gdb.EXE.
[i 0927 22:51:14.220000 88 __init__.py:411] Found addr2line(2.30) at C:\Program Files\mingw64\bin\addr2line.EXE.
[i 0927 22:51:14.246000 88 compiler.py:1010] cuda key:cu11.2.67
[i 0927 22:51:14.247000 88 __init__.py:227] Total mem: 15.65GB, using 5 procs for compiling.
[i 0927 22:51:15.083000 88 jit_compiler.cc:28] Load cc_path: C:\Users\Xiangrui the Admin\.cache\jittor\msvc\VC\_\_\_\_\_\bin\cl.exe
[i 0927 22:51:15.083000 88 jit_compiler.cc:34] Load cache_path: D:\Python_virtual_environment\JittorFrame\.cache\jittor
[i 0927 22:51:15.088000 88 init.cc:62] Found cuda archs: [86,]
[i 0927 22:51:15.233000 88 compile_extern.py:517] mpicc not found, distribution disabled.

Compiling Operators(4/4) used: 2.72s eta:    0s
step 0, loss = 0.17297527194023132 {'hold_vars': 13, 'lived_vars': 62, 'lived_ops': 56}

Compiling Operators(10/10) used: 6.37s eta:    0s
step 1, loss = 0.10625168681144714 {'hold_vars': 13, 'lived_vars': 62, 'lived_ops': 56}
***中间省略,均正常***
step 999, loss = 0.00110957445576787 {'hold_vars': 13, 'lived_vars': 62, 'lived_ops': 56}
.
----------------------------------------------------------------------
Ran 1 test in 12.149s

OK

三、下面的是测试cuda时的报错,很多地方都有错误发生

(D:\Python_virtual_environment\JittorFrame) C:\Users\Xiangrui the Admin>python -m jittor.test.test_cudnn_op
[i 0927 22:53:26.658000 60 compiler.py:955] Jittor(1.3.5.16) src: d:\python_virtual_environment\jittorframe\lib\site-packages\jittor
[i 0927 22:53:26.676000 60 compiler.py:956] cl at C:\Users\Xiangrui the Admin\.cache\jittor\msvc\VC\_\_\_\_\_\bin\cl.exe(19.29.30133)
[i 0927 22:53:26.676000 60 compiler.py:957] cache_path: C:\Users\Xiangrui the Admin\.cache\jittor\jt1.3.5\cl\py3.9.13\Windows-10-10.x15\11thGenIntelRCxaa\default
[i 0927 22:53:26.679000 60 install_cuda.py:88] cuda_driver_version: [11, 7, 0]
[i 0927 22:53:26.695000 60 __init__.py:411] Found C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe(11.2.67) at C:\Users\Xiangrui the Admin\.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe.
[i 0927 22:53:26.806000 60 __init__.py:411] Found gdb(8.1) at C:\Program Files\mingw64\bin\gdb.EXE.
[i 0927 22:53:26.839000 60 __init__.py:411] Found addr2line(2.30) at C:\Program Files\mingw64\bin\addr2line.EXE.
[i 0927 22:53:26.864000 60 compiler.py:1010] cuda key:cu11.2.67
[i 0927 22:53:26.866000 60 __init__.py:227] Total mem: 15.65GB, using 5 procs for compiling.
[i 0927 22:53:27.612000 60 jit_compiler.cc:28] Load cc_path: C:\Users\Xiangrui the Admin\.cache\jittor\msvc\VC\_\_\_\_\_\bin\cl.exe
[i 0927 22:53:27.612000 60 jit_compiler.cc:34] Load cache_path: D:\Python_virtual_environment\JittorFrame\.cache\jittor
[i 0927 22:53:27.613000 60 init.cc:62] Found cuda archs: [86,]
[i 0927 22:53:27.753000 60 compile_extern.py:517] mpicc not found, distribution disabled.
[i 0927 22:53:29.065000 60 cuda_flags.cc:32] CUDA enabled.
[i 0927 22:53:29.073000 60 v10 op.cc:271] Jit op key not found: curand_random?T:float32?R:uniform?JIT:1?JIT_cuda:1?index_t:int32
[i 0927 22:53:31.805000 60 v10 op.cc:278] Get jit op entry: 00007FF958801150
[i 0927 22:53:31.810000 60 v100 op.cc:267] Jit op key found: curand_random?T:float32?R:uniform?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF958801150
[i 0927 22:53:34.818000 60 v10 op.cc:271] Jit op key not found: cudnn_conv?Tx:float32?Ty:float32?Tw:float32?XFORMAT:acdb?WFORMAT:oihw?YFORMAT:acdb?JIT:1?JIT_cuda:1?index_t:int32
[i 0927 22:53:37.368000 60 v10 op.cc:278] Get jit op entry: 00007FF9400C11A0
[i 0927 22:53:40.037000 60 cuda_flags.cc:32] CUDA enabled.
[i 0927 22:53:40.038000 60 v100 op.cc:267] Jit op key found: curand_random?T:float32?R:uniform?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF958801150
[i 0927 22:53:40.038000 60 v100 op.cc:267] Jit op key found: curand_random?T:float32?R:uniform?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF958801150
[i 0927 22:53:43.057000 60 v100 op.cc:267] Jit op key found: cudnn_conv?Tx:float32?Ty:float32?Tw:float32?XFORMAT:acdb?WFORMAT:oihw?YFORMAT:acdb?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF9400C11A0
[i 0927 22:53:43.572000 60 cuda_flags.cc:32] CUDA enabled.
[i 0927 22:53:43.572000 60 v100 op.cc:267] Jit op key found: curand_random?T:float32?R:uniform?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF958801150
[i 0927 22:53:43.572000 60 v100 op.cc:267] Jit op key found: curand_random?T:float32?R:uniform?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF958801150
[i 0927 22:53:46.554000 60 v100 op.cc:267] Jit op key found: cudnn_conv?Tx:float32?Ty:float32?Tw:float32?XFORMAT:acdb?WFORMAT:oihw?YFORMAT:acdb?JIT:1?JIT_cuda:1?index_t:int32 jit op entry: 00007FF9400C11A0
...[i 0927 22:53:47.052000 60 cuda_flags.cc:32] CUDA enabled.

Compiling Operators(4/4) used: 10.6s eta:    0s
F[i 0927 22:54:00.859000 60 cuda_flags.cc:32] CUDA enabled.
[i 0927 22:54:00.911000 60 cuda_flags.cc:32] CUDA enabled.
F
======================================================================
FAIL: test_conv3d (__main__.TestCudnnConvOp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\jittor\test\test_cudnn_op.py", line 150, in test_conv3d
    check((2,4,10,10,10), (5,4,3,3,3), (1,1,1), (1,1,1))
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\jittor\test\test_cudnn_op.py", line 148, in check
    np.testing.assert_allclose(dw.data, dw2.data, rtol=1e-5, atol=1e-3)
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\numpy\testing\_private\utils.py", line 1527, in assert_allclose
    assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\numpy\testing\_private\utils.py", line 844, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0.001

Mismatched elements: 514 / 540 (95.2%)
Max absolute difference: 0.15075684
Max relative difference: 0.00036063
 x: array([[[[[365.25, 397.25, 361.  ],
          [403.  , 447.  , 399.5 ],
          [367.25, 402.75, 364.5 ]],...
 y: array([[[[[365.224  , 397.36096, 361.10617],
          [403.0324 , 446.9476 , 399.5999 ],
          [367.19403, 402.74484, 364.54562]],...

======================================================================
FAIL: test_conv_transpose3d (__main__.TestCudnnConvOp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\jittor\test\test_cudnn_op.py", line 184, in test_conv_transpose3d
    check((2,5,10,10,10), (5,4,3,3,3), (1,1,1), (1,1,1))
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\jittor\test\test_cudnn_op.py", line 182, in check
    np.testing.assert_allclose(dw.numpy(), dw2.numpy(), rtol=1e-5, atol=1e-3)
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\numpy\testing\_private\utils.py", line 1527, in assert_allclose
    assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
  File "D:\Python_virtual_environment\JittorFrame\Lib\site-packages\numpy\testing\_private\utils.py", line 844, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0.001

Mismatched elements: 525 / 540 (97.2%)
Max absolute difference: 0.1300354
Max relative difference: 0.0003474
 x: array([[[[[376.25, 416.  , 370.  ],
          [420.75, 463.5 , 408.75],
          [377.75, 417.75, 366.75]],...
 y: array([[[[[376.17206, 415.91016, 369.96164],
          [420.66846, 463.48962, 408.76892],
          [377.75873, 417.65686, 366.78934]],...

----------------------------------------------------------------------
Ran 5 tests in 33.038s

FAILED (failures=2)

你好,您遇到的三个错误都不影响正常使用。情况分别如下:

  1. 由于路径存在空格导致 MKL 安装失败,只会减慢某些 CPU 算子的速度,您已经有GPU加速则不影响性能。我们后续将针对路径中有空格的情况加以改进。
  2. mpicc 是用于多卡计算的,不安装不影响单卡性能。
  3. Windows 下某些显卡型号的精度与 Linux 不一致,导致测例计算结果与标准值有差别,但差别不大,不影响正常使用。

非常感谢您的回复,我明白了。