Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.

Help developing my first code

PabloBL
Beginner
2,248 Views

Hello everyone,

First of all, thanks for reading this.

 

I am new to programming in Python with GPU, and as my laptop has an Intel GPU, I cannot use cupy  as a substitute of numpy. I am trying to use Intel's package dpnp. I followed the guidelines, and I installed Intel distribution for Python and Intel® oneAPI Base Toolkit, in that order, on my Windows 10 machine.

Then, I  added a new environment into my Visual Studio project with the path of the installation, and it seems to work, because when I type Python I get the following

 

PabloBL_0-1690891388180.png

Now, if I try to install the dpnp package in the environment, it looks like it is already installed, because I get

 

PabloBL_1-1690891705488.png

But, if I try to run any code where I need to use it, it cannot be found. For example, if I try to import it:

 

PabloBL_2-1690891929963.png

 

In the screen-shot, it looks like the problem is with the package dpctl, but it also says that it's already installed.

 

Can anybody explain to me what I am doing wrong?

 

As a follow-up question, do you know if there is an easier way to make use of my laptop's GPU for programming with Python in any numpy-like library?

 

Thanks in advance,

Pablo

 

 

 

 

0 Kudos
1 Solution
AlekhyaV_Intel
Moderator
2,197 Views

Hi,

 

Thank you for posting in Intel Communities.

 

We tried reproducing your issue. We got the same error as yours when didn't run the setvars.sh/setvars.bat to initialize oneAPI environment. Please find the below screenshot for your reference:

AlekhyaV_Intel_0-1691057218378.png

 

In a command prompt, Initialize oneAPI environment with the below command:

C:\\Program files(x86)\Intel\oneAPI\setvars.bat

After sourcing oneAPI:

AlekhyaV_Intel_1-1691057371144.png

If this resolves your issue, make sure to accept this as a solution. This helps others with similar issue. Thanks!

 

Regards,

Alekhya

 

 

View solution in original post

0 Kudos
4 Replies
AlekhyaV_Intel
Moderator
2,198 Views

Hi,

 

Thank you for posting in Intel Communities.

 

We tried reproducing your issue. We got the same error as yours when didn't run the setvars.sh/setvars.bat to initialize oneAPI environment. Please find the below screenshot for your reference:

AlekhyaV_Intel_0-1691057218378.png

 

In a command prompt, Initialize oneAPI environment with the below command:

C:\\Program files(x86)\Intel\oneAPI\setvars.bat

After sourcing oneAPI:

AlekhyaV_Intel_1-1691057371144.png

If this resolves your issue, make sure to accept this as a solution. This helps others with similar issue. Thanks!

 

Regards,

Alekhya

 

 

0 Kudos
AlekhyaV_Intel
Moderator
2,160 Views

Hi,


Has the solution provided helped? Could you please give us an update regarding this issue?


Regards,

Alekhya


0 Kudos
PabloBL
Beginner
2,152 Views

Hello,

 

After following some guideline where examples where presented (https://www.intel.com/content/www/us/en/docs/oneapi-base-toolkit/get-started-guide-windows/2023-2/overview.html ), I could do it. I think it was the proposed step that was missing, so I have accepted your reply.

 

Thank you very much,

Pablo

0 Kudos
AlekhyaV_Intel
Moderator
2,077 Views

Hi,


Glad to know that your issue is resolved. Thanks for accepting our solution. If you need any further information, please post a new question as this case is no longer monitored by Intel.


Regards,

Alekhya


0 Kudos
Reply