Monday, September 22, 2014

My CUDA debug tour

1. Copy array from device to host and print it.


-------------------------------------------------------------------------------

2. Cuda-gdb

When fundamental functions like cudaMalloc failed,usually it shouldn't be its problem. So, first check if there is cuda device available now (driver problem?), then check if problems happen before cudaMalloc.

Tips: you have to be very careful about memory reading and writing. For example, you read from shared memory with the right index. But if you didn't write to it before, it can cause a hidden error! Usually you would think it should be a random value. But in CUDA, your fundamental functions can fail because of this hidden error!

Before you read, you write. Before you write, you check.

Thursday, September 11, 2014

My Github SSH Conguration

1. Generate my keys both public and private
ssh-keygen -t rsa -C "your_email@example.com"

2. Start ssh agent in the background and add ssh private key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github

3. See the public key content
cat github.pub

4. Go to github website and add public key there.

5. Go to repository and use the SSH version "git@github.com:USERNAME/REPOSITORY.git"

6. Set origin url with repository address
Git remote set-url origin git@github.com:USERNAME/REPOSITORY.git

7. Check if it is all right.
Git remote -v

--------------------------------------------------------------------------------------------------------
 Tips:
1. Clone specific branch
git clone -b <branch> <remote_repo>

2. See history (make sure you are in a folder with ".git")
git log