Saturday, January 16, 2021

How to copy a public key to a server

 First make sure you have a public key and an authorized_keys file under you ~/.ssh folder

If you don't have a public key (id_rsa.pub) a file under the .ssh directory, then you can run the ssh-keygen command

ssh-keygen

Just press enter and use the default values for the key. 

Also, create the authorized_keys file to put in there the public keys of the other computers

cat ~/.ssh/id_rsa.pub | ssh ip.address 'cat >> .ssh/authorized_keys'

Wednesday, June 5, 2019

How to install XRDP and ssh on Ubuntu 16.04

Follow this link to get XRDP installed on Ubuntu 16.04

For ssh simply install
sudo apt-get install openssh-server

How to install CUDA and 4xx driver on Ubuntu XX.04

Download and install the drivers using the apt-get commands as such:

sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update

You can check which drivers you can install by doing:

ubuntu-drivers list

Install the driver:

sudo apt-get install nvidia-4xx

Reboot your system:

sudo reboot

Check the driver is working with

nvidia-smi

You should see the GPU and memory use

Download the CUDA 1x.0 toolkit and install it following the steps on the script. Skip the step that asks to install the drivers.
https://developer.nvidia.com/cuda-10.0-download-archive

make sure that you also have your cuda and compiler and static libraries on your path and ld library path as explained in the Nvidia documentation. In essence, make sure you have these variables on updated on your ~/.bashrc file

export PATH=$PATH:/usr/local/cuda-10.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64

Try to compile one of the examples from CUDA.
In case you have problems compiling some of the CUDA examples,
install mesa-utils to get glxinfo working to see if your GPU is working with CUDA
and any other updates such as
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev
libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
libglfw3-dev libgles2-mesa-dev

Download cuDNN tar file under cuDNN Linux and install it following the instruction:
https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html

Basically:
$ tar -xzvf cudnn-10.0-linux-x64-v7.tgz

Copy the following files into the CUDA Toolkit directory, and change the file permissions.

$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*





Saturday, May 11, 2019

How to install GPU Quadro P600 drivers and CUDA 10.0 on Ubuntu 18.04

You can download and install the drivers first:
Here is a link that explains how to do so
https://www.mvps.net/docs/install-nvidia-drivers-ubuntu-18-04-lts-bionic-beaver-linux/

Or you can also download CUDA installer and it will ask you if you want to install the drivers.
I did installed the drivers first.

Make sure you have the correct drivers on your list before you install them
You can check which drivers you can install by doing
ubuntu-drivers list

Check the driver is working with

nvidia-smi

You should see the GPU and memory use

Download the CUDA 10.0 toolkit and install it following the steps on the script.
https://developer.nvidia.com/cuda-10.0-download-archive



Download cuDNN tar file under cuDNN Linux and install it following the instruction:
https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html

Basically:
$ tar -xzvf cudnn-10.0-linux-x64-v7.tgz

Copy the following files into the CUDA Toolkit directory, and change the file permissions.

$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

make sure that you also have your cuda and compiler and static libraries on your path and ld library path as explained in the Nvidia documentation. In essence, make sure you have these variables on updated on your ~/.bashrc file

export PATH=$PATH:/usr/local/cuda-10.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64

In case you have problems compiling some of the CUDA examples,
install mesa-utils to get glxinfo working to see if your GPU is working with CUDA
and any other updates such as
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev
libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
libglfw3-dev libgles2-mesa-dev




Friday, January 18, 2019

How to kill and free tensorboard port

fuser -k -n tcp 6006

Wednesday, October 17, 2018

Mac Laptop screen going black when opening window while connected to egpu Nvidia

After installing my Akitio egpu on my mac as discussed in the previous post, I faced an annoying issue: when opening a window like in a browser; the screen on my laptop would go black whereas the screen in my external monitor connected to the egpu would stay on. This is a weird issue that seemed to pertain to a configuration of some type or a glitch on the driver. After spending more time than I wanted to put on this issue, I found this post that helped me solve the problem:

https://egpu.io/forums/mac-setup/wip-nvidia-egpu-support-for-high-sierra/paged/43/

Basically one of the people were having a similar problem and noticed that the energy saving setting was not set properly.
He basically did this:

 System Preferences > Energy Saver > to uncheck "Automatic Graphics Switching"

That seemed to make the problem go away and now I am up in business again. The only other issue I notice is that sometimes my monitors are a little laggy for some reason. I am not sure how much it is related to the egpu or a totally different issue with my computer but in the meantime I expect I will be able to get some work done with my computer in this state. Thanks all the people out there posting their solutions. It really helped.

Update: the screen going black when opening Chrome was an issue of Chrome and also there are other applications that might also have a similar problems. The issue is related to having the graphics switching enable which allows to switch between integrated or discrete GPU in order to save energy. Most applications do not need the GPU for regular tasks. However, for some reason Chrome does need to run the discrete GPU and since I am running an external GPU, there is a conflict with my eGPU and the discrete GPU. I tried to see if there is a way to disable the the discrete GPU and although there is some commands that could help doing such, it seemed a lot of work for trying to run just Chrome. I noticed that if I stop running Chrome, then everything else works well. So in the meantime I have decided to use other browsers to avoid the "black screen of death" :)
I am still yet looking for a solution for this issue so if you know of a good solution for high Sierra please let me know.
Update: One of the posts I saw suggested to close the laptop when using the GPU on an external monitor in order to make sure the discrete GPU is being used. So I turned on the graphics switching and connected two external monitors. I close the laptop and just used the external monitor. I can report that so far my setup is pretty good. It is sometimes laggy with Chrome and other apps that use GPU, however, they still work and don't crash the screen like with the laptop screen. I can at least get some work done now.
Thanks

Installing Akitio Thunder 3 Nvidia egpu on MacBook Pro 2016 with AMD built-in gpu

Installing an egpu on a mac should straight forward except when you run into some issues like I did that made me spent more time than I wanted on this.

By following the steps in this tool it should have you up and running the Akitio box with this configuration:

https://github.com/learex/macOS-eGPU/tree/master#macos-egpush

Other scripts that might be helpful are:

https://github.com/marnovo/macOS-eGPU-CUDA-guide#step-by-step-tutorials

It would be a good idea to start a fresh installation and remove all previous drivers and solutions as well as even clearing nvram just in case (optional):

https://www.macworld.com/article/2881177/macs/how-to-reset-your-macs-nvram-pram-and-smc.html

After running the first script mentioned here, I was able to get the card recognized and running on my Mac. However, I encountered an issue when opening a window like for a browser; the screen on my laptop would go black whereas the screen in my external monitor connected to the egpu would stay on. This seem a weird issue that seemed to pertain to a configuration of some type or a glitch on the driver. The way I solved this is explain in the next post. I hope you didn't have any issues and that your were happily able to get your Akitio box working.