tensorflow_cc icon indicating copy to clipboard operation
tensorflow_cc copied to clipboard

Duplicate #136 code and meet make errors

Open lancelot-ch opened this issue 3 years ago • 16 comments

I copied #136 codes and revised as Floop suggested that put 3 lines right below Scope root = Scope::NewRootScope(); And I have many make errors. If anyone could help I will be much appreciated.

I am running on the following conditions: Freshly built Ubuntu 20.04LTS CUDA 10.7 CuDnn 8.4.0 Bazel 5.1.1 GCC 9.4.0 make 4.2.1 tensoflow_cc build on 20-05-27, using tensorflow 2.9.0

I am using a PC with an Intel CPU, an Intel GPU and an NVidia T600.

I compiled tensorflow_cc with default CMakeLists file except for putting REQUIRE_CUDA ON, and make is successful.

Then I copied 136 codes:

#include "tensorflow/cc/client/client_session.h" #include "tensorflow/cc/ops/standard_ops.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/graph/default_device.h"

int main() { using namespace tensorflow; using namespace tensorflow::ops; Scope root = Scope::NewRootScope(); GraphDef def; TF_CHECK_OK(root.ToGraphDef(&def));

graph::SetDefaultDevice(false ? "/device:GPU:0" : "/cpu:0", &def); // Matrix A = [3 2; -1 0] auto A = Const(root, { {3.f, 2.f}, {-1.f, 0.f} }); // Vector b = [3 5] auto b = Const(root, { {3.f, 5.f} }); // v = Ab^T auto v = MatMul(root.WithOpName("v"), A, b, MatMul::TransposeB(true));

for (auto &node: *def.mutable_node()) { node.set_device("/cpu:0"); std::cout << node.name() << " = '" << node.device() <<"'"<< std::endl; } std::cout << "=======================\n";

std::vector<Tensor> outputs; ClientSession session(root); // Run and fetch v TF_CHECK_OK(session.Run({v}, &outputs)); // Expect outputs[0] == [19; -3] LOG(INFO) << outputs[0].matrix(); return 0; }

I have following make errors:

[ 50%] Building CXX object CMakeFiles/example.dir/example2.cpp.o [100%] Linking CXX executable example /usr/bin/ld: CMakeFiles/example.dir/example2.cpp.o: in function google::protobuf::Arena::AllocHook(std::type_info const*, unsigned long) const': example2.cpp:(.text._ZNK6google8protobuf5Arena9AllocHookEPKSt9type_infom[_ZNK6google8protobuf5Arena9AllocHookEPKSt9type_infom]+0x41): undefined reference to google::protobuf::Arena::OnArenaAllocation(std::type_info const*, unsigned long) const' /usr/bin/ld: CMakeFiles/example.dir/example2.cpp.o: in function google::protobuf::internal::ArenaStringPtr::CreateInstance(google::protobuf::Arena*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*)': example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x60): undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x78): undefined reference to google::protobuf::internal::LogMessage::operator<<(char const*)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8d): undefined reference to google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x9d): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x221): undefined reference to google::protobuf::internal::ArenaImpl::AllocateAligned(unsigned long)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x240): undefined reference to google::protobuf::internal::ArenaImpl::AllocateAlignedAndAddCleanup(unsigned long, void (*)(void*))' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2d4): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: CMakeFiles/example.dir/example2.cpp.o: in function google::protobuf::internal::GetEmptyStringAlreadyInited[abi:cxx11]()': example2.cpp:(.text._ZN6google8protobuf8internal27GetEmptyStringAlreadyInitedB5cxx11Ev[_ZN6google8protobuf8internal27GetEmptyStringAlreadyInitedB5cxx11Ev]+0xb): undefined reference to google::protobuf::internal::fixed_address_empty_string[abi:cxx11]' /usr/bin/ld: CMakeFiles/example.dir/example2.cpp.o: in function tensorflow::NodeDef::set_device(char const*)': example2.cpp:(.text._ZN10tensorflow7NodeDef10set_deviceEPKc[_ZN10tensorflow7NodeDef10set_deviceEPKc]+0x4b): undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' /usr/bin/ld: example2.cpp:(.text._ZN10tensorflow7NodeDef10set_deviceEPKc[_ZN10tensorflow7NodeDef10set_deviceEPKc]+0x63): undefined reference to google::protobuf::internal::LogMessage::operator<<(char const*)' /usr/bin/ld: example2.cpp:(.text._ZN10tensorflow7NodeDef10set_deviceEPKc[_ZN10tensorflow7NodeDef10set_deviceEPKc]+0x75): undefined reference to google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' /usr/bin/ld: example2.cpp:(.text._ZN10tensorflow7NodeDef10set_deviceEPKc[_ZN10tensorflow7NodeDef10set_deviceEPKc]+0x85): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: example2.cpp:(.text._ZN10tensorflow7NodeDef10set_deviceEPKc[_ZN10tensorflow7NodeDef10set_deviceEPKc]+0x11d): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: CMakeFiles/example.dir/example2.cpp.o: in function google::protobuf::RepeatedPtrField<tensorflow::NodeDef>::TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Mutable<google::protobuf::RepeatedPtrField<tensorflow::NodeDef>::TypeHandler>(int)': example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0x49): undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0x61): undefined reference to google::protobuf::internal::LogMessage::operator<<(char const*)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0x73): undefined reference to google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0x83): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0xb1): undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0xc9): undefined reference to google::protobuf::internal::LogMessage::operator<<(char const*)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0xdb): undefined reference to google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0xeb): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0x12e): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /usr/bin/ld: example2.cpp:(.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi[_ZN6google8protobuf8internal20RepeatedPtrFieldBase7MutableINS0_16RepeatedPtrFieldIN10tensorflow7NodeDefEE11TypeHandlerEEEPNT_4TypeEi]+0x150): undefined reference to `google::protobuf::internal::LogMessage::~LogMessage()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/example.dir/build.make:87: example] Error 1 make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/example.dir/all] Error 2

lancelot-ch avatar May 30 '22 07:05 lancelot-ch

Can you try to link Protobuf to your program?

FloopCZ avatar Jun 02 '22 13:06 FloopCZ

Thanks for the reply. Sorry that I don't know exactly how to link Protobuf.

I installed Protobuf from source and the folder is at ~/protobuf.3.9.0

The project CMakeLists.txt file is as below:

CMakeLists.txt

cmake_minimum_required(VERSION 3.16) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) find_package(TensorflowCC REQUIRED) add_executable(test test.cpp) target_include_directories(test PUBLIC "${PROJECT_BINARY_DIR}" ) add_subdirectory(abseil-cpp) target_link_libraries(test TensorflowCC::TensorflowCC absl::strings)

lancelot-ch avatar Jun 03 '22 01:06 lancelot-ch

See e.g., https://cmake.org/cmake/help/latest/module/FindProtobuf.html

find_package(Protobuf REQUIRED)
target_link_libraries(foo ${Protobuf_LIBRARIES})
target_include_directories(foo ${Protobuf_INCLUDE_DIRS})

FloopCZ avatar Jun 03 '22 08:06 FloopCZ

Thanks.

I tried include these 3 lines. And I get the following error:

$ cmake .. CMake Error at CMakeLists.txt:20 (target_include_directories): target_include_directories called with invalid arguments

And line 20 is : target_include_directories(test ${Protobuf_INCLUDE_DIRS})

I am not sure what is wrong.

lancelot-ch avatar Jun 03 '22 12:06 lancelot-ch

Please print the ${Protobuf_INCLUDE_DIRS} variable using message() call. Maybe there are some spaces and you have to wrap it in ".

FloopCZ avatar Jun 03 '22 13:06 FloopCZ

Thanks.

I do see something weird.

cmake .. /home/user/anaconda3/lib/libprotobuf.so-lpthread /home/user/anaconda3/include CMake Error at CMakeLists.txt:22 (target_include_directories): target_include_directories called with invalid arguments

-- Configuring incomplete, errors occurred!

I recently installed Anaconda and I am wondering if that changed the path. Shall I just uninstall Anaconda and try?

lancelot-ch avatar Jun 03 '22 16:06 lancelot-ch

You can try or you can try to change the PATH, but protobuf from anaconda is probably not the one you want. Anyway, the error you are seeing is most likely caused by something else, just add ${Protobuf_INCLUDE_DIRS} and ${Protobuf_LIBRARIES} to the target_include_directories and target_link_libraries directives that you already had.

FloopCZ avatar Jun 03 '22 16:06 FloopCZ

Thanks. Could I verify that I should install protobuf by myself(hopefully 3.9.0), and compile tensorflow_cc with

option(INSTALL_PROTOBUF "Install protobuf compatible with tensorflow version." OFF)

I am not sure if it is correct.

lancelot-ch avatar Jun 04 '22 15:06 lancelot-ch

No, you don't need to install protobuf yourself, the INSTALL_PROTOBUF will do that for you, but you still have to link your executable to the Protobuf in CMake as discussed earlier. Also, you can try our Docker images where everything is already installed.

On Sat, Jun 4, 2022, 18:00 lancelot-ch @.***> wrote:

Thanks. Could I verify that I should install protobuf by myself(hopefully 3.9.0), and compile tensorflow_cc with

option(INSTALL_PROTOBUF "Install protobuf compatible with tensorflow version." OFF)

I am not sure if it is correct.

— Reply to this email directly, view it on GitHub https://github.com/FloopCZ/tensorflow_cc/issues/293#issuecomment-1146640526, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABN5KH5XBS2TYSAXZU7Y4KLVNN4QLANCNFSM5XJUNOMA . You are receiving this because you commented.Message ID: @.***>

FloopCZ avatar Jun 06 '22 06:06 FloopCZ

I tried but I failed.

I do with this way:

I revise tensorflow_cc/tensorflow_cc/CMakeLists.txt

option(INSTALL_PROTOBUF "Install protobuf compatible with tensorflow version." ON) #previously it is OFF

I run cmake:

~/tensorflow_cc/tensorflow_cc/build$ cmake -DLOCAL_RAM_RESOURCES=2048 -DLOCAL_CPU_RESOURCES=4 ..

I see below error messages:

-- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done Will build Protobuf from ''. CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2630 (message): No download info given for 'protobuf-external' and its source directory:

/home/user/tensorflow_cc/tensorflow_cc/build/protobuf/src/protobuf-external

is not an existing non-empty directory. Please specify one of:

  • SOURCE_DIR with an existing non-empty directory
  • DOWNLOAD_COMMAND
  • URL
  • GIT_REPOSITORY
  • SVN_REPOSITORY
  • HG_REPOSITORY
  • CVS_REPOSITORY and CVS_MODULE Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command) cmake/ProtobufExternal.cmake:17 (ExternalProject_Add) CMakeLists.txt:36 (include)

Seems that it suggests that I get an external Protobuf?

Many thanks.

lancelot-ch avatar Jun 07 '22 22:06 lancelot-ch

The build folder seems to be damaged, please try to remove the whole build folder first.

On Wed, Jun 8, 2022, 00:39 lancelot-ch @.***> wrote:

I tried but I failed.

I do with this way:

I revise tensorflow_cc/tensorflow_cc/CMakeLists.txt

option(INSTALL_PROTOBUF "Install protobuf compatible with tensorflow version." ON) #previously it is OFF

I run cmake:

~/tensorflow_cc/tensorflow_cc/build$ cmake -DLOCAL_RAM_RESOURCES=2048 -DLOCAL_CPU_RESOURCES=4 ..

I see below error messages:

-- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done Will build Protobuf from ''. CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2630 (message): No download info given for 'protobuf-external' and its source directory:

/home/user/tensorflow_cc/tensorflow_cc/build/protobuf/src/protobuf-external

is not an existing non-empty directory. Please specify one of:

  • SOURCE_DIR with an existing non-empty directory
  • DOWNLOAD_COMMAND
  • URL
  • GIT_REPOSITORY
  • SVN_REPOSITORY
  • HG_REPOSITORY
  • CVS_REPOSITORY and CVS_MODULE Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command) cmake/ProtobufExternal.cmake:17 (ExternalProject_Add) CMakeLists.txt:36 (include)

Seems that it suggests that I get an external Protobuf?

Many thanks.

— Reply to this email directly, view it on GitHub https://github.com/FloopCZ/tensorflow_cc/issues/293#issuecomment-1149242106, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABN5KH6X2RJGZLVGXUGRTA3VN7FRLANCNFSM5XJUNOMA . You are receiving this because you commented.Message ID: @.***>

FloopCZ avatar Jun 08 '22 07:06 FloopCZ

I removed build folder and tried again. I got the same error.

Will build Protobuf from ''. CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2630 (message): No download info given for 'protobuf-external' and its source directory:

/home/user/tensorflow_cc/tensorflow_cc/build/protobuf/src/protobuf-external

is not an existing non-empty directory. Please specify one of:

  • SOURCE_DIR with an existing non-empty directory
  • DOWNLOAD_COMMAND
  • URL
  • GIT_REPOSITORY
  • SVN_REPOSITORY
  • HG_REPOSITORY
  • CVS_REPOSITORY and CVS_MODULE Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command) cmake/ProtobufExternal.cmake:17 (ExternalProject_Add) CMakeLists.txt:36 (include)

-- Configuring incomplete, errors occurred! See also "/home/user/tensorflow_cc/tensorflow_cc/build/CMakeFiles/CMakeOutput.log".

lancelot-ch avatar Jun 08 '22 07:06 lancelot-ch

Many thanks to FloopCZ that with Docker I can make the program. The results is as following:

root@9c79a0ff0c79:/home/test/build# ./test 2022-06-09 01:18:04.209457: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.

2022-06-09 01:18:04.218837: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX512F AVX512_VNNI To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-09 01:18:05.116681: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-06-09 01:18:05.139072: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-06-09 01:18:05.139187: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-06-09 01:18:05.455365: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-06-09 01:18:05.455501: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-06-09 01:18:05.455588: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-06-09 01:18:05.455691: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 2636 MB memory: -> device: 0, name: NVIDIA T600 Laptop GPU, pci bus id: 0000:01:00.0, compute capability: 7.5 2022-06-09 01:18:05.456816: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:354] MLIR V1 optimization pass is not enabled

However, I realized that even if I change the device from GPU to CPU (graph::SetDefaultDevice("/cpu:0", &def); ), the result is always using GPU device. I do not quite understand.

And also I hope to get the source code installing done if possible. Thanks a lot.

lancelot-ch avatar Jun 09 '22 01:06 lancelot-ch

Hi, try to run

export CUDA_VISIBLE_DEVICES=""

before running your program to disable the GPU

FloopCZ avatar Jun 25 '22 14:06 FloopCZ

Hi, try to run

export CUDA_VISIBLE_DEVICES=""

before running your program to disable the GPU

Actually I am meant to use GPU to accelerate program running by using GPU. I have been successful to run program using tensorflow_cc on CPU. Anyway, I will keep trying.

lancelot-ch avatar Jul 01 '22 14:07 lancelot-ch

ok, I think I misunderstood your previous message:

However, I realized that even if I change the device from GPU to CPU (graph::SetDefaultDevice("/cpu:0", &def); ), the result is always using GPU device. I do not quite understand.

Is there anything else I can help with or should we close the issue?

FloopCZ avatar Jul 16 '22 14:07 FloopCZ