ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
64 stars 29 forks source link

Installing bifrost in NVIDIA Jetson Nano #149

Closed mugundhan1 closed 3 years ago

mugundhan1 commented 3 years ago

Hi,

I'm trying to install Bifrost in NVIDIA Jetson Nano development board. When I try to install with no GPU option, the installation completes without errors, but when I import in python shell, I get the following error: mux-jetson@mux-jetson:~$ python -c "import bifrost" Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/bifrost-0.9.0-py2.7.egg/bifrost/init.py", line 37, in from bifrost import core, memory, affinity, ring, block, address, udp_socket File "/usr/local/lib/python2.7/dist-packages/bifrost-0.9.0-py2.7.egg/bifrost/core.py", line 32, in from bifrost.libbifrost import _bf File "/usr/local/lib/python2.7/dist-packages/bifrost-0.9.0-py2.7.egg/bifrost/libbifrost.py", line 41, in import bifrost.libbifrost_generated as _bf File "/usr/local/lib/python2.7/dist-packages/bifrost-0.9.0-py2.7.egg/bifrost/libbifrost_generated.py", line 603, in _libs["bifrost"] = load_library("bifrost") File "/usr/local/lib/python2.7/dist-packages/bifrost-0.9.0-py2.7.egg/bifrost/libbifrost_generated.py", line 354, in load_library raise ImportError("%s not found." % libname) ImportError: bifrost not found.

When I try to install the same using GPU, installation fails with the following error. mux-jetson@mux-jetson:~/bifrost$ sudo make make -C src all make[1]: Entering directory '/home/mux-jetson/bifrost/src' /bin/sh: nvcc: command not found /bin/sh: cuobjdump: command not found \033[2KBuilding C++ source file common.cpp\r\033[2KBuilding C++ source file memory.cpp\r\033[2KBuilding C++ source file affinity.cpp\r\033[2KBuilding C++ source file cuda.cpp\r\033[2KBuilding C++ source file ring.cpp\r\033[2KBuilding C++ source file ring_impl.cpp\r\033[2KBuilding C++ source file array.cpp\r\033[2KBuilding C++ source file address.cpp\r\033[2KBuilding C++ source file udp_socket.cpp\r\033[2KBuilding C++ source file udp_capture.cpp\r\033[2KBuilding C++ source file udp_transmit.cpp\r\033[2KBuilding C++ source file unpack.cpp\r\033[2KBuilding C++ source file quantize.cpp\r\033[2KBuilding C++ source file proclog.cpp\r\033[2KBuilding CUDA source file transpose.cu\r/bin/sh: nvcc: command not found autodep.mk:56: recipe for target 'transpose.o' failed make[1]: [transpose.o] Error 127 make[1]: Leaving directory '/home/mux-jetson/bifrost/src' Makefile:15: recipe for target 'libbifrost' failed make: [libbifrost] Error 2

first thing is I'm using /bin/bash and not /bin/sh. I verified this by doing echo $0, for which I get the following output: mux-jetson@mux-jetson:~$ echo $0 -bash

The cuda libraries are at /usr/local/cuda-10.2. I'm able to verify this by echoing $CUDA_HOME.

The os in the nvidia jetson is: Ubuntu 18.04.5 LTS (GNU/Linux 4.9.140-tegra aarch64) and the kernel is 4.9.140-tegra.

Any help/guidance will be very useful!

Sincerely,

Mugundhan

mugundhan1 commented 3 years ago

An update, I was able to install successfully with NO_CUDA flag. I followed the instructions in post #109 and was able to make the installation work. But the GPU part is still unsucessful !

Sincerely, Mugundhan

KentJames commented 3 years ago

Looks like your CUDA compiler isn’t reachable on $PATH. Verify you have the SDK installed and it is able to compile one of the CUDA SDK examples please?

Sent from my iPhone

On 20 Jan 2021, at 05:38, mugundhan1 notifications@github.com wrote:

 An update, I was able to install successfully with NO_CUDA flag. I followed the instructions in post #109 and was able to make the installation work. But the GPU part is still unsucessful !

Sincerely, Mugundhan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mugundhan1 commented 3 years ago

Hi Kent,

I had to make an edit to the make file to force the shell from /bin/sh to /bin/bash in both the bifrost and source folders. Then when I tried to make without sudo, which was able to see cuda at the right place. After this, the compilation was failing when it had to compile the jit-linked files due permission issues, but sudo wasn't able to see the $PATH variable. So I included this line: alias sudo='sudo env PATH=$PATH' at the end of my bashrc. The installation works fine now - as in when I try python -c "import bifrost", it doesn't return any error !

Thanks for your time.

Sincerely, Mugundhan