Tutorial by Examples: cpu

Google Perf Tools also provides a CPU profiler, with a slightly friendlier interface. To use it: Install Google Perf Tools Compile your code as usual Add the libprofiler profiler library to your library load path at runtime Use pprof to generate a flat execution profile, or a callgraph diagram...
You can run Theano on multiple CPU cores with the OMP_NUM_THREADS=[number_of_cpu_cores] flag. Example: OMP_NUM_THREADS=4 python gpu_test.py The script theano/misc/check_blas.py outputs information regarding which BLAS is used: cd [theano_git_directory] OMP_NUM_THREADS=4 python theano/misc/ch...
Add the following code in you main program. var cpuprofile = flag.String("cpuprofile", "", "write cpu profile `file`") var memprofile = flag.String("memprofile", "", "write memory profile to `file`") func main() { flag.Parse() ...
// Sets the CPU profiling rate to hz samples per second // If hz <= 0, SetCPUProfileRate turns off profiling runtime.SetCPUProfileRate(hz) // Controls the fraction of goroutine blocking events that are reported in the blocking profile // Rate = 1 includes every blocking event in the profil...
The official website contain good exemple of apps: https://www.opencpu.org/apps.html The following code is used to serve a R session: library(opencpu) opencpu$start(port = 5936) After this code is executed, you can use URLs to access the functions of the R session. The result could be XML, h...
Ubuntu: $ cat /proc/cpuinfo Sample Output: processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz stepping : 11 cpu MHz : 1596.000 cache size : 4096 KB physical id : 0 siblings ...
To get general statistics about main components of Linux family of stat commands are extremely useful CPU To get processors related statistics you can use mpstat command but with some options it will provide better visibility: $ mpstat 2 10 Memory We all know command free to show amount of (r...
The CPU governor itself is just 1 C file, which is located in kernel_source/drivers/cpufreq/, for example: cpufreq_smartass2.c. You are responsible yourself for find the governor (look in an existing kernel repo for your device) But in order to successfully call and compile this file into your ke...
By using tools like lscpu as lscpu is an easy way to get CPU information. $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 So...
Use top command to exam CPU time allocation between user space and kernel space. Explanation: 24.8 us (user space): 24.8% of CPU time is spent on user process. 0.5 sy (system): 0.5% of CPU time is spent on kernel space. ni (niceness): the ratio of CPU time spent on low priority processes. i...
Use time command. time ./perl-timeout-example 100.100.100 We could not ping the desired address! real 0m5.0013s user 0m0.004s sys 0m0.008s Real: Total time from start to finish of the call, including the CPU time spent on other processes. User: The amount of CPU time spent i...
To ensure that a GPU version TensorFlow process only runs on CPU: import os os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf For more information on the CUDA_VISIBLE_DEVICES, have a look to this answer or to the CUDA documentation.
import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(device_count={'GPU': 0})) Bear in mind that this method prevents the TensorFlow Graph from using the GPU but TensorFlow still lock the GPU device as described in this an issue opened on this method. Using the CUDA_VISIBLE_DEVICES se...

Page 1 of 1