Skip to content

Compiler error when building for NVidia Jetson Orin (aarch64) platform with CUDA 11.8 #415

Closed
@RedBreadcat

Description

@RedBreadcat

Describe the bug
When attempting to build PyCuda 2022.2.2 on an NVidia Orin, I get a compiler error related to CU_TARGETC_OMPUTE_20 and CU_TARGET_COMPUTE_21. I'm guessing that the #ifdefs for the CU_TARGET_COMPUTE_* enum values in src/wrapper/wrap_cudadrv.cpp were chosen based off x86-64 CUDA, however it seems that aarch64's cuda.h is different?

To Reproduce
pip3 install pycuda --user, or download from source and build.

Expected behavior
pycuda builds and installs. However, there's the following compiler error:

src/wrapper/wrap_cudadrv.cpp:1034:26: error: ‘CU_TARGET_COMPUTE_20’ was not declared in this scope; did you mean ‘CU_TARGET_COMPUTE_80’?
   1034 |     .value("COMPUTE_20", CU_TARGET_COMPUTE_20)
		|                          ^~~~~~~~~~~~~~~~~~~~
		|                          CU_TARGET_COMPUTE_80
src/wrapper/wrap_cudadrv.cpp:1037:26: error: ‘CU_TARGET_COMPUTE_21’ was not declared in this scope; did you mean ‘CU_TARGET_COMPUTE_61’?
   1037 |     .value("COMPUTE_21", CU_TARGET_COMPUTE_21)
		|                          ^~~~~~~~~~~~~~~~~~~~
		|                          CU_TARGET_COMPUTE_61

I've attached the system's cuda.h: cuda_h.zip
In this header, the enum CUjit_target_enum starts at CU_TARGET_COMPUTE_30, hence the error.
Here's where I installed CUDA 11.8 from: https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=aarch64-jetson&Compilation=Native&Distribution=Ubuntu&target_version=20.04&target_type=deb_local

If I comment out the problematic lines in wrap_cudadrv.cpp then it builds just fine.

Environment:

  • Platform: NVidia Orin
  • OS: Ubuntu 20.04
  • CUDA version: 11.8
  • CUDA driver version: N/A? The Nvidia L4T version is 35.3.1
  • PyCUDA version: tags/v2022.2.2
  • Python version: 3.8.16

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions