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

[fix] Exclude the nvml library in cmake if platform is jetson nano as… #422

Merged
merged 1 commit into from
May 14, 2024

Conversation

stratika
Copy link
Collaborator

@stratika stratika commented May 14, 2024

Description

This PR aims to fix the execution with PTX backend on NVIDIA Jetson Nano. Since the initial integration with the NVIDIA Management Library (NVML) in the native OpenCL and PTX backends for the monitoring of power usage, we have had the linking of the nvml library as default for when we build with the PTX backend. This was because, it requires the NVIDIA CUDA Toolkit to be installed.

However, we figured it out that for NVIDIA Jetson Nano the nvidia-smi and the nvml capabilities are not supported.

For instance an example is as follows:

tornado --devices
WARNING: Using incubator modules: jdk.incubator.vector

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:

You should always run with libnvidia-ml.so that is installed with your
NVIDIA Display Driver. By default it's installed in /usr/lib and /usr/lib64.
libnvidia-ml.so in GDK package is a stub library that is attached only for
build purposes (e.g. machine that you build your application doesn't have
to have Display Driver installed).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[TornadoVM-PTX-NVML-JNI] ERROR : nvmlInit -> Returned: 9

Number of Tornado drivers: 1
Driver: PTX
  Total number of PTX devices  : 1
  Tornado device=0:0  (DEFAULT)
	PTX -- PTX -- NVIDIA Tegra X1
		Global Memory Size: 3.9 GB
		Local Memory Size: 48.0 KB
		Workgroup Dimensions: 3
		Total Number of Block Threads: [2147483647, 65535, 65535]
		Max WorkGroup Configuration: [1024, 1024, 64]
		Device OpenCL C version: N/A

Therefore this PR provides a patch that will ignore the nvml functions if the platform is Jetson Nano.

Backend/s tested

Mark the backends affected by this PR.

  • OpenCL
  • PTX
  • SPIRV

OS tested

Mark the OS where this PR is tested.

  • Linux
  • OSx
  • Windows

Did you check on FPGAs?

If it is applicable, check your changes on FPGAs.

  • Yes
  • No

How to test the new patch?

make BACKEND=ptx
tornado --enableProfiler console -m tornado.examples/uk.ac.manchester.tornado.examples.VectorAddInt --params="100000"

@stratika stratika requested review from mikepapadim and jjfumero May 14, 2024 12:50
@stratika stratika self-assigned this May 14, 2024
@stratika stratika added bug Something isn't working PTX labels May 14, 2024
@jjfumero
Copy link
Member

jjfumero commented May 14, 2024

I confirm it works on the Jetson nano.

@stratika
Copy link
Collaborator Author

I confirm it works on the Jetson nano.

Thanks, I have also tested it on my Dell laptop that it does not break that setup.

@jjfumero jjfumero merged commit 700e653 into beehive-lab:develop May 14, 2024
2 checks passed
@stratika stratika deleted the fix/nvml/jetson_nano branch May 14, 2024 14:10
jjfumero added a commit to jjfumero/TornadoVM that referenced this pull request May 28, 2024
Improvements
~~~~~~~~~~~~~~~~~~

- beehive-lab#402 <beehive-lab#402>: Support for TornadoNativeArrays from FFI buffers.
- beehive-lab#403 <beehive-lab#403>: Clean-up and refactoring for the code analysis of the loop-interchange.
- beehive-lab#405 <beehive-lab#405>: Disable Loop-Interchange for CPU offloading..
- beehive-lab#407 <beehive-lab#407>: Debugging OpenCL Kernels builds improved.
- beehive-lab#410 <beehive-lab#410>: CPU block scheduler disabled by default and option to switch between different thread-schedulers added.
- beehive-lab#418 <beehive-lab#418>: TornadoOptions and TornadoLogger improved.
- beehive-lab#423 <beehive-lab#423>: MxM using ns instead of ms to report performance.
- beehive-lab#425 <beehive-lab#425>: Vector types for ``Float<Width>`` and ``Int<Width>`` supported.
- beehive-lab#429 <beehive-lab#429>: Documentation of the installation process updated and improved.
- beehive-lab#432 <beehive-lab#432>: Support for SPIR-V code generation and dispatcher using the TornadoVM OpenCL runtime.

Compatibility
~~~~~~~~~~~~~~~~~~

- beehive-lab#409 <beehive-lab#409>: Guidelines to build the documentation.
- beehive-lab#411 <beehive-lab#411>: Windows installer improved.
- beehive-lab#412 <beehive-lab#412>: Python installer improved to check download all Python dependencies before the main installer.
- beehive-lab#413 <beehive-lab#413>: Improved documentation for installing all configurations of backends and OS.
- beehive-lab#424 <beehive-lab#424>: Use Generic GPU Scheduler for some older NVIDIA Drivers for the OpenCL runtime.
- beehive-lab#430 <beehive-lab#430>: Improved the installer by checking  that the TornadoVM environment is loaded upfront.

Bug Fixes
~~~~~~~~~~~~~~~~~~

- beehive-lab#400 <beehive-lab#400>: Fix batch computation when the global thread indexes are used to compute the outputs.
- beehive-lab#414 <beehive-lab#414>: Recover Test-Field unit-tests using Panama types.
- beehive-lab#415 <beehive-lab#415>: Check style errors fixed.
- beehive-lab#416 <beehive-lab#416>: FPGA execution with multiple tasks in a task-graph fixed.
- beehive-lab#417 <beehive-lab#417>: Lazy-copy out fixed for Java fields.
- beehive-lab#420 <beehive-lab#420>: Fix Mandelbrot example.
- beehive-lab#421 <beehive-lab#421>: OpenCL 2D thread-scheduler fixed for NVIDIA GPUs.
- beehive-lab#422 <beehive-lab#422>: Compilation for NVIDIA Jetson Nano fixed.
- beehive-lab#426 <beehive-lab#426>: Fix Logger for all backends.
- beehive-lab#428 <beehive-lab#428>: Math cos/sin operations supported for vector types.
- beehive-lab#431 <beehive-lab#431>: Jenkins files fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PTX
Projects
Development

Successfully merging this pull request may close these issues.

3 participants