Questions tagged [cpu]

The central processing unit or "processor" inside a computer which executes the instructions in a computer program.

The central processing unit (CPU) is the portion of a computer system that carries out the instructions of a computer program, and is the primary element carrying out the computer's functions. The central processing unit carries out each instruction of the program in sequence, to perform the basic arithmetical, logical, and input/output operations of the system. This term has been in use in the computer industry at least since the early 1960s. The form, design and implementation of CPUs have changed dramatically since the earliest examples, but their fundamental operation remains much the same.

Source: Wikipedia

4222 questions
723
votes
9 answers

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

I am new to TensorFlow. I have recently installed it (Windows CPU version) and received the following message: Successfully installed tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc2 Then when I tried to run import tensorflow as tf hello =…
csg
  • 7,556
  • 3
  • 8
  • 28
647
votes
10 answers

How to determine CPU and memory consumption from inside a process?

I once had the task of determining the following performance parameters from inside a running application: Total virtual memory available Virtual memory currently used Virtual memory currently used by my process Total RAM available RAM currently…
Lanzelot
  • 13,862
  • 4
  • 16
  • 13
590
votes
28 answers

How to obtain the number of CPUs/cores in Linux from the command line?

I have this script, but I do not know how to get the last element in the printout: cat /proc/cpuinfo | awk '/^processor/{print $3}' The last element should be the number of CPUs, minus 1.
Richard
  • 12,738
  • 17
  • 48
  • 75
399
votes
17 answers

How to get current CPU and RAM usage in Python?

What's your preferred way of getting current system status (current CPU, RAM, free disk space, etc.) in Python? Bonus points for *nix and Windows platforms. There seems to be a few possible ways of extracting that from my search: Using a library…
lpfavreau
  • 11,693
  • 5
  • 28
  • 35
307
votes
13 answers

Optimal number of threads per core

Let's say I have a 4-core CPU, and I want to run some process in the minimum amount of time. The process is ideally parallelizable, so I can run chunks of it on an infinite number of threads and each thread takes the same amount of time. Since I…
Juliet
  • 76,873
  • 44
  • 191
  • 224
297
votes
23 answers

How to create a CPU spike with a bash command

I want to create a near 100% load on a Linux machine. It's quad core system and I want all cores going full speed. Ideally, the CPU load would last a designated amount of time and then stop. I'm hoping there's some trick in bash. I'm thinking…
User1
  • 35,366
  • 60
  • 170
  • 251
283
votes
4 answers

Once upon a time, when > was faster than < ... Wait, what?

I am reading an awesome OpenGL tutorial. It's really great, trust me. The topic I am currently at is Z-buffer. Aside from explaining what's it all about, the author mentions that we can perform custom depth tests, such as GL_LESS, GL_ALWAYS, etc. He…
Armen Tsirunyan
  • 120,726
  • 52
  • 304
  • 418
258
votes
10 answers

What does multicore assembly language look like?

Once upon a time, to write x86 assembler, for example, you would have instructions stating "load the EDX register with the value 5", "increment the EDX" register, etc. With modern CPUs that have 4 cores (or even more), at the machine code level does…
Paul Hollingsworth
  • 11,954
  • 12
  • 48
  • 66
218
votes
7 answers

Difference between core and processor

What is the difference between a core and a processor? I've already looked for it on Google, but I'm just having multi-core and multi-processor definition, but it doesn't match what I am looking for.
Saad Achemlal
  • 2,737
  • 5
  • 13
  • 16
215
votes
5 answers

How to get overall CPU usage (e.g. 57%) on Linux

I am wondering how you can get the system CPU usage and present it in percent using bash, for example. Sample output: 57% In case there is more than one core, it would be nice if an average percentage could be calculated.
user1199739
  • 2,207
  • 2
  • 13
  • 6
190
votes
11 answers

How do I monitor the computer's CPU, memory, and disk usage in Java?

I would like to monitor the following system information in Java: Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total) *Note that I mean overall memory available to the whole system, not just the JVM. I'm…
David Crow
  • 15,341
  • 8
  • 39
  • 34
115
votes
7 answers

GPU Emulator for CUDA programming without the hardware

Question: Is there an emulator for a Geforce card that would allow me to program and test CUDA without having the actual hardware? Info: I'm looking to speed up a few simulations of mine in CUDA, but my problem is that I'm not always around my…
Narcolapser
  • 4,937
  • 14
  • 42
  • 52
113
votes
3 answers

CPU Privilege Rings: Why rings 1 and 2 aren't used?

A couple of questions regarding the x86 CPU privilege rings: Why aren't rings 1 and 2 used by most operating systems? Is it just to maintain code compatibility with other architectures, or is there a better reason? Are there any operating systems…
user541686
  • 189,354
  • 112
  • 476
  • 821
111
votes
7 answers

How exactly does the callstack work?

I'm trying to get a deeper understanding of how the low level operations of programming languages work and especially how they interact with the OS/CPU. I've probably read every answer in every stack/heap related thread here on Stack Overflow, and…
Christoph
  • 21,851
  • 24
  • 86
  • 121
100
votes
15 answers

How do I check CPU and Memory Usage in Java?

I need to check CPU and memory usage for the server in java, anyone know how it could be done?
Johnny Bou
  • 1,013
  • 2
  • 8
  • 6
1
2 3
99 100