ps aux | grep rCUDA | tee -a rcuda_ps
pids=`awk -F " " '{print $2}' rcuda_ps`
for i in "${pids[@]}"; do kill -9 $i; done
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool save_program_bin(cl_program program, cl_device_id device, const char *filename) | |
{ | |
// step 1: find out deivces attached to the program | |
cl_uint devNum = 0; | |
cl_int ret; | |
ret = clGetProgramInfo(program, CL_PROGRAM_NUM_DEVICES, sizeof(cl_uint), &devNum, NULL); | |
if(ret != CL_SUCCESS) { | |
printf("\n[OMG]Failed to query for the number of devices.\n"); | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /opt/rocm/.info/version && echo -e '\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo quit | nvidia-cuda-mps-control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export CUDA_VISIBLE_DEVICES="0" | |
nvidia-smi -i 0 -c DEFAULT | |
nvidia-cuda-mps-control -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset --hard HEAD^ | |
git push origin master --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cut -d: -f1 /etc/passwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
notebook_file=$1 | |
echo $notebook_file | |
file_name=`echo "$notebook_file" | cut -d'.' -f1` | |
echo $file_name | |
py_file=$file_name".py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
if __name__ == "__main__": | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(("localhost", 9000)) | |
data = "some data" | |
sock.sendall(data) | |
result = sock.recv(1024) | |
print result | |
sock.close() |