Closed sph001 closed 2 years ago
Hi @sph001
Did you download the GPU version from the TensorFlow C API site?
I did, but is there a way to validate that I have the right version (unfortunately system might have several versions from other users).
When running the GPU version you should get some log about the found devices, or warning about any problem (if any problem exists). As you are not getting this kind of messages I would assume that the linker is using another libtensorflow
.
How are you compiling your program?
I'm not getting any output from the log about found devices.
Using CMake (its a ros package so it has a few other things in it.
cmake_minimum_required(VERSION 3.0.2)
project(osrl_capture)
add_compile_options(-std=c++17)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
cv_bridge
image_transport
)
find_package(OpenCV 4.2.0 REQUIRED)
find_library(TENSORFLOW_LIB tensorflow)
catkin_package(
INCLUDE_DIRS include
LIBRARIES osrl_localization
decklinkSDK
CATKIN_DEPENDS roscpp
std_msgs
cv_bridge
image_transport
# DEPENDS system_lib
)
include_directories(include)
include_directories(include/DeckLinkSDK)
include_directories(include/cppflow)
include_directories(
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
add_executable(osrl_capture src/run.cpp
src/DeckLinkDevice.cpp
include/decklinkSDK/Linux/platform.cpp
include/decklinkSDK/DeckLinkAPIDispatch.cpp)
target_link_libraries(osrl_capture ${catkin_LIBRARIES} ${OpenCV_INCLUDE_DIRS} ${TENSORFLOW_LIB})
I am not an expert on CMake, but maybe you can try with
find_library(TENSORFLOW_LIB tensorflow HINT /path/to/mydir/lib)
And specify the location of your desired libtensorflow.
I have dumped out the linked libaray and it points to:
/usr/local/lib/libtensorflow.so
which is indeed where I installed it (and verified that there is only the gpu capable version there)
I see.
So, the only log you getting from TensorFlow is about oneAPI Deep Neural Network Library (oneDNN)? No other message from TensorFlow?
Does nvidia-smi
work right and shows the available devices?
You can try to specify the device to use with:
CUDA_VISIBLE_DEVICES=0 ./my_executable
only get the oneDNN message
nvidia-smi gives the normal feedback (just for reference: NVIDIA-SMI 510.47.03 Driver Version: 510.47.03 CUDA Version: 11.6)
I have already exported CUDA_VISIBLE_DEVICES=0, added that anyway to the run and didn't get any difference in my run.
I am running out of ideas. I would carefully re-check that you are linking to the correct libtensorflow. Perhaps running the examples and manually setting the library paths so there is no way of opening the wrong library.
Sorry. Anyway, this looks like an issue with libtensorflow and not with cppflow.
no worries. thank you very much for your help.
If you find the problem write it here, in case someone encounters the same issue :)
sorry to have wasted your time. After going through TF_DeviceListName and noticing the GPU wasn't showing up, I completely removed the libtensorflow and replaced it, and now the GPU is being detected.
guessing is someone else attempted to setup tensorflow after I had installed mine (and since there is no way to distinguish between the two) I just assumed it was the way I left it.
closed
I have the below script which I am using to process 1080p video frames with a pretrained resnet50 model. while I expected this to process slowly, but I am only getting about 0.4 fps, which seems much slower than I expected. I have also noticed that the below code will not utilize my GPU and I cannot find a mechanism to attempt to force it to do so.
the only output I get from tensorflow is "2022-03-03 13:53:14.560098: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags."
have I configured something improperly to cause this or is this a limitation?