Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Thursday, December 1, 2011

Perl - Installing Tk on Strawberry Perl

v 0.2

I recently started looking at the options for using Perl on Windows.  One can install it through Cygwin, which may be a good option, or install either the Activestate or Strawberry versions.

I first stumbled across Strawberry when I spotted a random quote that Larry Wall uses it when he has to use Windows, so I looked further.  It is open source and comes with its own C compiler suite for use in installing Cpan modules.  I liked that Strawberry was more closely integrated with Cpan than Activestate, although the latter has its own Perl Package Manager.

Then I thought I'd like to look at using the Tk graphical toolkit with Perl, and discovered that it didn't appear to be included in either product.  I thought it would be a good opportunity to try installing Tk on Strawberry using the " cpan " facility.  So started an adventure that almost had me uninstalling the whole thing and going to Activestate.

Now, I'd installed the 32 bit version of Strawberry 5.12 on my 64 bit Win7 box.  No matter what I did, the installation failed when  " dmake " was unable to recognise some file extensions in the compiler suite.  So in a last ditch effort, I uninstalled the 32 bit version and downloaded the 64 bit Strawberry 5.14 preview and installed that.  The appropriate directories were in the "path" and so I opened a command line window and typed:

cpan Tk

It all downloaded and dmake built the Tk system however when dmake tried to test, the test failed and dumped me back to the command line.  All was not lost however, since there is only one more step needed, the actual install.  I changed to the downloaded and unpacked Tk source directory in " cpan\build " and simply typed:

dmake install

and the installation completed.  Here is some advice I found in my searching to manually install Cpan modules in Strawberry if you need to:

http://www.perlmonks.org/?node_id=841828
-----------------------------------------------------------------------
Try manual installation if CPAN install fails. Try following:
1. Download tar.gz file
2. Extract using Winzip or 7zip
3. go to the folder "Tk-804.028_503" in command prompt
4. type: dmake
5. type: dmake test
5. type: dmake install
----------------------------------------------------------------------

Anyway, I now have a working Tk module in my Perl install - I shall monitor the situation, since this is a little complex if you have a client that needs to install Perl/Tk .....


Later

Thursday, June 16, 2011

Debian Squeeze for My Parents - Config Issues - Pt3

v 0.3

Grub2

Once I'd finished installing Squeeze on my Parent's Computer, I had a dual-boot machine that booted by default into Debian. Initial installation failed to include the Windows XP selection on the bootloader menu, however I wanted it to boot into Windows as the default operating system.

Debian uses the Grub2 bootloader.  Of course, a Windows selection SHOULD appear but didn't.  Instead, the default display had two selection lines, the first being for the normal Debian Squeeze kernel, and the second for a Rescue Mode boot into Debian.  How to organise Grub the way we want it?

The Debian Wiki, of course!  First search the wiki for the bootloader Grub2.  The first challenge we have is to have it recognise the Windows installation.  The clue is in the wiki.  Open a root terminal and:

update-grub

There is now a third line on the Grub menu, pointing to the Windows XP partition.

Next, we are told "To configure grub "v2", you should edit /etc/default/grub, then run update-grub."  Opening this file (as root) shows us the first two uncommented lines as:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5

The first line tells us that the default boot entry is on Line 0 (zero), the top one and that there will be a 5 second delay before the boot continues.  I changed the entries to:

GRUB_DEFAULT=2
GRUB_TIMEOUT=20

I now had the default boot line as line 2 (the third line down) and the default timeout at 20 seconds (to give adequate time to change the selection - don't forget pressing "Enter" will continue the boot process straight away).

update-grub

All fixed!


Tip - Edit file as Root

Open a root terminal window, change to the directory where the file you want to edit is located and:

gedit

gedit opens as root and can edit and save the file as root.

Tip - Open Nautilus File Manager as Root

As above but:

nautilus

and the Gnome file manager starts so you can copy files as root.

Adobe Flash

Whilst there is a package that purports to load Adobe Flash, it didn't work for me.  HowtoForge tells you how to disable the Gnash Flash plugin in "Iceweasel/Firefox", which is a good idea.

To enable flash the manual way, download the tarball for linux from Adobe and extract as root the "libflashplayer.so" file (I think it is called).  Copy it to " /usr/lib/mozilla/plugins " and it will show up nicely in Iceweasel and play Youtube videos for you.

ntfs

Use synaptic to ensure the " ntfs-3g " package is installed.

Assuming Windows is on /dev/hda1, create a directory under either /mnt or /media, say /mnt/windows .

Edit fstab (save the current one as a backup) and add a line such as this on the last line.


/dev/hda1     /mnt/windows     ntfs-3g     defaults

That should do it - you can now read and write to the windows partition.


That's it for the moment, however I still had to configure the router for SSH access - next part.


Later ......

Debian Squeeze for My Parents - Strategy - Pt1

v 0.2

My Parents are getting on in years, and with me living on the other side of the country to them, I don't get to visit perhaps as often as we all think we should.  So, since I had a couple of weeks free recently, I jumped on an aircraft and paid a visit for a week.

One of the items on my "list of things to do" was to see what I could do to improve their computing experience - particularly in the areas of security and to make their use of the machine as a communication device a more pleasant experience.  What I would have liked to have done is to just buy them an iMac, however I knew they would have regarded that as an extravagance and would have resisted because it was "different".  My Brother-in-law had been helping them as he could, however he was "time-poor" and couldn't devote all the time that was probably needed to teach them what they needed to know, and I certainly didn't want to get in his way since he was there and I wasn't.

I remember the desktop as being an early Pentium 4 machine with not much memory, and I'd been told that there had been a bit more memory put in, so I thought I'd just take stock of what was there.  When I fired the machine up, my first thought was .. this is rather snappy!  It was a newer machine than I'd remembered and quite nice for what it was:
  • 15inch LCD Screen
  • Pentium 4 3.2 gig
  • 1 gig memory
  • DVD RW
  • FDD
  • 80 gig HDD
  • Windows XP Home
Internet access was using Internet Explorer through a router, and I found that the virus protection hadn't been updated in a few months.  For me, the only good thing here was that the machine was behind a router.  My personal, biased opinion is that you have to be nuts to use IE on a regular basis, however on a more rational level, Windows XP is rapidly becoming outdated, is inherently less secure than current systems, and can not run the latest Internet Explorer browser.  Outdated virus protection certainly didn't help.

Aha! I thought, there may be a zero-cost way to improve things here.  Importantly though, in installing a new system on the machine, it is important that Windows still boots up by default.  Forcing them into this "new fangled system" just gets the ire up and works against what you want to achieve.

After thinking about it all, I decided to use the last 30 gig of the HDD for Debian, and setting it up so that the system defaulted to Windows.

Next, the installation.


Later ..........

Saturday, June 4, 2011

Bitcoin - Solo Mining - Windows 7 - ATI HD 6970

v 0.7
Before you do anything with Bitcoin, you need to be running the Bitcoin software.  Of course, you will have visited the Bitcoin website and read everything there.  The software is on the front page of the website.

Bitcoin Website.

I ran the software for a couple of days before I realised that I was only using the Intel processor, not my video card's GPU to generate bitcoins.  Some research and I downloaded Guiminer and tried that, however whilst this provided part of the puzzle, it failed to get things working and I ended up doing the gruntwork with the command line "poclbm".  Of course, since the command line programs are supplied with Guiminer, then no extra download for that is needed.

The final piece of the puzzle is getting "OpenCL" working.  Guiminer does NOT recognise the latest AMD incarnation, only the previous one.  I ended up installing both, so had to choose when I started the command line up, as you will see when I get to the startup command line instructions.

Software
Guiminer
https://github.com/Kiv/poclbm
Download button on the upper right lets you download the latest .. here is a direct link to the latest at time of writing:  https://github.com/downloads/Kiv/poclbm/guiminer-20110521.exe

Stream opencl
http://developer.amd.com/Downloads/ati-stream-sdk-v2.3-vista-win7-32.exe
http://developer.amd.com/Downloads/ati-stream-sdk-v2.3-vista-win7-64.exe
http://developer.amd.com/Downloads/ati-stream-sdk-v2.3-xp32.exe
http://developer.amd.com/Downloads/ati-stream-sdk-v2.3-xp64.exe

or

AMD SDK
amd-app-sdk-v2.4-windows-64.exe    from
http://developer.amd.com/sdks/amdappsdk/downloads/pages/default.aspx


Here is a guide for guiminer which helped me to get started, however I had to work out the end details:  http://forum.bitcoin.org/index.php?topic=10438

Procedure

Install and run Bitcoin.  For mining with your GPU, you will need to run bitcoin as a server, but for the moment, we can look at the interface.  There is your bitcoin wallet address, and on the bottom right, your connection status and downloaded blocks.  If you want to generate coins with your CPU, then click "settings" and "generate coins".  Don't expect much.

Make sure you have un-installed any conflicting video drivers and installed the latest ATI drivers for the 6970.  I also ran a registry cleaner to make sure there were no confusing pointers, then rebooted.

If I had to do it over again, I would only load the "ati-stream-sdk-v2.3".  Guiminer recognises it and it saves an extra flag in the command line.  Reboot.

Install and run "guiminer".  Have it in a convenient directory that is easy to refer to on the command line.  We will be using the "poclbm" program it comes with later.  What you get out of running the command line is that you can set up the configuration files.  IF you have installed the stream sdk properly, then everything will work when it starts up and you will see it has found your video card in the "Device" drop down, otherwise it will complain that it can't find an "opencl" device.
  • Select "solo" miner.
  • Under solo utilities, enter the username and password you wish to use to log into the bitcoin server.
  • Enter any extra flags you want to use for the device (see the hardware comparison from the previous post).
  • Save the configuration.
There are two configuration files:

First
\User\AppData\Roaming\bitcoin\bitcoin.conf
Within that file, should be two lines set from guiminer.
        rpcuser=username
        rpcpassword=password

Next
\User\\AppData\Roaming\poclbm\poclbm.ini
Inside this is the solo miner configuration.

{
    "profiles": [
        {
            "username": "user",
            "balance_auth_token": "",
            "name": "Default",
            "hostname": "localhost",
            "external_path": "",
            "flags": "-f60 -v -w128",
            "autostart": false,
            "device": 0,
            "password": "password",
            "port": "8332"
        },
    ],
    "bitcoin_executable": "C:\\Program Files (x86)\\Bitcoin\\bitcoin.exe",
    "show_opencl_warning": true,
    "show_summary": true,
    "show_console": false
}

The Command Line

Open the command line.

       start /D"C:\Program Files (x86)\Bitcoin" bitcoin.exe -server

This line starts the bitcoin program as a server.  The bitcoin window will open as a separate process. The directory switch means you can run the command from anywhere.
Wait till a connection has been made.

start /DC:\pro\guiminer poclbm.exe --platform=1 --device=0 --user=username --pass=password

Enter the above command line (altered for your machine of course).  Note the directory switch nominates the directory - there is a space between the directory and the program executable name.  Also note the --platform switch.  I use 1 because I have two possible libraries as I have both the AMD and the ATI Stream libraries loaded - ATI Stream is the second one (1) that the system recognised first, so I'm staying with that.  I follow it with the device switch which is the video card, and then the username and password that you set in the configuration file.

It took me a while to get it sorted, but then my Video card sprang to life and the fan went wild and you could almost feel the load.  Instead of 3 M/hash per second, I was getting 350 M/hash per second.

Best of luck and I hope it works as advertised.



Later ...

Update:
I included a flag "-f60" in the poclbm.ini file.  I found without that flag, the default of "-f30" made the priority of the poclbm process too high.  I would find that after an hour or so, with the computer churning away, if I came back and wanted to do some work on the machine, it would apparently "lock" up on me and I'd have to reboot.

Update 2:
The "-f60" flag has definitely improved stability with no noticeable loss of processing.  The only problems I've had is when trying to play a Youtube video, when the system locks up.

Update 3:
The lock-up remains no matter what "f" flag I use.  It would appear that Flash video and bitcoin mining are mutually exclusive.

Update 4:
The solution I use (for the machine lockup with video playback) is to use a virtual machine for much of my work.  I have Debian 64 set up as a virtual machine using Virtualbox, and I also have instructions for a Slackware VM elsewhere in this blog.  Video playback works fine in the VM and it all works seemlessly.  My normal use of the machine barely touches its capabilities and I can run the mining on Windows.

Update 5:
Yesterday I found I had "rcp connection problems".  Solutions presented on the net didn't work for me.  Then I had a look at the bitcoin version I had (21) .... I updated to the latest (23) and the problems went away.  I also discovered that once you start the bitcoin server, you can then start the poclbm miner.  It will complain about no connection etc but as soon as there is one it starts churning away.

Update 6:
There was an update to my Catalyst Control Center from AMD tonight.  It broke the miner I had sorted.  That's the bad news - it gets better from here.  In the article above, I talk of downloading the ATI stream SDK 2.3 ... well, that is broke and we must move on.  Install the AMD 2.4 SDK and all will be fine.  In my setup, I had both - the 2.4 was platform 0 and the 2.3 was platform 1 (as reported to me).  I simply changed the "platform=1" switch to "platform=0" and all was again well.

Monday, May 30, 2011

Installing an ATI HD 6970

v 0.2

I'm getting old.  It used to be easy doing this stuff.  Stick the card in, load the driver and away you went.

Not so now.  Let's start at the very beginning, as Julie Andrews advised.

I have a quad-core Win7 64 desktop I keep for a WWII Flight Simulator.  A very good flight simulator as it turns out .. and then there is FS-X with the Pmdg 747-438 (which I haven't played with for a while, but nostalgia might get to me).  I was using an nVidia GTS 450, DVI cable and Chimei 22 inch monitor at 1650x1080 resolution.

Now, IL2 ( the WWII Flight Sim ) has released a new version.  Wonderful graphics BUT needs tweeking and VERY demanding of video cards.  An HD 6970 or nVidia 570 would probably be the minimum you would think of.

Back to the installation.  I removed the nVidia card and replaced it with the 6970.  That 6970 sure is a much heftier card than the GTS 450.  First problem.  I ran out of power supply points.  Then I realised I had replaced the power supply some time ago with a more powerful one and I had some spare cables.  Reading the labels on the spare plugs on the power supply - hmmm specific plugs for video power supply.  Search my desk drawers .. presto .. connect and done!

Connect the DVI cable to the main port (the card has DVI and HDMI output) and boot.  Blank screen.  Let it churn for a while.  Reboot.  Churn and then ... a screen at 640 x 480.  Install drivers, then update drivers .. screen resolution STILL only 640 x 480.  Bother.

Phone a friend.  It is the monitor.  Find drivers for the Chimei monitor ... nope.  Bother.  Final suggestion was to use the DVI - VGA plug and plug the monitor in using the VGA cable.

TA-DA

Worked like a charm and straight to the native resolution.

So now, I need to find a driver for either my Chimei monitor OR a similar 22 inch monitor that does 1650 x 1080 and then try DVI again.


Now where did I leave that Horse-hair vest .........


Later....