Nvidia-smi command not found - nvidia drivers installed - driver

~$ nvidia-smi
nvidia-smi: command not found
~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148
Its worked before. I made changes in grub using the command
gksu gedit /etc/default/grub
but revert it back. (I don't know if it could have effect)

Reason
The most common reason for any “command not found” error is that the software being accessed is not installed on the system. Check out the example below where the tool is not installed on the system and the error “nvidia-smi command not found” is thrown:
Solution
The best way of resolving this error is to install the “nvidia-utils” package which will also contain the “nvidia-smi” tool inside it. To install this package, run the command in the terminal:
$ sudo apt install nvidia-utils-515
I got the detailed solution form this post: https://itslinuxfoss.com/fix-nvidia-smi-command-not-found-error/

Related

package 'turtlebot3_gazebo' not found, searching: ['/opt/ros/foxy']

I completed the Quick Start Guide for Foxy. All went well.
I'm using Ubuntu 20.04 on WSL2 Windows 11.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
$ printenv ROS_DISTRO
foxy
$ gazebo -version
Gazebo multi-robot simulator, version 11.11.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
Gazebo multi-robot simulator, version 11.11.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
However, when try to run the simulation
$ export TURTLEBOT3_MODEL=burger
$ ros2 launch turtlebot3_gazebo empty_world.launch.py
It failed with the message
Package 'turtlebot3_gazebo' not found: "package 'turtlebot3_gazebo' not found, searching: ['/opt/ros/foxy']"
How to fix it? I found a similar thread on Reddit but it didn't help much.
As pointed by #Bilal in the comment, I solved the issue by running
sudo apt-install ros-foxy-turtlebot3-gazebo
Then, run the simulation:
set env export TURTLEBOT3_MODEL=burger
run ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
Result:

NVML: Driver/library version mismatch

I don't know why nvidia-smi doesn't work
what I need to do for fix it?
I think my library and driver version is match but nvidia-smi dosen't recognize it
test
I was facing same problem and I'm posting here my solution.
In my case NVRM version was 440.100 and driver version was 460.32.03. My driver was updated by sudo apt install caffe-cuda and I didn't notice that time but I checked it from /var/log/apt/history.log.
By following my NVRM version I just used sudo apt install nvidia-driver-440 but it installed 450.102, I don't know why it installed other version and nvidia-smi is showing 450.102.04.
Anyhow after rebooting my PC everything including cuda is working fine now.
I didn't remove/purge anything related to nvidia driver. Version 460.32.03 was uninstalled automatically by running sudo apt install nvidia-driver-440
For me, this solution from NVIDIA forums solved the issue.
Run sudo apt purge nvidia* libnvidia*
Then sudo apt install nvidia-driver-520

How to setup ROS environment variable on Ubuntu 20.04?

I tried following this guide to install ROS, but even after adding ROS source.list and its key
sudo apt install ros-melodic-desktop-full
gave error.
E: Unable to locate package ros-melodic-desktop-full
Then I ran this command
sudo apt search ros
to see if any such package exists. I couldn't find ros-melodic-desktop-full but I found another similar package ros-desktop-full.
So I installed it instead. The installation went smooth without giving any errors.
Next step in the guide is to set-up ROS environment variable, but I have no such directory
/opt/ros
So how do I setup the environment variable?
P.S.
I also installed some tools and dependencies with this command
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
and initialized rosdep
sudo rosdep init
rosdep update
The ros-desktop-full package you installed is part of the official Ubuntu release.
ROS Melodic (and in the future, Noetic) is published by the OSRF in a separate repository (packages.ros.org). These packages install to /opt/ros/. However, some ROS packages have also been ported to Debian, which is how they found their way to Ubuntu (which derives from Debian).
The Debian packages are fully functional, but they do not install to /opt/ros. Instead, everything is integrated in the operating system itself. This means that you need to set up your personal workspace slightly differently.
Given that most tutorials assume that you use the OSRF packages, I suggest you either wait for the Noetic release (scheduled for the end of May 2020), then install ros-noetic-desktop-full, or downgrade to Ubuntu 18.04 LTS to use ROS Melodic.
From the documentation here, melodic is only supported on Ubuntu 18.04. The ROS version targeting Focal (20.04) is Noetic, but that one has not been released yet (see Distributions). I'm not sure what ROS version Ubuntu packages (the ros-desktop-full one you installed), but I was not successful in using it.
If you really do want to use Ubuntu 20.04, then I think your best option currently is to compile from source. Last time I checked the precompiled debs for Noetic are not yet available at http://packages.ros.org/ros/ubuntu (you can track release progress at github issue 21513). No idea if compiling Noetic from source is easy or hard, but I was able to compile ROS2 foxy from source without too much trouble though.

Install zbar failed on Watson Studio

I tried to execute this
! pip install zbar
The error message is
Collecting zbar
Using cached .../zbar-0.10.tar.bz2
Building wheels for collected packages: zbar
Running setup.py bdist_wheel for zbar ... error
Complete output from command /...:
...
gcc ...
In file included from zbarmodule.c:24:0:
zbarmodule.h:26:18: fatal error: zbar.h: No such file or directory
#include <zbar.h>
^
compilation terminated.
Looks like an include file is missing. Any idea?
As you guessed, it does need zbar-devel to be installed on centos kind systems.
sudo yum install zbar-devel
Sudo is disabled on Jupyter Notebook on watson studio and is only accessible
by Watson Studio - IBM Cloud Operators.
At this moment, it is advisable to raise the Enhancement request so that
Watson studio Development team can consider and install this library by default.
http://ibm.biz/dsxideas
Thanks,
Charles.

Install openCV with CUDA toolkit 8.0

I'm trying to install Opencv 3.2.0 and Nvidia CUDA toolkit 8.0 on Ubuntu 16.04 but I can't configure them together. I get the following error when I try to make project using both:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find CUDA: Found unsuitable version "8.0", but required is exact
version "7.5" (found /usr/local/cuda)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args)
/usr/local/share/OpenCV/OpenCVConfig.cmake:86 (find_package)
/usr/local/share/OpenCV/OpenCVConfig.cmake:105 (find_host_package)
CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
I have tried installing cuda toolkit 7.5 but its not compatible with ubuntu 16.04 I believe. I'm really clueless now, I hope someone can help with this.
Thanks
so I solved this issue by managing to install toolkit 7.5. Here is how I did it:
Updated nvidia driver for my Operating System
Download cuda toolkit 7.5 and extract it to a folder
$ mkdir ~/Downloads/NVIDIA_TOOLKIT
$ cd ~/Downloads
$ ./cuda_7.5.18_linux.run -extract=~/Downloads/NVIDIA_TOOLKIT;
go to the virtual console by pressing Ctrl + Alt + F1 and turn off
lightdm service
$ sudo service lightdm stop
cd to downloads and install the extracted toolkit and samples
$ cd ~/Downloads/NVIDIA_TOOLKIT
$ sudo ./cuda-linux64-rel-6.0.37-18176142.run
$ sudo ./cuda-samples-linux-6.0.37-18176142.run
Set environment variables in .bashrc file
$ PATH=/usr/local/cuda-7.5/bin
$ LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64
Turn back on the lightdm service
$ sudo service lightdm start
Reboot and you should be able to use the nvcc compiler
For openCV you will have to downgrade your gcc/ g++ compiler to 4.9 since it is not yet compatible with the higher versions

Resources