最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to open visual-studio-code with oneAPI's MKL support? - Stack Overflow

programmeradmin0浏览0评论

In my work, I'm building Python libraries in C++17 with massive use of the BLAS subroutines under the Intel's MKL implementation. I have no problems building these applications, however I have been unable to loaded them correctly on any Jupyter notebooks within vscode. The root of the problem was that I don't know now to activate oneAPI environment vars, i.e. to call

$ source /opt/intel/oneapi/setvars.sh

within the Jupyter notebooks.

I think this is not possible: oneAPI environment should be called before activating the Jupiter notebook. (But, perhaps I'm wrong and someone can show me how)

As a result whenever I try to load my library within a ipynb I get the following error from libmkl:

By mistake, I opened vscode on a terminal where I had previously activated oneAPI's environment and this solved my initial issue. Now I'm able to load correctly my library

... and use it with any ipynb within vscode:

For the sake of clarity, this works only because I load oneAPI's vars before calling svcode, namely

(base) joe@cool$ source /opt/intel/oneapi/setvars.sh 
 
:: initializing oneAPI environment ...
   bash: BASH_VERSION = 5.2.21(1)-release
   args: Using "$@" for setvars.sh arguments: 
:: compiler -- latest
:: mkl -- latest
:: tbb -- latest
:: umf -- latest
:: oneAPI environment initialized ::
 
(base) joe@cool$ code&

However, this leave me with two questions:

  • is there an automated way call oneAPI's MKL enviroment whenever I call/open vscode?

and

  • is there a way for vscode to let me know that oneAPI's MKL enviroment is active or not?

In other words: I found a work around to my initial problem, but I think there must be a feature in vscode that allows me to automate the loading of oneAPI's MKL environment variables.

发布评论

评论列表(0)

  1. 暂无评论