<p>The reason for this is that the X-Server that is handling the GPUs is not available in the SSH session. Try prefixing all commands with <code>DISPLAY=:0</code>. This tells cgminer which X-Server instance to use. The cgminer command then simply becomes:</p>

<pre><code>DISPLAY=:0 ./cgminer -u ...
</code></pre>

<p>You can also fix this for the current session with the following</p>

<pre><code>export DISPLAY=:0
</code></pre>

<p>this defines the variable in a bash shell (see your shell's documentation for details if you're using another shell). Putting this into your <code>.bashrc</code> file might be a good idea if you intend to use it only over SSH .</p>

CC BY-SA 3.0
2013-12-22T13:51:13.250Z
I have `export DISPLAY=:0` in my script which starts cgminer. I added my start script to my question.
Mariusz
CC BY-SA 3.0
2013-12-22T12:57:21.577Z
2013-12-22T12:57:21.577Z
cdecker
<p>Make sure you have a X session launched.</p>

<p>Either have it auto-login or manually walk over and login in.  Then try your mining script again.  This messed with me for a couple hours.</p>

CC BY-SA 3.0
2014-01-14T12:56:03.860Z
How to start X session? I spent many hours on this and I don't know how to start X session. If you mean X11 forwarding in ssh session then X11 forwarding does not solve issue.
Mariusz
CC BY-SA 3.0
2014-01-13T13:21:52.803Z
2014-01-13T13:21:52.803Z
pro547
<p>You may get better help from this guide (talked about cgm 3.7.2, etc).</p>

<p><a href="http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html" rel="nofollow">http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html</a></p>

CC BY-SA 4.0
2021-02-05T12:12:55.413Z
Blog is now offline an can be found in the archives: https://web.archive.org/web/20190624023359/http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html
Daywalker
CC BY-SA 3.0
2014-01-20T18:43:31.597Z
2014-01-20T18:43:31.597Z
mark
<p>I have AMD Radeon HD 6450 card and Ubuntu is my OS. If I log in normally and start cgminer it works properly and detect my graphic card. Now my monitor is turned off and I connect to my computer by ssh. In this scenario cgminer does not detect my graphic card:</p>

<pre><code>[2013-12-22 13:35:09] Started cgminer 3.7.2
 [2013-12-22 13:35:09] clDevicesNum returned error, no GPUs usable
 [2013-12-22 13:35:09] No devices detected!
 [2013-12-22 13:35:09] Waiting for USB hotplug devices or press q to quit
 [2013-12-22 13:35:09] Probing for an alive pool
 [2013-12-22 13:35:09] Pool 0 difficulty changed to 256
 [2013-12-22 13:35:10] Network diff set to 3.23K
</code></pre>

<p>I suspect that the card is idle because monitor is turned off. To solve this I enabled X11 forwarding in my ssh session but It did not help. </p>

<pre><code>sudo aticonfig --lsa
* 0. 01:00.0 AMD Radeon HD 6450

* - Default adapter
</code></pre>

<p>What can be cause of that situation? Is possible that card is idle? How to check that and how to force card to starts?</p>

<p><strong>EDIT</strong></p>

<p>My cgminer start script:</p>

<pre><code>#!/bin/sh
export DISPLAY=:0
export GPU_MAX_ALLOC_PERCENT=100
export GPU_USE_SYNC_OBJECTS=1
cd /mypath/cgminer-3.7.2-x86_64-built
./cgminer [parameters]
</code></pre>

<p><strong>EDIT</strong></p>

<pre><code>sudo aticonfig --adapter=all --odgt
No protocol specified
No protocol specified
ERROR - X needs to be running to perform AMD Overdrive(TM) commands
</code></pre>

<cgminer><ubuntu><mining-software><amd>
cgminer doesn't detect GPU in ssh session
Mariusz
# cgminer doesn't detect GPU in ssh session

(Asked by: username_0 on 2013-12-22)

I have AMD Radeon HD 6450 card and Ubuntu is my OS. If I log in normally and start cgminer it works properly and detect my graphic card. Now my monitor is turned off and I connect to my computer by ssh. In this scenario cgminer does not detect my graphic card:
[2013-12-22 13:35:09] Started cgminer 3.7.2
 [2013-12-22 13:35:09] clDevicesNum returned error, no GPUs usable
 [2013-12-22 13:35:09] No devices detected!
 [2013-12-22 13:35:09] Waiting for USB hotplug devices or press q to quit
 [2013-12-22 13:35:09] Probing for an alive pool
 [2013-12-22 13:35:09] Pool 0 difficulty changed to 256
 [2013-12-22 13:35:10] Network diff set to 3.23K

I suspect that the card is idle because monitor is turned off. To solve this I enabled X11 forwarding in my ssh session but It did not help. 
sudo aticonfig --lsa
* 0. 01:00.0 AMD Radeon HD 6450

* - Default adapter

What can be cause of that situation? Is possible that card is idle? How to check that and how to force card to starts?
EDIT
My cgminer start script:
#!/bin/sh
export DISPLAY=:0
export GPU_MAX_ALLOC_PERCENT=100
export GPU_USE_SYNC_OBJECTS=1
cd /mypath/cgminer-3.7.2-x86_64-built
./cgminer [parameters]

EDIT
sudo aticonfig --adapter=all --odgt
No protocol specified
No protocol specified
ERROR - X needs to be running to perform AMD Overdrive(TM) commands

**Tags:** cgminer, ubuntu, mining-software, amd


---

## 3 answers

### Answer by username_1 on 2013-12-22. Score: 1

The reason for this is that the X-Server that is handling the GPUs is not available in the SSH session. Try prefixing all commands with DISPLAY=:0. This tells cgminer which X-Server instance to use. The cgminer command then simply becomes:
DISPLAY=:0 ./cgminer -u ...

You can also fix this for the current session with the following
export DISPLAY=:0

this defines the variable in a bash shell (see your shell's documentation for details if you're using another shell). Putting this into your .bashrc file might be a good idea if you intend to use it only over SSH .

> **Comments:**
> **username_0**: I have `export DISPLAY=:0` in my script which starts cgminer. I added my start script to my question.  

---

### Answer by username_2 on 2014-01-13. Score: 1

Make sure you have a X session launched.

Either have it auto-login or manually walk over and login in. Then try your mining script again. This messed with me for a couple hours.

> **Comments:**
> **username_0**: How to start X session? I spent many hours on this and I don't know how to start X session. If you mean X11 forwarding in ssh session then X11 forwarding does not solve issue.  

---

### Answer by username_3 on 2014-01-20. Score: 1

You may get better help from this guide (talked about cgm 3.7.2, etc).

<http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html>

> **Comments:**
> **username_4**: Blog is now offline an can be found in the archives: https://web.archive.org/web/20190624023359/http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html  

---

