vincefn / pyvkfft

Python interface to VkFFT
MIT License
51 stars 6 forks source link

installation on ubuntu with nvidia card. #10

Closed pythonmobile closed 2 years ago

pythonmobile commented 2 years ago

How do I get pyvkfft to use the nvidia card + opencl on an ubuntu 18.04LTS system? When I pip install, I get the following error:

  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/src/vkfft_opencl.o -lOpenCL -o build/lib.linux-x86_64-3.8/pyvkfft/_vkfft_opencl.cpython-38-x86_64-linux-gnu.so --shared
  /usr/bin/ld: cannot find -lOpenCL
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-g++' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyvkfft
  Running setup.py clean for pyvkfft
Failed to build pyvkfft
Installing collected packages: pyvkfft```

I am running nvidia driver versions:

NVIDIA-SMI 460.91.03 Driver Version: 460.91.03 CUDA Version: 11.2

vincefn commented 2 years ago

You seem to be missing libopencl.so. If you go to https://packages.ubuntu.com/search?keywords=search , clickbionic (Ubuntu 18.04) to narrow the search, then select "package contents" in the drop-down menu and search for libopencl.so, you'll find that ocl-icd-opencl-dev is probably missing.

You'll also need the nvidia libraries installed, but hopefully this was installed along the driver. And if you want the CUDA backend, you'll need the nvidia development tools to have nvcc.