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

nvptx target missing in 0.33 when installed using pip #601

Closed
jvesely opened this issue Jun 24, 2020 · 5 comments · Fixed by #602
Closed

nvptx target missing in 0.33 when installed using pip #601

jvesely opened this issue Jun 24, 2020 · 5 comments · Fixed by #602
Labels

Comments

@jvesely
Copy link
Contributor

jvesely commented Jun 24, 2020

Hi, has the PTX target been removed in 0.33?

Trying to use target triple nvptx64-nvidia-cuda results in:

cls = <class 'llvmlite.binding.targets.Target'>, triple = 'nvptx64-nvidia-cuda'

    @classmethod
    def from_triple(cls, triple):
        """
        Create a Target instance for the given triple (a string).
        """
        with ffi.OutputString() as outerr:
            target = ffi.lib.LLVMPY_GetTargetFromTriple(triple.encode('utf8'),
                                                        outerr)
            if not target:
>               raise RuntimeError(str(outerr))
E               RuntimeError: No available targets are compatible with triple "nvptx64-nvidia-cuda"

../.local/lib/python3.7/site-packages/llvmlite/binding/targets.py:197: RuntimeError

Reverting to 0.32.1 fixes the issue and my program runs without issues.
Rebuilding 0.33.0 from source using system LLVM also works without any changes to the original program.

@esc esc added the question label Jun 24, 2020
@stuartarchibald
Copy link
Contributor

Thanks for the report. Do you have a reproducer for this please? Also, where did you get llvmlite from? I cannot reproduce locally:

In [1]: import llvmlite                                                                                                         

In [2]: llvmlite.__version__                                                                                                    
Out[2]: '0.33.0'

In [3]: import llvmlite.binding as ll                                                                                           

In [4]: ll.initialize()                                                                                                         

In [5]: ll.initialize_all_targets()                                                                                             

In [6]: from llvmlite.binding.targets import Target                                                                             

In [7]: Target.from_triple('nvptx64-nvidia-cuda')                                                                               
Out[7]: <llvmlite.binding.targets.Target at 0x7facb55b7730>

@stuartarchibald
Copy link
Contributor

Also, the llvmdev package, against which llvmlite is linked has:

$ llvm-config --version
9.0.1

$ llvm-config --targets-built
AMDGPU NVPTX WebAssembly X86

@jvesely
Copy link
Contributor Author

jvesely commented Jun 24, 2020

The above example doesn't work when llvmlite is installed from pip:

$ pip3 install -U --user llvmlite
Collecting llvmlite
  Using cached llvmlite-0.33.0-cp37-cp37m-manylinux1_x86_64.whl (18.3 MB)
Installing collected packages: llvmlite
Successfully installed llvmlite-0.33.0
$ python3
Python 3.7.7 (default, May  3 2020, 11:13:24) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import llvmlite
>>> llvmlite.__version__
'0.33.0'
>>> import llvmlite.binding as ll
>>> ll.initialize()
>>> ll.initialize_all_targets()
>>> from llvmlite.binding.targets import Target
>>> Target.from_triple('nvptx64-nvidia-cuda')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/orome/.local/lib/python3.7/site-packages/llvmlite/binding/targets.py", line 197, in from_triple
    raise RuntimeError(str(outerr))
RuntimeError: No available targets are compatible with triple "nvptx64-nvidia-cuda"
>>>

@jvesely jvesely changed the title nvptx target missing in 0.33 nvptx target missing in 0.33 when installed using pip Jun 24, 2020
@stuartarchibald
Copy link
Contributor

Thanks for confirming, llvmlite 0.33 moved to llvm 9, I think the additional targets didn't get added to the build script in the wheel build path. Conda version: https://github.com/numba/llvmlite/blob/master/conda-recipes/llvmdev/build.sh#L31-L32 Wheel: https://github.com/numba/llvmlite/blob/master/conda-recipes/llvmdev_manylinux1/build.sh#L31

esc added a commit to esc/llvmlite that referenced this issue Jun 25, 2020
Fixes numba#601: add the missing GPU hosts to the wheel build for llvmdev.
@esc
Copy link
Member

esc commented Jun 25, 2020

I prepped a PR applying the suggested fix here: #602

@sklam sklam closed this as completed in #602 Aug 5, 2020
sklam pushed a commit that referenced this issue Aug 5, 2020
Fixes #601: add the missing GPU hosts to the wheel build for llvmdev.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants