Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing numba-dpex into environment with dpcpp compiler breaks it #676

Closed
oleksandr-pavlyk opened this issue Dec 13, 2021 · 3 comments
Closed
Labels
llvm-spirv related to the llvm-spirv

Comments

@oleksandr-pavlyk
Copy link
Contributor

To test examples of dpctl I need both DPC++ compiler to compile native extensions, and all the Python prerequisites used in Python examples.

Numba-dppy is one such prerequisite (dcptl/examples/python/dppy_kernel.py, see #L18).

Unfortunately llvm-spirv tool installed by numba-dppy interferes with compiler's tool in 2021.4.

Excerpt from a log of testing examples of dpctl
~/work/dpctl/dpctl/examples/pybind11/external_usm_allocation ~/work/dpctl/dpctl/examples/pybind11
running build_ext
building 'external_usm_alloc' extension
creating build
creating build/temp.linux-x86_64-3.8
dpcpp -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/share/miniconda/lib/python3.8/site-packages/dpctl/include -I/usr/share/miniconda/lib/python3.8/site-packages/pybind11/include -I/usr/share/miniconda/include/python3.8 -c ./_usm_alloc_example.cpp -o build/temp.linux-x86_64-3.8/./_usm_alloc_example.o -fvisibility=hidden -g0 -fPIC
creating build/lib.linux-x86_64-3.8
dpcpp -pthread -shared -B /usr/share/miniconda/compiler_compat -L/usr/share/miniconda/lib -Wl,-rpath=/usr/share/miniconda/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.8/./_usm_alloc_example.o -lsycl -o build/lib.linux-x86_64-3.8/external_usm_alloc.cpython-38-x86_64-linux-gnu.so -fPIC
llvm-spirv: for the --spirv-max-version option: Cannot find option named '1.3'!
llvm-spirv: Unknown command line argument '-spirv-debug-info-version=ocl-100'.  Try: '/usr/share/miniconda/bin/llvm-spirv --help'
llvm-spirv: Did you mean '--spirv-ocl-builtins-version=ocl-100'?
llvm-spirv: for the -s option: may only occur zero or one times!
llvm-spirv: Unknown command line argument '-spirv-allow-extra-diexpressions'.  Try: '/usr/share/miniconda/bin/llvm-spirv --help'
llvm-spirv: Did you mean '--spirv-ocl-builtins-version'?
llvm-spirv: for the -s option: may only occur zero or one times!
llvm-spirv: Unknown command line argument '-spirv-allow-unknown-intrinsics=llvm.genx.'.  Try: '/usr/share/miniconda/bin/llvm-spirv --help'
llvm-spirv: Did you mean '--irce-allow-narrow-latch=llvm.genx.'?
llvm-foreach: 
dpcpp: error: llvm-spirv command failed with exit code 1 (use -v to see invocation)
error: command 'dpcpp' failed with exit status 1
@PokhodenkoSA
Copy link
Contributor

PokhodenkoSA commented Dec 13, 2021

@oleksandr-pavlyk
What versions of numba-dppy and dpcpp do you use?

@PokhodenkoSA
Copy link
Contributor

PokhodenkoSA commented Dec 13, 2021

There is a trick with 2 conda environments:

conda create -n dev numba-dppy ...
conda create -n dev-build dpcpp_linux-64 ... 

conda activate dev
conda activate --stack dev-build  # try also with `export CONDA_BUILD="1"`

So you will have numba-dppy installed in dev and dpcpp installed in dev-build. llvm-spirv will be used from dev-build.

This problem was in dpcpp 2021.4 package. It conflicted with llvm-spir package.
numba-dppy can use llvm-spirv from any of dpcpp package or llvm-spirv package.

@diptorupd diptorupd changed the title Installing numba-dppy into environment with dpcpp compiler breaks it Installing numba-dpex into environment with dpcpp compiler breaks it Oct 5, 2022
@diptorupd
Copy link
Contributor

Numba-dpex moved to a dedicated llvm-spirv translator package called dpcpp-llvm-spirv that should not cause the issue reported in this ticket any longer. @oleksandr-pavlyk if you are able to still reproduce the issue, please reopen the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm-spirv related to the llvm-spirv
Projects
None yet
Development

No branches or pull requests

4 participants