MocapNET
MocapNET copied to clipboard
CUDA Version: 12.0
My PC has GPU of which CUDA Version is 12.0. But it seems not to be used. Please tell me how to use CUDA Version: 12.0.
The next command generated the following image, which is saying the frame rage is 0.46 /MocapNET2LiveWebcamDemo --from shuffle.webm --openpose --frames 375
This is a common problem with https://github.com/FORTH-ModelBasedTracker/MocapNET/issues/105 which will be answered here
MocapNET needs a version of the libtensorflow2.x C library. The version of tensorflow defines what version of CUDA is compatible or not, MocapNET does not directly need or use any CUDA version.
What needs to be done for CUDA/GPU support thus it to replace the folder dependencies/libtensorflow with a good working tensorflow version/build that includes the correct CUDA version support. If GPU support is malfunctioning/not present MocapNET will fall back to CPU execution, which has the side effect that the 2D joint estimator will run much slower. This is the reason for the very low framerate on the 2D joint estimation you observed. By default the 2D joint estimator runs on the GPU and the 3D estimation on the CPU. If you dont use --openpose and use --forth as a commandline argument you can use a much lighter 2D joint estimator that runs fine on CPU only builds albeit at lower accuracy.
To the best of my knowledge CUDA 12 is not supported by tensorflow AT ALL at the moment as seen from their official list here : https://www.tensorflow.org/install/source#gpu
As you might imagine I am not a Google or NVIDIA employee so unfortunately I cannot do a lot about their version compatibility etc.
The best that can be done seems to be CUDA 11.8 with Tensorflow 2.13 . Please understand that this is a problem at the level of Google/NVIDIA and not mine / MocapNET's fault
Now the latest C library for Tensorflow 2 that can be downloaded pre-compiled from here : https://www.tensorflow.org/install/lang_c seems to be 2.11 which means CUDA 11.2 If you wish to use this instead of the default please change the initialize.sh script to point to your desired version
Now to make things work on your CUDA 12 machine I think this can be done in three ways :
- Compile tensorflow from source from its github repository. I provide a script that automates some of the steps however building tensorflow is very hard since it uses the bazel system and has a ton of quirks ( e.g. specific versions of bazel work with specific versions of tensorflow which work with specific versions of CUDA etc. ) There is an excellent talk called Making Package Maintainers Cry that describes these problems.
- Wait for an official release of a future version of Tensorflow that will be compatible with CUDA 12
- Maybe install docker with NVIDIA support and use the docker script provided to make a docker container with virtualized lower "versions" of CUDA that on the backend on the host system uses CUDA 12
Once again I am sorry for the inconvenience but if Google and NVIDIA with their huge budgets can't fix their compatibility issues I sure can't :) further more unfortunately my development PC has a really old GPU (GTX1050) at the moment, so I am not able to reproduce an environment with CUDA 12 to try and help fixing this myself!
Looking forward to your comments and further questions!