본문 바로가기

Linux

(6)
Asynchronous IO Read (Direct I/O) #define _GNU_SOURCE #include #include #include #include #include #include #include #include void main() { char *path="file.txt"; // file path int flag = O_RDWR | O_DIRECT; // direct i/o flag mode_t mode = 0644; int fd = open(path, flag, mode); // open file with direct i/o if(fd == -1) fprintf(stderr, "Can't Open!!\n"); int ret, err; float *buf; int buf_size = 2048*sizeof(float); struct aiocb c_a..
print Memory info function // I used this in AGX Xavier #define MEMINFO "/proc/meminfo" void printMem() { char cmd[1024]; int nMemTot =0; int nMemAva =0; // sprintf(cmd, "/proc/%d/status", getpid()); sprintf(cmd, "/proc/meminfo"); FILE* fp = fopen(MEMINFO, "r"); if(fp == NULL) return; while(fgets(cmd, 1024, fp) != NULL) { if(strstr(cmd, "MemTotal")) { char t[32]; char size[32]; sscanf(cmd, "%s%s", t, size); nMemTot = atoi..
Checking the cudnn 8.x version It's simple. #Check the version of cuDNN 8.x or higher $ cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2 #Check the version of cudnn 7.x or earlier $ cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 # Checking for several version $ nvidia-smi $ nvcc -V
Linux Vim Setting (.vimrc) $ vim ~/.vimrc ##insert this setting if has("syntax") syntax on endif set hlsearch set nu set autoindent set ts=4 set sts=4 set cindent set laststatus=2 set shiftwidth=4 set showmatch set smartcase set smarttab set smartindent set ruler set fileencodings=utf8,euc-kr ##and apply $ source ~/.vimrc
ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost) in Xavier AGX stackoverflow.com/questions/49221565/unable-to-use-cv-bridge-with-ros-kinetic-and-python3 Unable to use cv_bridge with ROS Kinetic and Python3 I had a computer vision project on Ubuntu 14.04 with ROS indigo and python3, then I had to move on Ubuntu 16.04 with ROS kinetic. Here I ran into multiple issues: 1) I installed opencv, but couldn't stackoverflow.com # `python-catkin-tools` is needed for ..
Find python, cuda code with ctags, cscope ctags & cscope install $ sudo apt-get install ctags -y $ sudo apt-get install cscope -y ctags $ ctags -R $ ctags -R --fields=+l --languages=python --python-kinds=-iv -f /.tags ./ # When Permission denied, please use 'sudo' # cscope @ your directory with 'tags' file $ find . -name '*.py' > cscope.files $ cscope -R # with cuda codes rm -rf cscope.files cscope.out tags # or $ rm -rf cscope.* ctags ..