arrayfire / arrayfire-python

Python bindings for ArrayFire: A general purpose GPU library.

Home Page:https://arrayfire.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use ArrayFire on Google Colab

WMX567 opened this issue · comments

I try to use ArrayFire on Google Colab, but I got:
/tmp/tmpxft_000005af_00000000-10_coreset.o: In function main': tmpxft_000005af_00000000-5_coreset.cudafe1.cpp:(.text+0x4b): undefined reference to af::array af::constant(int, long long, long long, af_dtype)'
tmpxft_000005af_00000000-5_coreset.cudafe1.cpp:(.text+0x5e): undefined reference to af::print(char const*, af::array const&)' tmpxft_000005af_00000000-5_coreset.cudafe1.cpp:(.text+0x6f): undefined reference to af::array::~array()'
tmpxft_000005af_00000000-5_coreset.cudafe1.cpp:(.text+0x91): undefined reference to `af::array::~array()'
collect2: error: ld returned 1 exit status

I install it with:
sh ./drive/MyDrive/ArrayFire64.sh --include-subdir --prefix=/opt
echo /opt/arrayfire/lib64 > /etc/ld.so.conf.d/arrayfire.conf

I run with:
nvcc -I/opt/arrayfire/include/ coreset.cu -o test

Hi @WMX567, we now support Google Colab through Python Wheels. You can use this example Colab file to see how it works with the following commands:

# install arrayfire
!pip install arrayfire==3.8.0+cu112 -f https://repo.arrayfire.com/python/wheels/3.8.0/
import arrayfire as af

Good luck and let us know if you have any further questions!