Tensorflow for C on the NX

I’ve been trying to get tensorflow for C to run on the JetsonNX with little luck. Since there is seemingly no official version, I compiled it from source.

Disabling CUDA (either through compilation flags or through environment variables) runs just fine, albeit using the CPU. Having CUDA enabled on the compilation options gives no errors, but when I try to run an application, it freezes after the following message:

Adding visible gpu devices: 0

Now, after leaving it there for a few minutes (about 4 or 5 minutes) seems to go through and finally run, but this is not very practical.

Does anybody have any idea of what’s going on? Maybe what sort of compilation options or patches to use to solve this problem?

FYI, here’s how I compiled it

  1. Bootstrapped Bezel 3.7.2, as explained below
    Compiling Bazel from source - Bazel

  2. Cloned tensorflow 2.3.2
    git clone --branch v2.3.2 --depth 1 https://github.com/tensorflow/tensorflow.git

  3. Run configure. Basically I stripped all the extra capabilities except for TensoRT and CUDA

  4. Built with the following command
    bazel build --config=opt --config=monolithic --config=noaws --config=nogcp --config=nonccl --config=v2 --local_ram_resources=2048 --local_cpu_resources=2 --config=cuda //tensorflow/tools/lib_package:libtensorflow

After a few hours, it compiles just fine, but with the slow start up problem described above.

Any help would be greatly appreciated.

Hi,

Sorry that we don’t officially support this.
Here is a related topic and some discussion for your reference:

Thanks.