1

我刚刚安装了一个 API Base Toolkit 和 HPC toolkit。正如文档中指出的那样,我已将其放入我的~/.zshrc

source /opt/intel/oneapi/setvars.sh

现在出现2个问题:

首先,当我打开一个新的终端时,我有系统地出现在手放在终端之前的长消息:如何使这个长消息静音?

:: initializing oneAPI environment ...
   zsh: ZSH_VERSION = 5.7.1
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: inspector -- latest
:: intelpython -- latest
/opt/intel/oneapi/intelpython/latest/etc/conda/activate.d/xgboost_activate.sh:16: = not found
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: itac -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vpl -- latest
:: vtune -- latest
:: oneAPI environment initialized ::

其次,如您所见,我在此初始化消息中有一个错误:

/opt/intel/oneapi/intelpython/latest/etc/conda/activate.d/xgboost_activate.sh:16: = not found

我编辑了这个文件:

#!/bin/sh
#
# Copyright 2003-2021 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express license under which they were
# provided to you (License). Unless the License provides otherwise, you may
# not use, modify, copy, publish, distribute, disclose or transmit this
# software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express
# or implied warranties, other than those that are expressly stated in the
# License.
#

if [ "${OCL_ICD_FILENAMES}" == "" ]
then
    export OCL_ICD_FILENAMES_RESET=1
    export OCL_ICD_FILENAMES=libintelocl.so
fi

这可能是冲突conda还是其他事情?

为什么我在 Linux 上会遇到这些问题?在 MacOS 11.3 上,没有问题。

4

1 回答 1

1

用于 debian OS 的 Oneapi /opt/intel/oneapi/setvars.sh 脚本需要默认 shell 为 bash。该错误是因为您在 bash 与 zsh 中使用了 zsh 和语法差异。

xgboost_activate.sh具有zsh不支持的标准 []。在 zsh 中,将使用 Double [[]] 代替。

Double [[]] 是对标准 [] 的扩展,并且受到 bash 和其他 shell(例如 zsh、ksh)的支持。

您可以在“ /opt/intel/oneapi/intelpython/latest/etc/conda/activate.d/xgboost_activate.sh :16”中分别将 '[' 和 ']' 替换为 '[[' 和 ']]'

即替换下面的行

if [ "${OCL_ICD_FILENAMES}" == "" ]

if [[ "${OCL_ICD_FILENAMES}" == "" ]]
于 2021-07-19T12:03:52.927 回答